Skip to content

Commit 5d77f61

Browse files
committed
no debounce
1 parent ebfb375 commit 5d77f61

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,9 @@ runWithShake f = do
799799
runShakeLoop :: ShakeOpQueue -> IO ()
800800
runShakeLoop q = do
801801
argHead <- atomically $ readTQueue q
802-
sleep 0.1
803-
args <- atomically $ flushTQueue q
804-
case NE.nonEmpty (argHead:args) of
802+
-- sleep 0.1
803+
-- args <- atomically $ flushTQueue q
804+
case NE.nonEmpty (argHead:[]) of
805805
Nothing -> return ()
806806
Just xs -> do
807807
let count = length xs

ghcide/test/exe/DiagnosticTests.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Development.IDE.Test (diagnostic,
1717
expectDiagnosticsWithTags,
1818
expectNoMoreDiagnostics,
1919
flushMessages, waitForAction,
20+
waitForBuildQueue,
2021
waitForTypecheck)
2122
import Development.IDE.Types.Location
2223
import qualified Language.LSP.Protocol.Lens as L
@@ -35,6 +36,8 @@ import Control.Lens ((^.))
3536
import Control.Monad.Extra (whenJust)
3637
import Development.IDE.Plugin.Test (WaitForIdeRuleResult (..))
3738
import System.Time.Extra
39+
import Test.Hls (waitForKickDone,
40+
waitForKickStart)
3841
import Test.Tasty
3942
import Test.Tasty.HUnit
4043
import TestUtils
@@ -268,6 +271,9 @@ tests = testGroup "diagnostics"
268271
_ <- createDoc "ModuleA.hs-boot" "haskell" contentAboot
269272
_ <- createDoc "ModuleB.hs" "haskell" contentB
270273
_ <- createDoc "ModuleB.hs-boot" "haskell" contentBboot
274+
-- waitForKickStart
275+
-- waitForKickDone
276+
liftIO $ sleep 1
271277
expectDiagnostics [("ModuleB.hs", [(DiagnosticSeverity_Warning, (3,0), "Top-level binding")])]
272278
, testSessionWait "correct reference used with hs-boot" $ do
273279
let contentB = T.unlines
@@ -482,7 +488,7 @@ tests = testGroup "diagnostics"
482488
adoc <- createDoc aPath "haskell" aSource
483489
changeDoc adoc [TextDocumentContentChangeEvent . InR . TextDocumentContentChangeWholeDocument $
484490
T.unlines ["module A where", "import B", "x :: Bool", "x = y"]]
485-
491+
waitForBuildQueue
486492
expectDiagnostics
487493
[ ( "P.hs",
488494
[ (DiagnosticSeverity_Error, (4, 6), "Couldn't match expected type 'Int' with actual type 'Bool'"),

0 commit comments

Comments
 (0)