Skip to content

[ghcide-bench] fix edit experiment #2104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2021
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
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