Skip to content

Commit 14e94b7

Browse files
authored
Re-introduce call to makeDeltaAst to fix #4731 (#4814)
* Attempt to fix #4731 * Filter new test on win * Use Avoid makeDeltaAst only for 9.10.0 * Avoid makeDeltaAst only for 9.10.*
1 parent 4eefbff commit 14e94b7

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

plugins/hls-class-plugin/src/Ide/Plugin/Class/ExactPrint.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ makeEditText :: Monad m => ParsedModule -> DynFlags -> AddMinimalMethodsParams -
2424
makeEditText pm df AddMinimalMethodsParams{..} = do
2525
mDecls <- MaybeT . pure $ traverse (makeMethodDecl df) methodGroup
2626
let ps =
27-
#if !MIN_VERSION_ghc(9,9,0)
27+
#if !MIN_VERSION_ghc(9,10,0) || MIN_VERSION_ghc(9,11,0)
2828
makeDeltaAst $
2929
#endif
3030
pm_parsed_source pm

plugins/hls-class-plugin/test/Main.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ codeActionTests = testGroup
6666
getActionByTitle "Add placeholders for 'g','h'"
6767
, goldenWithClass "Creates a placeholder when all top-level decls are indented" "T7" "" $
6868
getActionByTitle "Add placeholders for 'g','h','i'"
69+
, testGroup "with preprocessors"
70+
[ knownBrokenInEnv [GhcVer GHC910]
71+
"See issue https://github.com/haskell/haskell-language-server/issues/4731 for details." $
72+
goldenWithClass "Creates a placeholder for '<>'" "T8" "diamond" $
73+
getActionByTitle "Add placeholders for '<>'"
74+
]
6975
, goldenWithClass "Don't insert pragma with GHC2021" "InsertWithGHC2021Enabled" "" $
7076
getActionByTitle "Add placeholders for '==' with signature(s)"
7177
, goldenWithClass "Insert pragma if not exist" "InsertWithoutPragma" "" $
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
data Set a = Set
2+
3+
instance Semigroup (Set a) where
4+
(<>) = _
5+
6+
instance Monoid (Set a) where
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data Set a = Set
2+
3+
instance Semigroup (Set a) where
4+
5+
instance Monoid (Set a) where

0 commit comments

Comments
 (0)