Skip to content

[Migrate diagnosticTests] part of #4173 Migrate ghcide tests to hls test utils #4207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
361131e
migrate diagnosticTests
soulomoon May 4, 2024
fa0e4de
Merge branch 'master' into soulomoon/update-ghcide-tests-hls-test-uti…
soulomoon May 9, 2024
ef077d2
add test no kick to hls-test-utils
soulomoon May 9, 2024
cc7d3cb
clean up ghcide config
soulomoon May 9, 2024
b887243
use fs
soulomoon May 9, 2024
158caa9
reduce write file
soulomoon May 9, 2024
56195f5
fix up
soulomoon May 10, 2024
b8c6ca9
fix ide log
soulomoon May 10, 2024
46b5f04
fix
soulomoon May 10, 2024
1554f87
Update ghcide/src/Development/IDE/Main.hs
soulomoon May 10, 2024
4388ac0
Update ghcide/test/exe/DiagnosticTests.hs
soulomoon May 10, 2024
f6a7f48
Update hls-test-utils/src/Test/Hls.hs
soulomoon May 10, 2024
aee5c53
Update plugins/hls-refactor-plugin/test/Main.hs
soulomoon May 10, 2024
8aa41f3
Update plugins/hls-refactor-plugin/test/Main.hs
soulomoon May 10, 2024
7d22fb7
Update ghcide/test/exe/DiagnosticTests.hs
soulomoon May 10, 2024
cfd3f53
update recorder
soulomoon May 10, 2024
d40c643
fix
soulomoon May 10, 2024
a03aa22
cleanup
soulomoon May 10, 2024
e2a50f2
Merge branch 'master' into soulomoon/update-ghcide-tests-hls-test-uti…
soulomoon May 10, 2024
5ffbf2f
Merge branch 'master' into soulomoon/update-ghcide-tests-hls-test-uti…
soulomoon May 10, 2024
c8aa5ca
fix
soulomoon May 11, 2024
1f7f49f
Merge branch 'master' into soulomoon/update-ghcide-tests-hls-test-uti…
soulomoon May 12, 2024
d08228d
nitpick
soulomoon May 12, 2024
354854e
Update hls-test-utils/src/Test/Hls.hs
soulomoon May 12, 2024
726a88d
add variable
soulomoon May 12, 2024
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
1 change: 1 addition & 0 deletions ghcide/test/exe/ClientSettingsTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Language.LSP.Protocol.Types hiding
SemanticTokensEdit (..),
mkRange)
import Language.LSP.Test
import Test.Hls (waitForProgressDone)
import Test.Tasty
import TestUtils

Expand Down
1 change: 1 addition & 0 deletions ghcide/test/exe/CodeLensTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Language.LSP.Protocol.Types hiding
SemanticTokensEdit (..),
mkRange)
import Language.LSP.Test
import Test.Hls (waitForProgressDone)
import Test.Tasty
import Test.Tasty.HUnit
import TestUtils
Expand Down
15 changes: 15 additions & 0 deletions ghcide/test/exe/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

module Config where

import Control.Lens.Setter ((.~))
import Data.Foldable (traverse_)
import Data.Function ((&))
import qualified Data.Text as T
import Development.IDE.Test (canonicalizeUri)
import Ide.Types (defaultPluginDescriptor)
import qualified Language.LSP.Protocol.Lens as L
import Language.LSP.Protocol.Types (Null (..))
import System.FilePath ((</>))
import Test.Hls
Expand All @@ -31,9 +34,15 @@ runWithDummyPlugin' = runSessionWithServerInTmpDirCont' def dummyPlugin
runWithDummyPluginAndCap :: ClientCapabilities -> Session () -> IO ()
runWithDummyPluginAndCap cap = runSessionWithServerAndCapsInTmpDir def dummyPlugin cap (mkIdeTestFs [])

runWithDummyPluginAndCap' :: ClientCapabilities -> (FileSystem -> Session ()) -> IO ()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I'm not sure all these functions are necessarily worth it. How bad would it be to just have the FileSystem -> Session () variants and then write _ -> whatever at the use sites?

Copy link
Collaborator Author

