@@ -17,6 +17,7 @@ import Development.IDE.Test (diagnostic,
17
17
expectDiagnosticsWithTags ,
18
18
expectNoMoreDiagnostics ,
19
19
flushMessages , waitForAction ,
20
+ waitForBuildQueue ,
20
21
waitForTypecheck )
21
22
import Development.IDE.Types.Location
22
23
import qualified Language.LSP.Protocol.Lens as L
@@ -35,6 +36,8 @@ import Control.Lens ((^.))
35
36
import Control.Monad.Extra (whenJust )
36
37
import Development.IDE.Plugin.Test (WaitForIdeRuleResult (.. ))
37
38
import System.Time.Extra
39
+ import Test.Hls (waitForKickDone ,
40
+ waitForKickStart )
38
41
import Test.Tasty
39
42
import Test.Tasty.HUnit
40
43
import TestUtils
@@ -268,6 +271,9 @@ tests = testGroup "diagnostics"
268
271
_ <- createDoc " ModuleA.hs-boot" " haskell" contentAboot
269
272
_ <- createDoc " ModuleB.hs" " haskell" contentB
270
273
_ <- createDoc " ModuleB.hs-boot" " haskell" contentBboot
274
+ -- waitForKickStart
275
+ -- waitForKickDone
276
+ liftIO $ sleep 1
271
277
expectDiagnostics [(" ModuleB.hs" , [(DiagnosticSeverity_Warning , (3 ,0 ), " Top-level binding" )])]
272
278
, testSessionWait " correct reference used with hs-boot" $ do
273
279
let contentB = T. unlines
@@ -482,7 +488,7 @@ tests = testGroup "diagnostics"
482
488
adoc <- createDoc aPath " haskell" aSource
483
489
changeDoc adoc [TextDocumentContentChangeEvent . InR . TextDocumentContentChangeWholeDocument $
484
490
T. unlines [" module A where" , " import B" , " x :: Bool" , " x = y" ]]
485
-
491
+ waitForBuildQueue
486
492
expectDiagnostics
487
493
[ ( " P.hs" ,
488
494
[ (DiagnosticSeverity_Error , (4 , 6 ), " Couldn't match expected type 'Int' with actual type 'Bool'" ),
0 commit comments