Skip to content

Commit 434678e

Browse files
authored
Build with 9.2 (#2696)
1 parent 6cdd5be commit 434678e

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

cabal-ghc921.project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ constraints:
4444
-- These plugins don't build/work on GHC92 yet
4545
haskell-language-server
4646
+ignore-plugins-ghc-bounds
47-
-alternateNumberFormat
4847
-brittany
4948
-class
5049
-eval

ghcide/src/Development/IDE/GHC/Compat/Core.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ module Development.IDE.GHC.Compat.Core (
141141
ImportSpec(..),
142142
-- * SourceText
143143
SourceText(..),
144+
#if !MIN_VERSION_ghc(9,2,0)
145+
rationalFromFractionalLit,
146+
#endif
144147
-- * Name
145148
tyThingParent_maybe,
146149
-- * Ways
@@ -1076,3 +1079,8 @@ collectHsBindsBinders x = GHC.collectHsBindsBinders CollNoDictBinders x
10761079
pattern HsLet xlet localBinds expr <- GHC.HsLet xlet (SrcLoc.unLoc -> localBinds) expr
10771080
pattern LetStmt xlet localBinds <- GHC.LetStmt xlet (SrcLoc.unLoc -> localBinds)
10781081
#endif
1082+
1083+
#if !MIN_VERSION_ghc(9,2,0)
1084+
rationalFromFractionalLit :: FractionalLit -> Rational
1085+
rationalFromFractionalLit = fl_value
1086+
#endif

plugins/hls-alternate-number-format-plugin/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ To generate suggestions, the plugin leverages the `Numeric` package which provid
3838
## Changelog
3939
### 1.0.0.0
4040
- First Release
41+
42+
### 1.0.1.0
43+
- Dependency upgrades
44+
45+
### 1.0.1.1
46+
- Buildable with GHC 9.2

plugins/hls-alternate-number-format-plugin/hls-alternate-number-format-plugin.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-alternate-number-format-plugin
3-
version: 1.0.1.0
3+
version: 1.0.1.1
44
synopsis: Provide Alternate Number Formats plugin for Haskell Language Server
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>

plugins/hls-alternate-number-format-plugin/src/Ide/Plugin/Literals.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fromIntegralLit :: RealSrcSpan -> IntegralLit -> Maybe Literal
8585
fromIntegralLit s IL{..} = fmap (\txt' -> IntLiteral s txt' il_value) (fromSourceText il_text)
8686

8787
fromFractionalLit :: RealSrcSpan -> FractionalLit -> Maybe Literal
88-
fromFractionalLit s FL{..} = fmap (\txt' -> FracLiteral s txt' fl_value) (fromSourceText fl_text)
88+
fromFractionalLit s fl@FL{fl_text} = fmap (\txt' -> FracLiteral s txt' (rationalFromFractionalLit fl)) (fromSourceText fl_text)
8989

9090
fromSourceText :: SourceText -> Maybe Text
9191
fromSourceText = \case
@@ -116,5 +116,5 @@ literalToString = \case
116116
overLitToString :: OverLitVal -> String
117117
overLitToString = \case
118118
HsIntegral int -> case int of { IL{il_value} -> "IntegralOverLit: " <> show il_value}
119-
HsFractional frac -> case frac of { FL{fl_value} -> "RationalOverLit: " <> show fl_value}
119+
HsFractional frac -> case frac of { fl -> "RationalOverLit: " <> show (rationalFromFractionalLit fl)}
120120
HsIsString _ str -> "HIsString: " <> show str

0 commit comments

Comments
 (0)