@soulomoon soulomoon May 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm, we are at somewhat funny situation, that the one without the extra FileSystem are the most used.
Sure, for not frequent used ones, it would be fine we write _ -> whatever.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm wondering how bad it would be. Otherwise we have a lot of very similar variant functions 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, anyway

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I mean since we have a lot of test that does not need the FileSystem ,
adding a tons of _ -> whatever is visually bad and and not convenient for us to do the migration.

That is why I want to either do the typeclass polymorphic or just duplicate the test runner function variant.

runWithDummyPluginAndCap' cap = runSessionWithServerAndCapsInTmpDirCont def dummyPlugin cap (mkIdeTestFs [])

testWithDummyPluginAndCap :: String -> ClientCapabilities -> Session () -> TestTree
testWithDummyPluginAndCap caseName cap = testCase caseName . runWithDummyPluginAndCap cap

testWithDummyPluginAndCap' :: String -> ClientCapabilities -> (FileSystem -> Session ()) -> TestTree
testWithDummyPluginAndCap' caseName cap = testCase caseName . runWithDummyPluginAndCap' cap

-- testSessionWithCorePlugin ::(TestRunner cont ()) => TestName -> FS.VirtualFileTree -> cont -> TestTree
testWithDummyPlugin :: String -> FS.VirtualFileTree -> Session () -> TestTree
testWithDummyPlugin caseName vfs = testCase caseName . runWithDummyPlugin vfs
Expand Down Expand Up @@ -114,3 +123,9 @@ defToLocation (InL (Definition (InL l))) = [l]
defToLocation (InL (Definition (InR ls))) = ls
defToLocation (InR (InL defLink)) = (\(DefinitionLink LocationLink{_targetUri,_targetRange}) -> Location _targetUri _targetRange) <$> defLink
defToLocation (InR (InR Null)) = []

lspTestCaps :: ClientCapabilities
lspTestCaps = fullCaps { _window = Just $ WindowClientCapabilities (Just True) Nothing Nothing }

lspTestCapsNoFileWatches :: ClientCapabilities
lspTestCapsNoFileWatches = lspTestCaps & L.workspace . traverse . L.didChangeWatchedFiles .~ Nothing
84 changes: 43 additions & 41 deletions ghcide/test/exe/DiagnosticTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@ import System.Directory
import System.FilePath
import System.IO.Extra hiding (withTempDir)

import Config
import Control.Lens ((^.))
import Control.Monad.Extra (whenJust)
import Development.IDE.Plugin.Test (WaitForIdeRuleResult (..))
import System.Time.Extra
import Test.Hls (waitForProgressBegin,
waitForTypecheck)
import Test.Hls.FileSystem (toAbsFp)
import Test.Tasty
import Test.Tasty.HUnit
import TestUtils

