Skip to content

Commit 9e30310

Browse files
committed
Restore hlint test changing doc content
1 parent 65ae9bd commit 9e30310

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@ hlintTests = testGroup "hlint suggestions" [
9595

9696
liftIO $ noHlintDiagnostics diags'
9797

98+
, testCase "changing document contents updates hlint diagnostics" $ runHlintSession "" $ do
99+
doc <- openDoc "ApplyRefact2.hs" "haskell"
100+
testHlintDiagnostics doc
101+
102+
let change = TextDocumentContentChangeEvent
103+
(Just (Range (Position 1 8) (Position 1 12)))
104+
Nothing "x"
105+
changeDoc doc [change]
106+
expectNoMoreDiagnostics 3 doc "hlint"
107+
108+
let change' = TextDocumentContentChangeEvent
109+
(Just (Range (Position 1 8) (Position 1 12)))
110+
Nothing "id x"
111+
changeDoc doc [change']
112+
testHlintDiagnostics doc
113+
98114
, knownBrokenForGhcVersions [GHC88, GHC86] "hlint doesn't take in account cpp flag as ghc -D argument" $
99115
testCase "hlint diagnostics works with CPP via ghc -XCPP argument (#554)" $ runHlintSession "cpp" $ do
100116
doc <- openDoc "ApplyRefact3.hs" "haskell"

0 commit comments

Comments
 (0)