Skip to content

Commit d623623

Browse files
committed
fix progress
1 parent 4c044b4 commit d623623

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,11 @@ indexHieFile se mod_summary srcPath hash hf = atomically $ do
573573
mdone <- atomically $ do
574574
-- Remove current element from pending
575575
modifyTVar' indexPending $ HashMap.update (\pendingHash -> guard (pendingHash /= hash) $> pendingHash) srcPath
576+
modifyTVar' indexCompleted (+1)
576577
pending <- readTVar indexPending
577-
if HashMap.null pending
578-
then Just <$> swapTVar indexCompleted 0
579-
else do
580-
modifyTVar' indexCompleted (+1)
581-
pure Nothing
578+
-- If we are done, report and reset completed
579+
whenMaybe (HashMap.null pending) $
580+
swapTVar indexCompleted 0
582581
when (coerce $ ideTesting se) $
583582
eventer se $ LSP.NotCustomServer $
584583
LSP.NotificationMessage "2.0" (LSP.CustomServerMethod "ghcide/reference/ready") (toJSON $ fromNormalizedFilePath srcPath)

0 commit comments

Comments
 (0)