tests :: TestTree
tests = testGroup "diagnostics"
[ testSessionWait "fix syntax error" $ do
[ testWithDummyPluginEmpty "fix syntax error" $ do
let content = T.unlines [ "module Testing wher" ]
doc <- createDoc "Testing.hs" "haskell" content
expectDiagnostics [("Testing.hs", [(DiagnosticSeverity_Error, (0, 15), "parse error")])]
Expand All @@ -51,7 +54,7 @@ tests = testGroup "diagnostics"
}
changeDoc doc [change]
expectDiagnostics [("Testing.hs", [])]
, testSessionWait "introduce syntax error" $ do
, testWithDummyPluginEmpty "introduce syntax error" $ do
let content = T.unlines [ "module Testing where" ]
doc <- createDoc "Testing.hs" "haskell" content
void $ skipManyTill anyMessage (message SMethod_WindowWorkDoneProgressCreate)
Expand All @@ -63,7 +66,7 @@ tests = testGroup "diagnostics"
}
changeDoc doc [change]
expectDiagnostics [("Testing.hs", [(DiagnosticSeverity_Error, (0, 15), "parse error")])]
, testSessionWait "update syntax error" $ do
, testWithDummyPluginEmpty "update syntax error" $ do
let content = T.unlines [ "module Testing(missing) where" ]
doc <- createDoc "Testing.hs" "haskell" content
expectDiagnostics [("Testing.hs", [(DiagnosticSeverity_Error, (0, 15), "Not in scope: 'missing'")])]
Expand All @@ -74,7 +77,7 @@ tests = testGroup "diagnostics"
}
changeDoc doc [change]
expectDiagnostics [("Testing.hs", [(DiagnosticSeverity_Error, (0, 15), "Not in scope: 'lissing'")])]
, testSessionWait "variable not in scope" $ do
, testWithDummyPluginEmpty "variable not in scope" $ do
let content = T.unlines
[ "module Testing where"
, "foo :: Int -> Int -> Int"
Expand All @@ -90,7 +93,7 @@ tests = testGroup "diagnostics"
]
)
]
, testSessionWait "type error" $ do
, testWithDummyPluginEmpty "type error" $ do
let content = T.unlines
[ "module Testing where"
, "foo :: Int -> String -> Int"
Expand All @@ -102,7 +105,7 @@ tests = testGroup "diagnostics"
, [(DiagnosticSeverity_Error, (2, 14), "Couldn't match type '[Char]' with 'Int'")]
)
]
, testSessionWait "typed hole" $ do
, testWithDummyPluginEmpty "typed hole" $ do
let content = T.unlines
[ "module Testing where"
, "foo :: Int -> String"
Expand All @@ -129,7 +132,7 @@ tests = testGroup "diagnostics"
expectedDs aMessage =
[ ("A.hs", [(DiagnosticSeverity_Error, (2,4), aMessage)])
, ("B.hs", [(DiagnosticSeverity_Error, (3,4), bMessage)])]
deferralTest title binding msg = testSessionWait title $ do
deferralTest title binding msg = testWithDummyPluginEmpty title $ do
_ <- createDoc "A.hs" "haskell" $ sourceA binding
_ <- createDoc "B.hs" "haskell" sourceB
expectDiagnostics $ expectedDs msg
Expand All @@ -139,7 +142,7 @@ tests = testGroup "diagnostics"
, deferralTest "out of scope var" "unbound" "Variable not in scope"
]

