@@ -64,7 +64,7 @@ hlintTests = testGroup "hlint suggestions" [
6464
6565 executeCodeAction (fromJust redId)
6666
67- contents <- getDocumentEdit doc
67+ contents <- skipManyTill anyMessage $ getDocumentEdit doc
6868 liftIO $ contents @?= " main = undefined\n foo x = x\n "
6969
7070 , testCase " falls back to pre 3.8 code actions" $ runSession hlsCommand noLiteralCaps " test/testdata/hlint" $ do
@@ -77,7 +77,7 @@ hlintTests = testGroup "hlint suggestions" [
7777
7878 executeCommand etaReduce
7979
80- contents <- skipManyTill publishDiagnosticsNotification $ getDocumentEdit doc
80+ contents <- skipManyTill anyMessage $ getDocumentEdit doc
8181 liftIO $ contents @?= " main = undefined\n foo = id\n "
8282
8383 , testCase " changing configuration enables or disables hlint diagnostics" $ runSession hlsCommand fullCaps " test/testdata/hlint" $ do
@@ -214,7 +214,7 @@ packageTests = testGroup "add package suggestions" [
214214
215215 executeCodeAction action
216216
217- contents <- getDocumentEdit . TextDocumentIdentifier =<< getDocUri " add-package-test.cabal"
217+ contents <- skipManyTill anyMessage $ getDocumentEdit . TextDocumentIdentifier =<< getDocUri " add-package-test.cabal"
218218 liftIO $
219219 any (\ l -> " text -any" `T.isSuffixOf` l || " text : {} -any" `T.isSuffixOf` l) (T. lines contents) @? " Contains text package"
220220
@@ -243,7 +243,7 @@ packageTests = testGroup "add package suggestions" [
243243
244244 executeCodeAction action
245245
246- contents <- getDocumentEdit . TextDocumentIdentifier =<< getDocUri " package.yaml"
246+ contents <- skipManyTill anyMessage $ getDocumentEdit . TextDocumentIdentifier =<< getDocUri " package.yaml"
247247 liftIO $ do
248248 " zlib" `T.isSuffixOf` (T. lines contents !! 3 ) @? " Contains zlib"
249249 " zlib" `T.isSuffixOf` (T. lines contents !! 21 ) @? " Does not contain zlib in unrelated component"
@@ -415,7 +415,7 @@ unusedTermTests = testGroup "unused term code actions" [
415415 --
416416 -- executeCodeAction $ head cas
417417 --
418- -- edit <- getDocumentEdit doc
418+ -- edit <- skipManyTill anyMessage $ getDocumentEdit doc
419419 --
420420 -- let expected = [ "{-# OPTIONS_GHC -Wall #-}"
421421 -- , "module UnusedTerm () where"
0 commit comments