Skip to content

Commit

Permalink
no debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
soulomoon committed May 7, 2024
1 parent ebfb375 commit 5d77f61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ghcide/src/Development/IDE/Core/Shake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,9 @@ runWithShake f = do
runShakeLoop :: ShakeOpQueue -> IO ()
runShakeLoop q = do
argHead <- atomically $ readTQueue q
sleep 0.1
args <- atomically $ flushTQueue q
case NE.nonEmpty (argHead:args) of
-- sleep 0.1
-- args <- atomically $ flushTQueue q
case NE.nonEmpty (argHead:[]) of
Nothing -> return ()
Just xs -> do
let count = length xs
Expand Down
8 changes: 7 additions & 1 deletion ghcide/test/exe/DiagnosticTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Development.IDE.Test (diagnostic,
expectDiagnosticsWithTags,
expectNoMoreDiagnostics,
flushMessages, waitForAction,
waitForBuildQueue,
waitForTypecheck)
import Development.IDE.Types.Location
import qualified Language.LSP.Protocol.Lens as L
Expand All @@ -35,6 +36,8 @@ import Control.Lens ((^.))
import Control.Monad.Extra (whenJust)
import Development.IDE.Plugin.Test (WaitForIdeRuleResult (..))
import System.Time.Extra
import Test.Hls (waitForKickDone,
waitForKickStart)
import Test.Tasty
import Test.Tasty.HUnit
import TestUtils
Expand Down Expand Up @@ -268,6 +271,9 @@ tests = testGroup "diagnostics"
_ <- createDoc "ModuleA.hs-boot" "haskell" contentAboot
_ <- createDoc "ModuleB.hs" "haskell" contentB
_ <- createDoc "ModuleB.hs-boot" "haskell" contentBboot
-- waitForKickStart
-- waitForKickDone
liftIO $ sleep 1
expectDiagnostics [("ModuleB.hs", [(DiagnosticSeverity_Warning, (3,0), "Top-level binding")])]
, testSessionWait "correct reference used with hs-boot" $ do
let contentB = T.unlines
Expand Down Expand Up @@ -482,7 +488,7 @@ tests = testGroup "diagnostics"
adoc <- createDoc aPath "haskell" aSource
changeDoc adoc [TextDocumentContentChangeEvent . InR . TextDocumentContentChangeWholeDocument $
T.unlines ["module A where", "import B", "x :: Bool", "x = y"]]

waitForBuildQueue
expectDiagnostics
[ ( "P.hs",
[ (DiagnosticSeverity_Error, (4, 6), "Couldn't match expected type 'Int' with actual type 'Bool'"),
Expand Down

0 comments on commit 5d77f61

Please sign in to comment.