, testSessionWait "remove required module" $ do
, testWithDummyPluginEmpty "remove required module" $ do
let contentA = T.unlines [ "module ModuleA where" ]
docA <- createDoc "ModuleA.hs" "haskell" contentA
let contentB = T.unlines
Expand All @@ -154,7 +157,7 @@ tests = testGroup "diagnostics"
}
changeDoc docA [change]
expectDiagnostics [("ModuleB.hs", [(DiagnosticSeverity_Error, (1, 0), "Could not find module")])]
, testSessionWait "add missing module" $ do
, testWithDummyPluginEmpty "add missing module" $ do
let contentB = T.unlines
[ "module ModuleB where"
, "import ModuleA ()"
Expand All @@ -164,22 +167,21 @@ tests = testGroup "diagnostics"
let contentA = T.unlines [ "module ModuleA where" ]
_ <- createDoc "ModuleA.hs" "haskell" contentA
expectDiagnostics [("ModuleB.hs", [])]
, testCase "add missing module (non workspace)" $
, testWithDummyPluginAndCap' "add missing module (non workspace)" lspTestCapsNoFileWatches $ \tmpDir -> do
-- By default lsp-test sends FileWatched notifications for all files, which we don't want
-- as non workspace modules will not be watched by the LSP server.
-- To work around this, we tell lsp-test that our client doesn't have the
-- FileWatched capability, which is enough to disable the notifications
withTempDir $ \tmpDir -> runInDir'' lspTestCapsNoFileWatches tmpDir "." "." [] $ do
let contentB = T.unlines
[ "module ModuleB where"
, "import ModuleA ()"
]
_ <- createDoc (tmpDir </> "ModuleB.hs") "haskell" contentB
expectDiagnostics [(tmpDir </> "ModuleB.hs", [(DiagnosticSeverity_Error, (1, 7), "Could not find module")])]
_ <- createDoc (tmpDir `toAbsFp` "ModuleB.hs") "haskell" contentB
expectDiagnostics [(tmpDir `toAbsFp` "ModuleB.hs", [(DiagnosticSeverity_Error, (1, 7), "Could not find module")])]
let contentA = T.unlines [ "module ModuleA where" ]
_ <- createDoc (tmpDir </> "ModuleA.hs") "haskell" contentA
expectDiagnostics [(tmpDir </> "ModuleB.hs", [])]
, testSessionWait "cyclic module dependency" $ do
_ <- createDoc (tmpDir `toAbsFp` "ModuleA.hs") "haskell" contentA
expectDiagnostics [(tmpDir `toAbsFp` "ModuleB.hs", [])]
, testWithDummyPluginEmpty "cyclic module dependency" $ do
let contentA = T.unlines
[ "module ModuleA where"
, "import ModuleB"
Expand All @@ -198,7 +200,7 @@ tests = testGroup "diagnostics"
, [(DiagnosticSeverity_Error, (1, 7), "Cyclic module dependency between ModuleA, ModuleB")]
)
]
, testSession' "deeply nested cyclic module dependency" $ \path -> do
, testWithDummyPluginEmpty' "deeply nested cyclic module dependency" $ \path -> do
let contentA = unlines
[ "module ModuleA where" , "import ModuleB" ]
let contentB = unlines
Expand All @@ -209,17 +211,17 @@ tests = testGroup "diagnostics"
[ "module ModuleD where" , "import ModuleC" ]
cradle =
"cradle: {direct: {arguments: [ModuleA, ModuleB, ModuleC, ModuleD]}}"
liftIO $ writeFile (path </> "ModuleA.hs") contentA
liftIO $ writeFile (path </> "ModuleB.hs") contentB
liftIO $ writeFile (path </> "ModuleC.hs") contentC
liftIO $ writeFile (path </> "hie.yaml") cradle
liftIO $ writeFile (path `toAbsFp` "ModuleA.hs") contentA
liftIO $ writeFile (path `toAbsFp` "ModuleB.hs") contentB
liftIO $ writeFile (path `toAbsFp` "ModuleC.hs") contentC
liftIO $ writeFile (path `toAbsFp` "hie.yaml") cradle
_ <- createDoc "ModuleD.hs" "haskell" contentD
expectDiagnostics
[ ( "ModuleB.hs"
, [(DiagnosticSeverity_Error, (1, 7), "Cyclic module dependency between ModuleA, ModuleB")]
)
]
, testSessionWait "cyclic module dependency with hs-boot" $ do
, testWithDummyPluginEmpty "cyclic module dependency with hs-boot" $ do
let contentA = T.unlines
[ "module ModuleA where"
, "import {-# SOURCE #-} ModuleB"
Expand All @@ -238,7 +240,7 @@ tests = testGroup "diagnostics"
_ <- createDoc "ModuleB.hs" "haskell" contentB
_ <- createDoc "ModuleB.hs-boot" "haskell" contentBboot
expectDiagnostics [("ModuleB.hs", [(DiagnosticSeverity_Warning, (3,0), "Top-level binding")])]
, testSession' "bidirectional module dependency with hs-boot" $ \path -> do
, testWithDummyPluginEmpty' "bidirectional module dependency with hs-boot" $ \path -> do
let cradle = unlines
[ "cradle:"
, " direct: {arguments: [ModuleA, ModuleB]}"
Expand All @@ -260,13 +262,13 @@ tests = testGroup "diagnostics"
let contentAboot = T.unlines
[ "module ModuleA where"
]
liftIO $ writeFile (path </> "hie.yaml") cradle
liftIO $ writeFile (path `toAbsFp` "hie.yaml") cradle
_ <- createDoc "ModuleA.hs" "haskell" contentA
_ <- createDoc "ModuleA.hs-boot" "haskell" contentAboot
_ <- createDoc "ModuleB.hs" "haskell" contentB
_ <- createDoc "ModuleB.hs-boot" "haskell" contentBboot
expectDiagnostics [("ModuleB.hs", [(DiagnosticSeverity_Warning, (3,0), "Top-level binding")])]
, testSessionWait "correct reference used with hs-boot" $ do
, testWithDummyPluginEmpty "correct reference used with hs-boot" $ do
let contentB = T.unlines
[ "module ModuleB where"
, "import {-# SOURCE #-} ModuleA()"
Expand All @@ -292,7 +294,7 @@ tests = testGroup "diagnostics"
_ <- createDoc "ModuleA.hs-boot" "haskell" contentAboot
_ <- createDoc "ModuleC.hs" "haskell" contentC
expectDiagnostics [("ModuleC.hs", [(DiagnosticSeverity_Warning, (3,0), "Top-level binding")])]
, testSessionWait "redundant import" $ do
, testWithDummyPluginEmpty "redundant import" $ do
let contentA = T.unlines ["module ModuleA where"]
let contentB = T.unlines
[ "{-# OPTIONS_GHC -Wunused-imports #-}"
Expand All @@ -306,7 +308,7 @@ tests = testGroup "diagnostics"
, [(DiagnosticSeverity_Warning, (2, 0), "The import of 'ModuleA' is redundant", Just DiagnosticTag_Unnecessary)]
)
]
, testSessionWait "redundant import even without warning" $ do
, testWithDummyPluginEmpty "redundant import even without warning" $ do
let contentA = T.unlines ["module ModuleA where"]
let contentB = T.unlines
[ "{-# OPTIONS_GHC -Wno-unused-imports -Wmissing-signatures #-}"
Expand All @@ -318,7 +320,7 @@ tests = testGroup "diagnostics"
_ <- createDoc "ModuleA.hs" "haskell" contentA
_ <- createDoc "ModuleB.hs" "haskell" contentB
expectDiagnostics [("ModuleB.hs", [(DiagnosticSeverity_Warning, (3,0), "Top-level binding")])]
, testSessionWait "package imports" $ do
, testWithDummyPluginEmpty "package imports" $ do
let thisDataListContent = T.unlines
[ "module Data.List where"
, "x :: Integer"
Expand Down Expand Up @@ -356,7 +358,7 @@ tests = testGroup "diagnostics"
]
)
]
, testSessionWait "unqualified warnings" $ do
, testWithDummyPluginEmpty "unqualified warnings" $ do
let fooContent = T.unlines
[ "{-# OPTIONS_GHC -Wredundant-constraints #-}"
, "module Foo where"
Expand All @@ -374,7 +376,7 @@ tests = testGroup "diagnostics"
]
)
]
, testSessionWait "lower-case drive" $ do
, testWithDummyPluginEmpty "lower-case drive" $ do
let aContent = T.unlines
[ "module A.A where"
, "import A.B ()"
Expand Down Expand Up @@ -407,7 +409,7 @@ tests = testGroup "diagnostics"
liftIO $ unless ("redundant" `T.isInfixOf` msg) $
assertFailure ("Expected redundant import but got " <> T.unpack msg)
closeDoc a
, testSessionWait "strip file path" $ do
, testWithDummyPluginEmpty "strip file path" $ do
let
name = "Testing"
content = T.unlines
Expand All @@ -426,8 +428,8 @@ tests = testGroup "diagnostics"
Lens.filtered (T.isInfixOf ("/" <> name <> ".hs:"))
failure msg = liftIO $ assertFailure $ "Expected file path to be stripped but got " <> T.unpack msg
Lens.mapMOf_ offenders failure notification
, testSession' "-Werror in cradle is ignored" $ \sessionDir -> do
liftIO $ writeFile (sessionDir </> "hie.yaml")
, testWithDummyPluginEmpty' "-Werror in cradle is ignored" $ \sessionDir -> do
liftIO $ writeFile (sessionDir `toAbsFp` "hie.yaml")
"cradle: {direct: {arguments: [\"-Wall\", \"-Werror\"]}}"
let fooContent = T.unlines
[ "module Foo where"
Expand All @@ -440,7 +442,7 @@ tests = testGroup "diagnostics"
]
)
]
, testSessionWait "-Werror in pragma is ignored" $ do
, testWithDummyPluginEmpty "-Werror in pragma is ignored" $ do
let fooContent = T.unlines
[ "{-# OPTIONS_GHC -Wall -Werror #-}"
, "module Foo() where"
Expand All @@ -455,9 +457,9 @@ tests = testGroup "diagnostics"
)
]
, testCase "typecheck-all-parents-of-interest" $ runWithExtraFiles "recomp" $ \dir -> do
let bPath = dir </> "B.hs"
pPath = dir </> "P.hs"
aPath = dir </> "A.hs"
let bPath = dir `toAbsFp` "B.hs"
pPath = dir `toAbsFp` "P.hs"
aPath = dir `toAbsFp` "A.hs"

