on master help sign in
Use lsp-test-0.11 (#566)

Replace openDoc' with createDoc which sends out workspace/didChangedWatchedFiles notifications

commitcd6f62bbedee39791c567ab7b1f01f33ace2edb0 authorLuke Lau <luke_lau@icloud.com> dateSun 17 May 2020, 15:37 (6 years ago) parenta2e091c
7 files changed+106−121
ghcide.cabal+1−1 stack.yaml+1−1 stack810.yaml+1−1 stack84.yaml+1−1 stack88.yaml+1−1 test/exe/Main.hs+100−115 test/src/Development/IDE/Test.hs+1−1
ghcide.cabal+1−1
@@ -263,7 +263,7 @@ test-suite ghcide-tests
263263 haskell-lsp-types,
264264 network-uri,
265265 lens,
266− lsp-test >= 0.8,
266+ lsp-test >= 0.11.0.1 && < 0.12,
267267 parser-combinators,
268268 QuickCheck,
269269 quickcheck-instances,
stack.yaml+1−1
@@ -4,7 +4,7 @@ packages:
44extra-deps:
55- haskell-lsp-0.22.0.0
66- haskell-lsp-types-0.22.0.0
7−- lsp-test-0.10.3.0
7+- lsp-test-0.11.0.1
88- hie-bios-0.4.0
99- fuzzy-0.1.0.0
1010- regex-pcre-builtin-0.95.1.1.8.43
stack810.yaml+1−1
@@ -6,7 +6,7 @@ packages:
66extra-deps:
77- haskell-lsp-0.22.0.0
88- haskell-lsp-types-0.22.0.0
9−- lsp-test-0.10.3.0
9+- lsp-test-0.11.0.1
1010- ghc-check-0.3.0.1
1111
1212# for ghc-8.10
stack84.yaml+1−1
@@ -7,7 +7,7 @@ extra-deps:
77- base-orphans-0.8.2
88- haskell-lsp-0.22.0.0
99- haskell-lsp-types-0.22.0.0
10−- lsp-test-0.10.3.0
10+- lsp-test-0.11.0.1
1111- rope-utf16-splay-0.3.1.0
1212- filepattern-0.1.1
1313- js-dgtable-0.5.2
stack88.yaml+1−1
@@ -4,7 +4,7 @@ packages:
44extra-deps:
55- haskell-lsp-0.22.0.0
66- haskell-lsp-types-0.22.0.0
7−- lsp-test-0.10.3.0
7+- lsp-test-0.11.0.1
88- ghc-check-0.3.0.1
99
1010nix:
test/exe/Main.hs+100−115
@@ -28,8 +28,7 @@ import Development.IDE.Test
2828import Development.IDE.Test.Runfiles
2929import Development.IDE.Types.Location
3030import Development.Shake (getDirectoryFilesIO)
31−import qualified Language.Haskell.LSP.Test as LSPTest
32−import Language.Haskell.LSP.Test hiding (openDoc')
31+import Language.Haskell.LSP.Test
3332import Language.Haskell.LSP.Messages
3433import Language.Haskell.LSP.Types
3534import Language.Haskell.LSP.Types.Capabilities
@@ -52,7 +51,7 @@ import Data.Maybe
5251main :: IO ()
5352main = defaultMainWithRerun $ testGroup "HIE"
5453 [ testSession "open close" $ do
55− doc <- openDoc' "Testing.hs" "haskell" ""
54+ doc <- createDoc "Testing.hs" "haskell" ""
5655 void (skipManyTill anyMessage message :: Session WorkDoneProgressCreateRequest)
5756 void (skipManyTill anyMessage message :: Session WorkDoneProgressBeginNotification)
5857 closeDoc doc
@@ -149,7 +148,7 @@ diagnosticTests :: TestTree
149148diagnosticTests = testGroup "diagnostics"
150149 [ testSessionWait "fix syntax error" $ do
151150 let content = T.unlines [ "module Testing wher" ]
152− doc <- openDoc' "Testing.hs" "haskell" content
151+ doc <- createDoc "Testing.hs" "haskell" content
153152 expectDiagnostics [("Testing.hs", [(DsError, (0, 15), "parse error")])]
154153 let change = TextDocumentContentChangeEvent
155154 { _range = Just (Range (Position 0 15) (Position 0 19))
@@ -160,7 +159,7 @@ diagnosticTests = testGroup "diagnostics"
160159 expectDiagnostics [("Testing.hs", [])]
161160 , testSessionWait "introduce syntax error" $ do
162161 let content = T.unlines [ "module Testing where" ]
163− doc <- openDoc' "Testing.hs" "haskell" content
162+ doc <- createDoc "Testing.hs" "haskell" content
164163 void $ skipManyTill anyMessage (message :: Session WorkDoneProgressCreateRequest)
165164 void $ skipManyTill anyMessage (message :: Session WorkDoneProgressBeginNotification)
166165 let change = TextDocumentContentChangeEvent
@@ -178,7 +177,7 @@ diagnosticTests = testGroup "diagnostics"
178177 , "bar :: Int -> Int -> Int"
179178 , "bar a b = cd + b"
180179 ]
181− _ <- openDoc' "Testing.hs" "haskell" content
180+ _ <- createDoc "Testing.hs" "haskell" content
182181 expectDiagnostics
183182 [ ( "Testing.hs"
184183 , [ (DsError, (2, 14), "Variable not in scope: ab")
@@ -192,7 +191,7 @@ diagnosticTests = testGroup "diagnostics"
192191 , "foo :: Int -> String -> Int"
193192 , "foo a b = a + b"
194193 ]
195− _ <- openDoc' "Testing.hs" "haskell" content
194+ _ <- createDoc "Testing.hs" "haskell" content
196195 expectDiagnostics
197196 [ ( "Testing.hs"
198197 , [(DsError, (2, 14), "Couldn't match type '[Char]' with 'Int'")]
@@ -204,7 +203,7 @@ diagnosticTests = testGroup "diagnostics"
204203 , "foo :: Int -> String"
205204 , "foo a = _ a"
206205 ]
207− _ <- openDoc' "Testing.hs" "haskell" content
206+ _ <- createDoc "Testing.hs" "haskell" content
208207 expectDiagnostics
209208 [ ( "Testing.hs"
210209 , [(DsError, (2, 8), "Found hole: _ :: Int -> String")]
@@ -226,8 +225,8 @@ diagnosticTests = testGroup "diagnostics"
226225 [ ("A.hs", [(DsError, (2,4), aMessage)])
227226 , ("B.hs", [(DsError, (3,4), bMessage)])]
228227 deferralTest title binding msg = testSessionWait title $ do
229− _ <- openDoc' "A.hs" "haskell" $ sourceA binding
230− _ <- openDoc' "B.hs" "haskell" sourceB
228+ _ <- createDoc "A.hs" "haskell" $ sourceA binding
229+ _ <- createDoc "B.hs" "haskell" sourceB
231230 expectDiagnostics $ expectedDs msg
232231 in
233232 [ deferralTest "type error" "True" "Couldn't match expected type"
@@ -237,12 +236,12 @@ diagnosticTests = testGroup "diagnostics"
237236
238237 , testSessionWait "remove required module" $ do
239238 let contentA = T.unlines [ "module ModuleA where" ]
240− docA <- openDoc' "ModuleA.hs" "haskell" contentA
239+ docA <- createDoc "ModuleA.hs" "haskell" contentA
241240 let contentB = T.unlines
242241 [ "module ModuleB where"
243242 , "import ModuleA"
244243 ]
245− _ <- openDoc' "ModuleB.hs" "haskell" contentB
244+ _ <- createDoc "ModuleB.hs" "haskell" contentB
246245 let change = TextDocumentContentChangeEvent
247246 { _range = Just (Range (Position 0 0) (Position 0 20))
248247 , _rangeLength = Nothing
@@ -255,20 +254,20 @@ diagnosticTests = testGroup "diagnostics"
255254 [ "module ModuleB where"
256255 , "import ModuleA"
257256 ]
258− _ <- openDoc' "ModuleB.hs" "haskell" contentB
257+ _ <- createDoc "ModuleB.hs" "haskell" contentB
259258 expectDiagnostics [("ModuleB.hs", [(DsError, (1, 7), "Could not find module")])]
260259 let contentA = T.unlines [ "module ModuleA where" ]
261− _ <- openDoc' "ModuleA.hs" "haskell" contentA
260+ _ <- createDoc "ModuleA.hs" "haskell" contentA
262261 expectDiagnostics [("ModuleB.hs", [])]
263262 , testSessionWait "add missing module (non workspace)" $ do
264263 let contentB = T.unlines
265264 [ "module ModuleB where"
266265 , "import ModuleA"
267266 ]
268− _ <- openDoc'' "/tmp/ModuleB.hs" "haskell" contentB
267+ _ <- createDoc "/tmp/ModuleB.hs" "haskell" contentB
269268 expectDiagnostics [("/tmp/ModuleB.hs", [(DsError, (1, 7), "Could not find module")])]
270269 let contentA = T.unlines [ "module ModuleA where" ]
271− _ <- openDoc'' "/tmp/ModuleA.hs" "haskell" contentA
270+ _ <- createDoc "/tmp/ModuleA.hs" "haskell" contentA
272271 expectDiagnostics [("/tmp/ModuleB.hs", [])]
273272 , testSessionWait "cyclic module dependency" $ do
274273 let contentA = T.unlines
@@ -279,8 +278,8 @@ diagnosticTests = testGroup "diagnostics"
279278 [ "module ModuleB where"
280279 , "import ModuleA"
281280 ]
282− _ <- openDoc' "ModuleA.hs" "haskell" contentA
283− _ <- openDoc' "ModuleB.hs" "haskell" contentB
281+ _ <- createDoc "ModuleA.hs" "haskell" contentA
282+ _ <- createDoc "ModuleB.hs" "haskell" contentB
284283 expectDiagnostics
285284 [ ( "ModuleA.hs"
286285 , [(DsError, (1, 7), "Cyclic module dependency between ModuleA, ModuleB")]
@@ -301,9 +300,9 @@ diagnosticTests = testGroup "diagnostics"
301300 let contentBboot = T.unlines
302301 [ "module ModuleB where"
303302 ]
304− _ <- openDoc' "ModuleA.hs" "haskell" contentA
305− _ <- openDoc' "ModuleB.hs" "haskell" contentB
306− _ <- openDoc' "ModuleB.hs-boot" "haskell" contentBboot
303+ _ <- createDoc "ModuleA.hs" "haskell" contentA
304+ _ <- createDoc "ModuleB.hs" "haskell" contentB
305+ _ <- createDoc "ModuleB.hs-boot" "haskell" contentBboot
307306 expectDiagnostics []
308307 , testSessionWait "correct reference used with hs-boot" $ do
309308 let contentB = T.unlines
@@ -325,10 +324,10 @@ diagnosticTests = testGroup "diagnostics"
325324 -- resolved to the hs-boot file
326325 , "y = x"
327326 ]
328− _ <- openDoc' "ModuleB.hs" "haskell" contentB
329− _ <- openDoc' "ModuleA.hs" "haskell" contentA
330− _ <- openDoc' "ModuleA.hs-boot" "haskell" contentAboot
331− _ <- openDoc' "ModuleC.hs" "haskell" contentC
327+ _ <- createDoc "ModuleB.hs" "haskell" contentB
328+ _ <- createDoc "ModuleA.hs" "haskell" contentA
329+ _ <- createDoc "ModuleA.hs-boot" "haskell" contentAboot
330+ _ <- createDoc "ModuleC.hs" "haskell" contentC
332331 expectDiagnostics []
333332 , testSessionWait "redundant import" $ do
334333 let contentA = T.unlines ["module ModuleA where"]
@@ -337,8 +336,8 @@ diagnosticTests = testGroup "diagnostics"
337336 , "module ModuleB where"
338337 , "import ModuleA"
339338 ]
340− _ <- openDoc' "ModuleA.hs" "haskell" contentA
341− _ <- openDoc' "ModuleB.hs" "haskell" contentB
339+ _ <- createDoc "ModuleA.hs" "haskell" contentA
340+ _ <- createDoc "ModuleB.hs" "haskell" contentB
342341 expectDiagnostics
343342 [ ( "ModuleB.hs"
344343 , [(DsWarning, (2, 0), "The import of 'ModuleA' is redundant")]
@@ -360,8 +359,8 @@ diagnosticTests = testGroup "diagnostics"
360359 , "wrong1 = ThisList.map"
361360 , "wrong2 = BaseList.x"
362361 ]
363− _ <- openDoc' "Data/List.hs" "haskell" thisDataListContent
364− _ <- openDoc' "Main.hs" "haskell" mainContent
362+ _ <- createDoc "Data/List.hs" "haskell" thisDataListContent
363+ _ <- createDoc "Main.hs" "haskell" mainContent
365364 expectDiagnostics
366365 [ ( "Main.hs"
367366 , [(DsError, (6, 9), "Not in scope: \8216ThisList.map\8217")
@@ -376,7 +375,7 @@ diagnosticTests = testGroup "diagnostics"
376375 , "foo :: Ord a => a -> Int"
377376 , "foo a = 1"
378377 ]
379− _ <- openDoc' "Foo.hs" "haskell" fooContent
378+ _ <- createDoc "Foo.hs" "haskell" fooContent
380379 expectDiagnostics
381380 [ ( "Foo.hs"
382381 -- The test is to make sure that warnings contain unqualified names
@@ -427,7 +426,7 @@ diagnosticTests = testGroup "diagnostics"
427426 , "foo :: Int"
428427 , "foo = 1 {-|-}"
429428 ]
430− _ <- openDoc' "Foo.hs" "haskell" fooContent
429+ _ <- createDoc "Foo.hs" "haskell" fooContent
431430 expectDiagnostics
432431 [ ( "Foo.hs"
433432 , [(DsError, (2, 8), "Parse error on input")
@@ -442,7 +441,7 @@ diagnosticTests = testGroup "diagnostics"
442441 , "value :: Maybe ()"
443442 , "value = [()]"
444443 ]
445− _ <- openDoc' (T.unpack name <> ".hs") "haskell" content
444+ _ <- createDoc (T.unpack name <> ".hs") "haskell" content
446445 notification <- skipManyTill anyMessage diagnostic
447446 let
448447 offenders =
@@ -479,7 +478,7 @@ watchedFilesTests :: TestTree
479478watchedFilesTests = testGroup "watched files"
480479 [ testSession' "workspace files" $ \sessionDir -> do
481480 liftIO $ writeFile (sessionDir </> "hie.yaml") "cradle: {direct: {arguments: [\"-isrc\"]}}"
482− _doc <- openDoc' "A.hs" "haskell" "{-#LANGUAGE NoImplicitPrelude #-}\nmodule A where\nimport WatchedFilesMissingModule"
481+ _doc <- createDoc "A.hs" "haskell" "{-#LANGUAGE NoImplicitPrelude #-}\nmodule A where\nimport WatchedFilesMissingModule"
483482 watchedFileRegs <- getWatchedFilesSubscriptionsUntil @PublishDiagnosticsNotification
484483
485484 -- Expect 6 subscriptions (A does not get any because it's VFS):
@@ -493,7 +492,7 @@ watchedFilesTests = testGroup "watched files"
493492
494493 , testSession' "non workspace file" $ \sessionDir -> do
495494 liftIO $ writeFile (sessionDir </> "hie.yaml") "cradle: {direct: {arguments: [\"-i/tmp\"]}}"
496− _doc <- openDoc' "A.hs" "haskell" "{-# LANGUAGE NoImplicitPrelude#-}\nmodule A where\nimport WatchedFilesMissingModule"
495+ _doc <- createDoc "A.hs" "haskell" "{-# LANGUAGE NoImplicitPrelude#-}\nmodule A where\nimport WatchedFilesMissingModule"
497496 watchedFileRegs <- getWatchedFilesSubscriptionsUntil @PublishDiagnosticsNotification
498497
499498 -- Expect 4 subscriptions (/tmp does not get any as it is out of the workspace):
@@ -514,7 +513,7 @@ renameActionTests = testGroup "rename actions"
514513 , "foo :: Int -> Int"
515514 , "foo argName = argNme"
516515 ]
517− doc <- openDoc' "Testing.hs" "haskell" content
516+ doc <- createDoc "Testing.hs" "haskell" content
518517 _ <- waitForDiagnostics
519518 action <- findCodeAction doc (Range (Position 2 14) (Position 2 20)) "Replace with ‘argName’"
520519 executeCodeAction action
@@ -532,7 +531,7 @@ renameActionTests = testGroup "rename actions"
532531 , "foo :: Maybe a -> [a]"
533532 , "foo = maybToList"
534533 ]
535− doc <- openDoc' "Testing.hs" "haskell" content
534+ doc <- createDoc "Testing.hs" "haskell" content
536535 _ <- waitForDiagnostics
537536 action <- findCodeAction doc (Range (Position 3 6) (Position 3 16)) "Replace with ‘maybeToList’"
538537 executeCodeAction action
@@ -550,7 +549,7 @@ renameActionTests = testGroup "rename actions"
550549 , "foo :: Char -> Char -> Char -> Char"
551550 , "foo argument1 argument2 argument3 = argumentX"
552551 ]
553− doc <- openDoc' "Testing.hs" "haskell" content
552+ doc <- createDoc "Testing.hs" "haskell" content
554553 _ <- waitForDiagnostics
555554 _ <- findCodeActions doc (Range (Position 2 36) (Position 2 45))
556555 ["Replace with ‘argument1’", "Replace with ‘argument2’", "Replace with ‘argument3’"]
@@ -562,7 +561,7 @@ renameActionTests = testGroup "rename actions"
562561 , "monus x y = max 0 (x - y)"
563562 , "foo x y = x `monnus` y"
564563 ]
565− doc <- openDoc' "Testing.hs" "haskell" content
564+ doc <- createDoc "Testing.hs" "haskell" content
566565 _ <- waitForDiagnostics
567566 actionsOrCommands <- getCodeActions doc (Range (Position 3 12) (Position 3 20))
568567 [fixTypo] <- pure [action | CACodeAction action@CodeAction{ _title = actionTitle } <- actionsOrCommands, "monus" `T.isInfixOf` actionTitle ]
@@ -585,7 +584,7 @@ typeWildCardActionTests = testGroup "type wildcard actions"
585584 , "func :: _"
586585 , "func x = x"
587586 ]
588− doc <- openDoc' "Testing.hs" "haskell" content
587+ doc <- createDoc "Testing.hs" "haskell" content
589588 _ <- waitForDiagnostics
590589 actionsOrCommands <- getCodeActions doc (Range (Position 2 1) (Position 2 10))
591590 let [addSignature] = [action | CACodeAction action@CodeAction { _title = actionTitle } <- actionsOrCommands
@@ -605,7 +604,7 @@ typeWildCardActionTests = testGroup "type wildcard actions"
605604 , "func :: _"
606605 , "func x y = x + y"
607606 ]
608− doc <- openDoc' "Testing.hs" "haskell" content
607+ doc <- createDoc "Testing.hs" "haskell" content
609608 _ <- waitForDiagnostics
610609 actionsOrCommands <- getCodeActions doc (Range (Position 2 1) (Position 2 10))
611610 let [addSignature] = [action | CACodeAction action@CodeAction { _title = actionTitle } <- actionsOrCommands
@@ -628,7 +627,7 @@ typeWildCardActionTests = testGroup "type wildcard actions"
628627 , " y = x * 2"
629628 , " in y"
630629 ]
631− doc <- openDoc' "Testing.hs" "haskell" content
630+ doc <- createDoc "Testing.hs" "haskell" content
632631 _ <- waitForDiagnostics
633632 actionsOrCommands <- getCodeActions doc (Range (Position 4 1) (Position 4 10))
634633 let [addSignature] = [action | CACodeAction action@CodeAction { _title = actionTitle } <- actionsOrCommands
@@ -653,7 +652,7 @@ removeImportTests = testGroup "remove import actions"
653652 let contentA = T.unlines
654653 [ "module ModuleA where"
655654 ]
656− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
655+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
657656 let contentB = T.unlines
658657 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
659658 , "module ModuleB where"
@@ -661,7 +660,7 @@ removeImportTests = testGroup "remove import actions"
661660 , "stuffB :: Integer"
662661 , "stuffB = 123"
663662 ]
664− docB <- openDoc' "ModuleB.hs" "haskell" contentB
663+ docB <- createDoc "ModuleB.hs" "haskell" contentB
665664 _ <- waitForDiagnostics
666665 [CACodeAction action@CodeAction { _title = actionTitle }]
667666 <- getCodeActions docB (Range (Position 2 0) (Position 2 5))
@@ -679,7 +678,7 @@ removeImportTests = testGroup "remove import actions"
679678 let contentA = T.unlines
680679 [ "module ModuleA where"
681680 ]
682− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
681+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
683682 let contentB = T.unlines
684683 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
685684 , "module ModuleB where"
@@ -687,7 +686,7 @@ removeImportTests = testGroup "remove import actions"
687686 , "stuffB :: Integer"
688687 , "stuffB = 123"
689688 ]
690− docB <- openDoc' "ModuleB.hs" "haskell" contentB
689+ docB <- createDoc "ModuleB.hs" "haskell" contentB
691690 _ <- waitForDiagnostics
692691 [CACodeAction action@CodeAction { _title = actionTitle }]
693692 <- getCodeActions docB (Range (Position 2 0) (Position 2 5))
@@ -709,14 +708,14 @@ removeImportTests = testGroup "remove import actions"
709708 , "stuffB = 123"
710709 , "stuffC = ()"
711710 ]
712− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
711+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
713712 let contentB = T.unlines
714713 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
715714 , "module ModuleB where"
716715 , "import ModuleA (stuffA, stuffB, stuffC, stuffA)"
717716 , "main = print stuffB"
718717 ]
719− docB <- openDoc' "ModuleB.hs" "haskell" contentB
718+ docB <- createDoc "ModuleB.hs" "haskell" contentB
720719 _ <- waitForDiagnostics
721720 [CACodeAction action@CodeAction { _title = actionTitle }]
722721 <- getCodeActions docB (Range (Position 2 0) (Position 2 5))
@@ -738,14 +737,14 @@ removeImportTests = testGroup "remove import actions"
738737 , "stuffB :: Integer"
739738 , "stuffB = 123"
740739 ]
741− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
740+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
742741 let contentB = T.unlines
743742 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
744743 , "module ModuleB where"
745744 , "import qualified ModuleA as A ((<?>), stuffB, (!!))"
746745 , "main = print A.stuffB"
747746 ]
748− docB <- openDoc' "ModuleB.hs" "haskell" contentB
747+ docB <- createDoc "ModuleB.hs" "haskell" contentB
749748 _ <- waitForDiagnostics
750749 [CACodeAction action@CodeAction { _title = actionTitle }]
751750 <- getCodeActions docB (Range (Position 2 0) (Position 2 5))
@@ -766,14 +765,14 @@ removeImportTests = testGroup "remove import actions"
766765 , "stuffB :: Integer"
767766 , "stuffB = 123"
768767 ]
769− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
768+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
770769 let contentB = T.unlines
771770 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
772771 , "module ModuleB where"
773772 , "import ModuleA (A(..), stuffB)"
774773 , "main = print stuffB"
775774 ]
776− docB <- openDoc' "ModuleB.hs" "haskell" contentB
775+ docB <- createDoc "ModuleB.hs" "haskell" contentB
777776 _ <- waitForDiagnostics
778777 [CACodeAction action@CodeAction { _title = actionTitle }]
779778 <- getCodeActions docB (Range (Position 2 0) (Position 2 5))
@@ -793,14 +792,14 @@ removeImportTests = testGroup "remove import actions"
793792 , "data D = A | B"
794793 , "data E = F"
795794 ]
796− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
795+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
797796 let contentB = T.unlines
798797 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
799798 , "module ModuleB where"
800799 , "import ModuleA (D(A,B), E(F))"
801800 , "main = B"
802801 ]
803− docB <- openDoc' "ModuleB.hs" "haskell" contentB
802+ docB <- createDoc "ModuleB.hs" "haskell" contentB
804803 _ <- waitForDiagnostics
805804 [CACodeAction action@CodeAction { _title = actionTitle }]
806805 <- getCodeActions docB (Range (Position 2 0) (Position 2 5))
@@ -941,8 +940,8 @@ extendImportTests = testGroup "extend import actions"
941940 ]
942941 where
943942 template contentA contentB range expectedAction expectedContentB = do
944− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
945− docB <- openDoc' "ModuleB.hs" "haskell" contentB
943+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
944+ docB <- createDoc "ModuleB.hs" "haskell" contentB
946945 _ <- waitForDiagnostics
947946 CACodeAction action@CodeAction { _title = actionTitle } : _
948947 <- sortOn (\(CACodeAction CodeAction{_title=x}) -> x) <$>
@@ -992,7 +991,7 @@ suggestImportTests = testGroup "suggest import actions"
992991 after = T.unlines $ "module A where" : ["import " <> x | x <- imps] ++ [newImp] ++ def : other
993992 cradle = "cradle: {direct: {arguments: [-hide-all-packages, -package, base, -package, text, -package-env, -]}}"
994993 liftIO $ writeFileUTF8 (dir </> "hie.yaml") cradle
995− doc <- openDoc' "Test.hs" "haskell" before
994+ doc <- createDoc "Test.hs" "haskell" before
996995 _diags <- waitForDiagnostics
997996 let defLine = length imps + 1
998997 range = Range (Position defLine 0) (Position defLine maxBound)
@@ -1052,7 +1051,7 @@ addExtensionTests = testGroup "add language extension actions"
10521051 ]
10531052 where
10541053 template initialContent range expectedAction expectedContents = do
1055− doc <- openDoc' "Module.hs" "haskell" initialContent
1054+ doc <- createDoc "Module.hs" "haskell" initialContent
10561055 _ <- waitForDiagnostics
10571056 CACodeAction action@CodeAction { _title = actionTitle } : _
10581057 <- sortOn (\(CACodeAction CodeAction{_title=x}) -> x) <$>
@@ -1075,7 +1074,7 @@ insertNewDefinitionTests = testGroup "insert new definition actions"
10751074 [""
10761075 ,"someOtherCode = ()"
10771076 ]
1078− docB <- openDoc' "ModuleB.hs" "haskell" (T.unlines $ txtB ++ txtB')
1077+ docB <- createDoc "ModuleB.hs" "haskell" (T.unlines $ txtB ++ txtB')
10791078 _ <- waitForDiagnostics
10801079 CACodeAction action@CodeAction { _title = actionTitle } : _
10811080 <- sortOn (\(CACodeAction CodeAction{_title=x}) -> x) <$>
@@ -1099,7 +1098,7 @@ insertNewDefinitionTests = testGroup "insert new definition actions"
10991098 [""
11001099 ,"someOtherCode = ()"
11011100 ]
1102− docB <- openDoc' "ModuleB.hs" "haskell" (T.unlines $ txtB ++ txtB')
1101+ docB <- createDoc "ModuleB.hs" "haskell" (T.unlines $ txtB ++ txtB')
11031102 _ <- waitForDiagnostics
11041103 CACodeAction action@CodeAction { _title = actionTitle } : _
11051104 <- sortOn (\(CACodeAction CodeAction{_title=x}) -> x) <$>
@@ -1138,8 +1137,8 @@ fixConstructorImportTests = testGroup "fix import actions"
11381137 ]
11391138 where
11401139 template contentA contentB range expectedAction expectedContentB = do
1141− _docA <- openDoc' "ModuleA.hs" "haskell" contentA
1142− docB <- openDoc' "ModuleB.hs" "haskell" contentB
1140+ _docA <- createDoc "ModuleA.hs" "haskell" contentA
1141+ docB <- createDoc "ModuleB.hs" "haskell" contentB
11431142 _diags <- waitForDiagnostics
11441143 CACodeAction action@CodeAction { _title = actionTitle } : _
11451144 <- sortOn (\(CACodeAction CodeAction{_title=x}) -> x) <$>
@@ -1158,7 +1157,7 @@ importRenameActionTests = testGroup "import rename actions"
11581157 [ "module Testing where"
11591158 , "import Data.Mape"
11601159 ]
1161− doc <- openDoc' "Testing.hs" "haskell" content
1160+ doc <- createDoc "Testing.hs" "haskell" content
11621161 _ <- waitForDiagnostics
11631162 actionsOrCommands <- getCodeActions doc (Range (Position 2 8) (Position 2 16))
11641163 let [changeToMap] = [action | CACodeAction action@CodeAction{ _title = actionTitle } <- actionsOrCommands, ("Data." <> modname) `T.isInfixOf` actionTitle ]
@@ -1195,7 +1194,7 @@ fillTypedHoleTests = let
11951194 newA newB newC = testSession (T.unpack actionTitle) $ do
11961195 let originalCode = sourceCode oldA oldB oldC
11971196 let expectedCode = sourceCode newA newB newC
1198− doc <- openDoc' "Testing.hs" "haskell" originalCode
1197+ doc <- createDoc "Testing.hs" "haskell" originalCode
11991198 _ <- waitForDiagnostics
12001199 actionsOrCommands <- getCodeActions doc (Range (Position 9 0) (Position 9 maxBound))
12011200 chosenAction <- liftIO $ pickActionWithTitle actionTitle actionsOrCommands
@@ -1243,7 +1242,7 @@ addSigActionTests = let
12431242 def >:: sig = testSession (T.unpack def) $ do
12441243 let originalCode = before def
12451244 let expectedCode = after' def sig
1246− doc <- openDoc' "Sigs.hs" "haskell" originalCode
1245+ doc <- createDoc "Sigs.hs" "haskell" originalCode
12471246 _ <- waitForDiagnostics
12481247 actionsOrCommands <- getCodeActions doc (Range (Position 3 1) (Position 3 maxBound))
12491248 chosenAction <- liftIO $ pickActionWithTitle ("add signature: " <> sig) actionsOrCommands
@@ -1275,7 +1274,7 @@ addSigLensesTests = let
12751274 sigSession withMissing def sig = testSession (T.unpack def) $ do
12761275 let originalCode = before withMissing def
12771276 let expectedCode = after' withMissing def sig
1278− doc <- openDoc' "Sigs.hs" "haskell" originalCode
1277+ doc <- createDoc "Sigs.hs" "haskell" originalCode
12791278 [CodeLens {_command = Just c}] <- getCodeLenses doc
12801279 executeCommand c
12811280 modifiedCode <- getDocumentEdit doc
@@ -1480,7 +1479,7 @@ pluginTests = (`xfail8101` "known broken (#556)")
14801479 , "foo :: Int -> Int -> Int"
14811480 , "foo a b = a + c"
14821481 ]
1483− _ <- openDoc' "Testing.hs" "haskell" content
1482+ _ <- createDoc "Testing.hs" "haskell" content
14841483 expectDiagnostics
14851484 [ ( "Testing.hs",
14861485 [(DsError, (8, 14), "Variable not in scope: c")]
@@ -1507,7 +1506,7 @@ cppTests =
15071506 run $ expectError content (2, 1)
15081507 )
15091508 , testSessionWait "cpp-ghcide" $ do
1510− _ <- openDoc' "A.hs" "haskell" $ T.unlines
1509+ _ <- createDoc "A.hs" "haskell" $ T.unlines
15111510 ["{-# LANGUAGE CPP #-}"
15121511 ,"main ="
15131512 ,"#ifdef __GHCIDE__"
@@ -1521,7 +1520,7 @@ cppTests =
15211520 where
15221521 expectError :: T.Text -> Cursor -> Session ()
15231522 expectError content cursor = do
1524− _ <- openDoc' "Testing.hs" "haskell" content
1523+ _ <- createDoc "Testing.hs" "haskell" content
15251524 expectDiagnostics
15261525 [ ( "Testing.hs",
15271526 [(DsError, cursor, "error: unterminated")]
@@ -1537,7 +1536,7 @@ preprocessorTests = testSessionWait "preprocessor" $ do
15371536 , "module Testing where"
15381537 , "y = x + z" -- plugin replaces x with y, making this have only one diagnostic
15391538 ]
1540− _ <- openDoc' "Testing.hs" "haskell" content
1539+ _ <- createDoc "Testing.hs" "haskell" content
15411540 expectDiagnostics
15421541 [ ( "Testing.hs",
15431542 [(DsError, (2, 8), "Variable not in scope: z")]
@@ -1570,8 +1569,8 @@ safeTests =
15701569 ,"safeId = trustWorthyId"
15711570 ]
15721571
1573− _ <- openDoc' "A.hs" "haskell" sourceA
1574− _ <- openDoc' "B.hs" "haskell" sourceB
1572+ _ <- createDoc "A.hs" "haskell" sourceA
1573+ _ <- createDoc "B.hs" "haskell" sourceB
15751574 expectNoMoreDiagnostics 1 ]
15761575
15771576thTests :: TestTree
@@ -1599,8 +1598,8 @@ thTests =
15991598 "b :: Integer",
16001599 "b = $(litE $ IntegerL $ a) + n"
16011600 ]
1602− _ <- openDoc' "A.hs" "haskell" sourceA
1603− _ <- openDoc' "B.hs" "haskell" sourceB
1601+ _ <- createDoc "A.hs" "haskell" sourceA
1602+ _ <- createDoc "B.hs" "haskell" sourceB
16041603 expectDiagnostics [ ( "B.hs", [(DsError, (6, 29), "Variable not in scope: n")] ) ]
16051604 , testSessionWait "newtype-closure" $ do
16061605 let sourceA =
@@ -1620,8 +1619,8 @@ thTests =
16201619 ,"import A"
16211620 ,"b :: Int"
16221621 ,"b = $( a )" ]
1623− _ <- openDoc' "A.hs" "haskell" sourceA
1624− _ <- openDoc' "B.hs" "haskell" sourceB
1622+ _ <- createDoc "A.hs" "haskell" sourceA
1623+ _ <- createDoc "B.hs" "haskell" sourceB
16251624 return ()
16261625 ]
16271626
@@ -1630,7 +1629,7 @@ completionTests
16301629 = testGroup "completion"
16311630 [ testSessionWait "variable" $ do
16321631 let source = T.unlines ["module A where", "f = hea"]
1633− docId <- openDoc' "A.hs" "haskell" source
1632+ docId <- createDoc "A.hs" "haskell" source
16341633 compls <- getCompletions docId (Position 1 7)
16351634 liftIO $ map dropDocs compls @?=
16361635 [complItem "head" (Just CiFunction) (Just "[a] -> a")]
@@ -1642,7 +1641,7 @@ completionTests
16421641 ]
16431642 , testSessionWait "constructor" $ do
16441643 let source = T.unlines ["module A where", "f = Tru"]
1645− docId <- openDoc' "A.hs" "haskell" source
1644+ docId <- createDoc "A.hs" "haskell" source
16461645 compls <- getCompletions docId (Position 1 7)
16471646 liftIO $ map dropDocs compls @?=
16481647 [ complItem "True" (Just CiConstructor) (Just "Bool")
@@ -1654,7 +1653,7 @@ completionTests
16541653 ]
16551654 , testSessionWait "type" $ do
16561655 let source = T.unlines ["{-# OPTIONS_GHC -Wall #-}", "module A () where", "f :: ()", "f = ()"]
1657− docId <- openDoc' "A.hs" "haskell" source
1656+ docId <- createDoc "A.hs" "haskell" source
16581657 expectDiagnostics [ ("A.hs", [(DsWarning, (3,0), "not used")]) ]
16591658 changeDoc docId [TextDocumentContentChangeEvent Nothing Nothing $ T.unlines ["{-# OPTIONS_GHC -Wall #-}", "module A () where", "f :: Bo", "f = True"]]
16601659 compls <- getCompletions docId (Position 2 7)
@@ -1671,7 +1670,7 @@ completionTests
16711670 checkDocText "Bool" boolDocs [ "Defined in 'Prelude'" ]
16721671 , testSessionWait "qualified" $ do
16731672 let source = T.unlines ["{-# OPTIONS_GHC -Wunused-binds #-}", "module A () where", "f = ()"]
1674− docId <- openDoc' "A.hs" "haskell" source
1673+ docId <- createDoc "A.hs" "haskell" source
16751674 expectDiagnostics [ ("A.hs", [(DsWarning, (2, 0), "not used")]) ]
16761675 changeDoc docId [TextDocumentContentChangeEvent Nothing Nothing $ T.unlines ["{-# OPTIONS_GHC -Wunused-binds #-}", "module A () where", "f = Prelude.hea"]]
16771676 compls <- getCompletions docId (Position 2 15)
@@ -1685,7 +1684,7 @@ completionTests
16851684 ]
16861685 , testSessionWait "keyword" $ do
16871686 let source = T.unlines ["module A where", "f = newty"]
1688− docId <- openDoc' "A.hs" "haskell" source
1687+ docId <- createDoc "A.hs" "haskell" source
16891688 compls <- getCompletions docId (Position 1 9)
16901689 liftIO $ compls @?= [keywordItem "newtype"]
16911690 , testSessionWait "type context" $ do
@@ -1694,7 +1693,7 @@ completionTests
16941693 , "module A () where"
16951694 , "f = f"
16961695 ]
1697− docId <- openDoc' "A.hs" "haskell" source
1696+ docId <- createDoc "A.hs" "haskell" source
16981697 expectDiagnostics [("A.hs", [(DsWarning, (2, 0), "not used")])]
16991698 changeDoc docId
17001699 [ TextDocumentContentChangeEvent Nothing Nothing $ T.unlines
@@ -1762,7 +1761,7 @@ outlineTests = testGroup
17621761 "outline"
17631762 [ testSessionWait "type class" $ do
17641763 let source = T.unlines ["module A where", "class A a where a :: a -> Bool"]
1765− docId <- openDoc' "A.hs" "haskell" source
1764+ docId <- createDoc "A.hs" "haskell" source
17661765 symbols <- getDocumentSymbols docId
17671766 liftIO $ symbols @?= Left
17681767 [ moduleSymbol
@@ -1775,7 +1774,7 @@ outlineTests = testGroup
17751774 ]
17761775 , testSessionWait "type class instance " $ do
17771776 let source = T.unlines ["class A a where", "instance A () where"]
1778− docId <- openDoc' "A.hs" "haskell" source
1777+ docId <- createDoc "A.hs" "haskell" source
17791778 symbols <- getDocumentSymbols docId
17801779 liftIO $ symbols @?= Left
17811780 [ classSymbol "A a" (R 0 0 0 15) []
@@ -1783,7 +1782,7 @@ outlineTests = testGroup
17831782 ]
17841783 , testSessionWait "type family" $ do
17851784 let source = T.unlines ["{-# language TypeFamilies #-}", "type family A"]
1786− docId <- openDoc' "A.hs" "haskell" source
1785+ docId <- createDoc "A.hs" "haskell" source
17871786 symbols <- getDocumentSymbols docId
17881787 liftIO $ symbols @?= Left [docSymbolD "A" "type family" SkClass (R 1 0 1 13)]
17891788 , testSessionWait "type family instance " $ do
@@ -1792,7 +1791,7 @@ outlineTests = testGroup
17921791 , "type family A a"
17931792 , "type instance A () = ()"
17941793 ]
1795− docId <- openDoc' "A.hs" "haskell" source
1794+ docId <- createDoc "A.hs" "haskell" source
17961795 symbols <- getDocumentSymbols docId
17971796 liftIO $ symbols @?= Left
17981797 [ docSymbolD "A a" "type family" SkClass (R 1 0 1 15)
@@ -1800,7 +1799,7 @@ outlineTests = testGroup
18001799 ]
18011800 , testSessionWait "data family" $ do
18021801 let source = T.unlines ["{-# language TypeFamilies #-}", "data family A"]
1803− docId <- openDoc' "A.hs" "haskell" source
1802+ docId <- createDoc "A.hs" "haskell" source
18041803 symbols <- getDocumentSymbols docId
18051804 liftIO $ symbols @?= Left [docSymbolD "A" "data family" SkClass (R 1 0 1 11)]
18061805 , testSessionWait "data family instance " $ do
@@ -1809,7 +1808,7 @@ outlineTests = testGroup
18091808 , "data family A a"
18101809 , "data instance A () = A ()"
18111810 ]
1812− docId <- openDoc' "A.hs" "haskell" source
1811+ docId <- createDoc "A.hs" "haskell" source
18131812 symbols <- getDocumentSymbols docId
18141813 liftIO $ symbols @?= Left
18151814 [ docSymbolD "A a" "data family" SkClass (R 1 0 1 11)
@@ -1817,36 +1816,36 @@ outlineTests = testGroup
18171816 ]
18181817 , testSessionWait "constant" $ do
18191818 let source = T.unlines ["a = ()"]
1820− docId <- openDoc' "A.hs" "haskell" source
1819+ docId <- createDoc "A.hs" "haskell" source
18211820 symbols <- getDocumentSymbols docId
18221821 liftIO $ symbols @?= Left
18231822 [docSymbol "a" SkFunction (R 0 0 0 6)]
18241823 , testSessionWait "pattern" $ do
18251824 let source = T.unlines ["Just foo = Just 21"]
1826− docId <- openDoc' "A.hs" "haskell" source
1825+ docId <- createDoc "A.hs" "haskell" source
18271826 symbols <- getDocumentSymbols docId
18281827 liftIO $ symbols @?= Left
18291828 [docSymbol "Just foo" SkFunction (R 0 0 0 18)]
18301829 , testSessionWait "pattern with type signature" $ do
18311830 let source = T.unlines ["{-# language ScopedTypeVariables #-}", "a :: () = ()"]
1832− docId <- openDoc' "A.hs" "haskell" source
1831+ docId <- createDoc "A.hs" "haskell" source
18331832 symbols <- getDocumentSymbols docId
18341833 liftIO $ symbols @?= Left
18351834 [docSymbol "a :: ()" SkFunction (R 1 0 1 12)]
18361835 , testSessionWait "function" $ do
18371836 let source = T.unlines ["a x = ()"]
1838− docId <- openDoc' "A.hs" "haskell" source
1837+ docId <- createDoc "A.hs" "haskell" source
18391838 symbols <- getDocumentSymbols docId
18401839 liftIO $ symbols @?= Left [docSymbol "a" SkFunction (R 0 0 0 8)]
18411840 , testSessionWait "type synonym" $ do
18421841 let source = T.unlines ["type A = Bool"]
1843− docId <- openDoc' "A.hs" "haskell" source
1842+ docId <- createDoc "A.hs" "haskell" source
18441843 symbols <- getDocumentSymbols docId
18451844 liftIO $ symbols @?= Left
18461845 [docSymbol' "A" SkTypeParameter (R 0 0 0 13) (R 0 5 0 6)]
18471846 , testSessionWait "datatype" $ do
18481847 let source = T.unlines ["data A = C"]
1849− docId <- openDoc' "A.hs" "haskell" source
1848+ docId <- createDoc "A.hs" "haskell" source
18501849 symbols <- getDocumentSymbols docId
18511850 liftIO $ symbols @?= Left
18521851 [ docSymbolWithChildren "A"
@@ -1856,7 +1855,7 @@ outlineTests = testGroup
18561855 ]
18571856 , testSessionWait "import" $ do
18581857 let source = T.unlines ["import Data.Maybe"]
1859− docId <- openDoc' "A.hs" "haskell" source
1858+ docId <- createDoc "A.hs" "haskell" source
18601859 symbols <- getDocumentSymbols docId
18611860 liftIO $ symbols @?= Left
18621861 [docSymbolWithChildren "imports"
@@ -1867,7 +1866,7 @@ outlineTests = testGroup
18671866 ]
18681867 , testSessionWait "multiple import" $ do
18691868 let source = T.unlines ["", "import Data.Maybe", "", "import Control.Exception", ""]
1870− docId <- openDoc' "A.hs" "haskell" source
1869+ docId <- createDoc "A.hs" "haskell" source
18711870 symbols <- getDocumentSymbols docId
18721871 liftIO $ symbols @?= Left
18731872 [docSymbolWithChildren "imports"
@@ -1882,7 +1881,7 @@ outlineTests = testGroup
18821881 [ "{-# language ForeignFunctionInterface #-}"
18831882 , "foreign import ccall \"a\" a :: Int"
18841883 ]
1885− docId <- openDoc' "A.hs" "haskell" source
1884+ docId <- createDoc "A.hs" "haskell" source
18861885 symbols <- getDocumentSymbols docId
18871886 liftIO $ symbols @?= Left [docSymbolD "a" "import" SkObject (R 1 0 1 33)]
18881887 , testSessionWait "foreign export" $ do
@@ -1890,7 +1889,7 @@ outlineTests = testGroup
18901889 [ "{-# language ForeignFunctionInterface #-}"
18911890 , "foreign export ccall odd :: Int -> Bool"
18921891 ]
1893− docId <- openDoc' "A.hs" "haskell" source
1892+ docId <- createDoc "A.hs" "haskell" source
18941893 symbols <- getDocumentSymbols docId
18951894 liftIO $ symbols @?= Left [docSymbolD "odd" "export" SkObject (R 1 0 1 39)]
18961895 ]
@@ -2022,13 +2021,13 @@ loadCradleOnlyonce = testGroup "load cradle only once"
20222021 test dir
20232022 implicit dir = test dir
20242023 test _dir = do
2025− doc <- openDoc' "B.hs" "haskell" "module B where\nimport Data.Foo"
2024+ doc <- createDoc "B.hs" "haskell" "module B where\nimport Data.Foo"
20262025 msgs <- someTill (skipManyTill anyMessage cradleLoadedMessage) (skipManyTill anyMessage (message @PublishDiagnosticsNotification))
20272026 liftIO $ length msgs @?= 1
20282027 changeDoc doc [TextDocumentContentChangeEvent Nothing Nothing "module B where\nimport Data.Maybe"]
20292028 msgs <- manyTill (skipManyTill anyMessage cradleLoadedMessage) (skipManyTill anyMessage (message @PublishDiagnosticsNotification))
20302029 liftIO $ length msgs @?= 0
2031− _ <- openDoc' "A.hs" "haskell" "module A where\nimport LoadCradleBar"
2030+ _ <- createDoc "A.hs" "haskell" "module A where\nimport LoadCradleBar"
20322031 msgs <- manyTill (skipManyTill anyMessage cradleLoadedMessage) (skipManyTill anyMessage (message @PublishDiagnosticsNotification))
20332032 liftIO $ length msgs @?= 0
20342033
@@ -2050,7 +2049,7 @@ sessionDepsArePickedUp = testSession'
20502049 (dir </> "hie.yaml")
20512050 "cradle: {direct: {arguments: []}}"
20522051 -- Open without OverloadedStrings and expect an error.
2053− doc <- openDoc' "Foo.hs" "haskell" fooContent
2052+ doc <- createDoc "Foo.hs" "haskell" fooContent
20542053 expectDiagnostics
20552054 [("Foo.hs", [(DsError, (3, 6), "Couldn't match expected type")])]
20562055 -- Update hie.yaml to enable OverloadedStrings.
@@ -2153,7 +2152,7 @@ runInDir dir s = do
21532152openTestDataDoc :: FilePath -> Session TextDocumentIdentifier
21542153openTestDataDoc path = do
21552154 source <- liftIO $ readFileUtf8 $ "test/data" </> path
2156− openDoc' path "haskell" source
2155+ createDoc path "haskell" source
21572156
21582157findCodeActions :: TextDocumentIdentifier -> Range -> [T.Text] -> Session [CodeAction]
21592158findCodeActions doc range expectedTitles = do
@@ -2194,20 +2193,6 @@ unitTests = do
21942193 uriToFilePath' uri @?= Just ""
21952194 ]
21962195
2197−-- | Wrapper around 'LSPTest.openDoc'' that sends file creation events
2198−openDoc' :: FilePath -> String -> T.Text -> Session TextDocumentIdentifier
2199−openDoc' fp name contents = do
2200− res@(TextDocumentIdentifier uri) <- LSPTest.openDoc' fp name contents
2201− -- Needed as ghcide sets up and relies on WatchedFiles but lsp-test does not track them
2202− sendNotification WorkspaceDidChangeWatchedFiles (DidChangeWatchedFilesParams $ List [FileEvent uri FcCreated])
2203− return res
2204−
2205−-- | Version of 'LSPTest.openDoc'' that does not send WatchedFiles events for files outside the workspace
2206−openDoc'' :: FilePath -> String -> T.Text -> Session TextDocumentIdentifier
2207−-- At the moment this is just LSPTest.openDoc' but it may change in the future
2208−-- when/if lsp-test implements WatchedFiles
2209−openDoc'' = LSPTest.openDoc'
2210−
22112196positionMappingTests :: TestTree
22122197positionMappingTests =
22132198 testGroup "position mapping"
test/src/Development/IDE/Test.hs+1−1
@@ -19,7 +19,7 @@ import Control.Monad.IO.Class
1919import Data.Foldable
2020import qualified Data.Map.Strict as Map
2121import qualified Data.Text as T
22−import Language.Haskell.LSP.Test hiding (message, openDoc')
22+import Language.Haskell.LSP.Test hiding (message)
2323import qualified Language.Haskell.LSP.Test as LspTest
2424import Language.Haskell.LSP.Types
2525import Language.Haskell.LSP.Types.Lens as Lsp