Skip to content

Commit

Permalink
fix progress
Browse files Browse the repository at this point in the history
  • Loading branch information
wz1000 committed Jan 17, 2021
1 parent 4c044b4 commit d623623
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ghcide/src/Development/IDE/Core/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,11 @@ indexHieFile se mod_summary srcPath hash hf = atomically $ do
mdone <- atomically $ do
-- Remove current element from pending
modifyTVar' indexPending $ HashMap.update (\pendingHash -> guard (pendingHash /= hash) $> pendingHash) srcPath
modifyTVar' indexCompleted (+1)
pending <- readTVar indexPending
if HashMap.null pending
then Just <$> swapTVar indexCompleted 0
else do
modifyTVar' indexCompleted (+1)
pure Nothing
-- If we are done, report and reset completed
whenMaybe (HashMap.null pending) $
swapTVar indexCompleted 0
when (coerce $ ideTesting se) $
eventer se $ LSP.NotCustomServer $
LSP.NotificationMessage "2.0" (LSP.CustomServerMethod "ghcide/reference/ready") (toJSON $ fromNormalizedFilePath srcPath)
Expand Down

0 comments on commit d623623

Please sign in to comment.