Skip to content

Commit d70acdb

Browse files
committed
wait using Barrier
1 parent 75cb0b9 commit d70acdb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,9 @@ indexHieFile se mod_summary srcPath !hash hf = do
942942
Nothing -> pure Nothing
943943
Just env -> LSP.runLspT env $ do
944944
u <- LSP.ProgressToken . LSP.InR . T.pack . show . hashUnique <$> liftIO Unique.newUnique
945-
-- TODO: Wait for the progress create response to use the token
946-
_ <- LSP.sendRequest LSP.SMethod_WindowWorkDoneProgressCreate (LSP.WorkDoneProgressCreateParams u) (const $ pure ())
945+
b <- liftIO newBarrier
946+
void $ LSP.sendRequest LSP.SMethod_WindowWorkDoneProgressCreate (LSP.WorkDoneProgressCreateParams u) $ liftIO . signalBarrier b
947+
ready <- liftIO $ waitBarrier b
947948
LSP.sendNotification LSP.SMethod_Progress $ LSP.ProgressParams u $
948949
toJSON $ LSP.WorkDoneProgressBegin
949950
{ _kind = LSP.AString @"begin"

0 commit comments

Comments
 (0)