Skip to content

Commit 7c667c8

Browse files
committed
don't wait for progress response
1 parent 0fa05b8 commit 7c667c8

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

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

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -539,22 +539,16 @@ indexHieFile se mod_summary srcPath hash hf = atomically $ do
539539
Nothing -> pure Nothing
540540
Just env -> LSP.runLspT env $ do
541541
u <- LSP.ProgressTextToken . T.pack . show . hashUnique <$> liftIO newUnique
542-
b <- liftIO newBarrier
543-
_ <- LSP.sendRequest LSP.SWindowWorkDoneProgressCreate (LSP.WorkDoneProgressCreateParams u) (liftIO . signalBarrier b)
544-
-- Wait for the progress create response to use the token
545-
resp <- liftIO $ waitBarrier b
546-
case resp of
547-
-- We didn't get a token from the server
548-
Left _err -> pure Nothing
549-
Right _ -> do
550-
LSP.sendNotification LSP.SProgress $ LSP.ProgressParams u $
551-
LSP.Begin $ LSP.WorkDoneProgressBeginParams
552-
{ _title = "Indexing references from:"
553-
, _cancellable = Nothing
554-
, _message = Nothing
555-
, _percentage = Nothing
556-
}
557-
pure (Just u)
542+
-- TODO: Wait for the progress create response to use the token
543+
_ <- LSP.sendRequest LSP.SWindowWorkDoneProgressCreate (LSP.WorkDoneProgressCreateParams u) (const $ pure ())
544+
LSP.sendNotification LSP.SProgress $ LSP.ProgressParams u $
545+
LSP.Begin $ LSP.WorkDoneProgressBeginParams
546+
{ _title = "Indexing references from:"
547+
, _cancellable = Nothing
548+
, _message = Nothing
549+
, _percentage = Nothing
550+
}
551+
pure (Just u)
558552

559553
(!done, !remaining) <- atomically $ do
560554
done <- readTVar indexCompleted

0 commit comments

Comments
 (0)