Skip to content
Merged
Changes from all commits
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
11 changes: 10 additions & 1 deletion ghcide/bench/lib/Experiments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ experiments =
bench "edit" $ \docs -> do
forM_ docs $ \DocumentPositions{..} ->
changeDoc doc [charEdit stringLiteralP]
waitForProgressDone -- TODO check that this waits for all of them
-- wait for a fresh build start
waitForProgressStart
-- wait for the build to be finished
waitForProgressDone
return True,
---------------------------------------------------------------------------------------
bench "hover after edit" $ \docs -> do
Expand Down Expand Up @@ -390,6 +393,12 @@ data BenchRun = BenchRun
badRun :: BenchRun
badRun = BenchRun 0 0 0 0 0 False

waitForProgressStart :: Session ()
waitForProgressStart = void $ do
skipManyTill anyMessage $ satisfy $ \case
FromServerMess SWindowWorkDoneProgressCreate _ -> True
_ -> False

-- | Wait for all progress to be done
-- Needs at least one progress done notification to return
waitForProgressDone :: Session ()
Expand Down