Skip to content

Commit 3d60ddc

Browse files
authored
Only show progress messages if the computation takes > 0.1s (#392)
1 parent f06cae0 commit 3d60ddc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Development/IDE/Core/Shake.hs

+3
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ shakeOpen getLspId eventer logger shakeProfileDir (IdeReportProgress reportProgr
325325

326326
lspShakeProgress :: Show a => IO LSP.LspId -> (LSP.FromServerMessage -> IO ()) -> Var (Map a Int) -> IO ()
327327
lspShakeProgress getLspId sendMsg inProgress = do
328+
-- first sleep a bit, so we only show progress messages if it's going to take
329+
-- a "noticable amount of time" (we often expect a thread kill to arrive before the sleep finishes)
330+
sleep 0.1
328331
lspId <- getLspId
329332
u <- ProgressTextToken . T.pack . show . hashUnique <$> newUnique
330333
sendMsg $ LSP.ReqWorkDoneProgressCreate $ LSP.fmServerWorkDoneProgressCreateRequest

0 commit comments

Comments
 (0)