bSource <- liftIO $ readFileUtf8 bPath -- y :: Int
pSource <- liftIO $ readFileUtf8 pPath -- bar = x :: Int
Expand Down Expand Up @@ -490,7 +492,7 @@ tests = testGroup "diagnostics"
]
expectNoMoreDiagnostics 1

, testSessionWait "deduplicate missing module diagnostics" $ do
, testWithDummyPluginEmpty "deduplicate missing module diagnostics" $ do
let fooContent = T.unlines [ "module Foo() where" , "import MissingModule" ]
doc <- createDoc "Foo.hs" "haskell" fooContent
expectDiagnostics [("Foo.hs", [(DiagnosticSeverity_Error, (1,7), "Could not find module 'MissingModule'")])]
Expand Down Expand Up @@ -552,7 +554,7 @@ cancellationTestGroup name edits sessionDepsOutcome parseOutcome tcOutcome = tes
]

cancellationTemplate :: (TextDocumentContentChangeEvent, TextDocumentContentChangeEvent) -> Maybe (String, Bool) -> TestTree
cancellationTemplate (edit, undoEdit) mbKey = testCase (maybe "-" fst mbKey) $ runTestNoKick $ do
cancellationTemplate (edit, undoEdit) mbKey = testWithDummyPluginEmpty (maybe "-" fst mbKey) $ do
doc <- createDoc "Foo.hs" "haskell" $ T.unlines
[ "{-# OPTIONS_GHC -Wall #-}"
, "module Foo where"
Expand All @@ -578,7 +580,7 @@ cancellationTemplate (edit, undoEdit) mbKey = testCase (maybe "-" fst mbKey) $ r
expectNoMoreDiagnostics 0.5
where
-- similar to run except it disables kick
runTestNoKick s = withTempDir $ \dir -> runInDir' dir "." "." ["--test-no-kick"] s
-- runTestNoKick s = runWithDummyPluginEmpty dir "." "." ["--test-no-kick"] s

typeCheck doc = do
WaitForIdeRuleResult {..} <- waitForAction "TypeCheck" doc
Expand Down
1 change: 1 addition & 0 deletions ghcide/test/exe/ExceptionTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import Language.LSP.Protocol.Types hiding
mkRange)
import Language.LSP.Test
import LogType (Log (..))
import Test.Hls (waitForProgressDone)
import Test.Tasty
import Test.Tasty.HUnit
import TestUtils
Expand Down
6 changes: 4 additions & 2 deletions ghcide/test/exe/OpenCloseTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import Control.Monad
import Language.LSP.Protocol.Message
import Language.LSP.Test
-- import Test.QuickCheck.Instances ()
import Config (testWithDummyPluginEmpty)
import Test.Hls (waitForProgressBegin,
waitForProgressDone)
import Test.Tasty
import TestUtils

tests :: TestTree
tests = testSession "open close" $ do
tests = testWithDummyPluginEmpty "open close" $ do
doc <- createDoc "Testing.hs" "haskell" ""
void (skipManyTill anyMessage $ message SMethod_WindowWorkDoneProgressCreate)
waitForProgressBegin
Expand Down
2 changes: 2 additions & 0 deletions ghcide/test/exe/THTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import Language.LSP.Protocol.Types hiding (SemanticTokenAbsolute (..),
SemanticTokensEdit (..), mkRange)
import Language.LSP.Test
import System.FilePath
import Test.Hls (waitForAllProgressDone,
waitForProgressBegin)
import Test.Tasty
import Test.Tasty.HUnit
import TestUtils
Expand Down
Loading
Loading