Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Only show progress messages if the computation takes > 0.1s #392

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Changes from 1 commit
Commits
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
3 changes: 3 additions & 0 deletions src/Development/IDE/Core/Shake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ shakeOpen getLspId eventer logger shakeProfileDir (IdeReportProgress reportProgr

lspShakeProgress :: IO LSP.LspId -> (LSP.FromServerMessage -> IO ()) -> IO Progress -> IO ()
lspShakeProgress getLspId sendMsg prog = do
-- first sleep a bit, so we only show progress messages if it's going to take
-- a "noticable amount of time"
sleep 0.1
lspId <- getLspId
u <- ProgressTextToken . T.pack . show . hashUnique <$> newUnique
sendMsg $ LSP.ReqWorkDoneProgressCreate $ LSP.fmServerWorkDoneProgressCreateRequest
Expand Down