Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ makeEditText :: Monad m => ParsedModule -> DynFlags -> AddMinimalMethodsParams -
makeEditText pm df AddMinimalMethodsParams{..} = do
mDecls <- MaybeT . pure $ traverse (makeMethodDecl df) methodGroup
let ps =
#if !MIN_VERSION_ghc(9,9,0)
#if !MIN_VERSION_ghc(9,10,0) || MIN_VERSION_ghc(9,10,1)
makeDeltaAst $
#endif
pm_parsed_source pm
Expand Down
6 changes: 6 additions & 0 deletions plugins/hls-class-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ codeActionTests = testGroup
getActionByTitle "Add placeholders for 'g','h'"
, goldenWithClass "Creates a placeholder when all top-level decls are indented" "T7" "" $
getActionByTitle "Add placeholders for 'g','h','i'"
, testGroup "with preprocessors"
[ knownBrokenInEnv [GhcVer GHC910]
"See issue https://github.com/haskell/haskell-language-server/issues/4731 for details." $
goldenWithClass "Creates a placeholder for '<>'" "T8" "diamond" $
getActionByTitle "Add placeholders for '<>'"
]
, goldenWithClass "Don't insert pragma with GHC2021" "InsertWithGHC2021Enabled" "" $
getActionByTitle "Add placeholders for '==' with signature(s)"
, goldenWithClass "Insert pragma if not exist" "InsertWithoutPragma" "" $
Expand Down
6 changes: 6 additions & 0 deletions plugins/hls-class-plugin/test/testdata/T8.diamond.expected.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data Set a = Set

instance Semigroup (Set a) where
(<>) = _

instance Monoid (Set a) where
5 changes: 5 additions & 0 deletions plugins/hls-class-plugin/test/testdata/T8.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data Set a = Set

instance Semigroup (Set a) where

instance Monoid (Set a) where
Loading