Skip to content

Commit bc103f3

Browse files
committed
cleanup
1 parent 2a7a72b commit bc103f3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ data InProgressState (a :: ProgressStateTrackingType) where
157157
newInProgress :: IO (InProgressState 'ProgressStateInsideTracking)
158158
newInProgress = InProgressState <$> newTVarIO 0 <*> newTVarIO 0 <*> STM.newIO
159159

160-
recordProgress :: InProgressState a -> NormalizedFilePath -> (Int -> Int) -> IO ()
161-
recordProgress InProgressStateOutSide {} _ _ = return ()
160+
recordProgress :: InProgressState 'ProgressStateInsideTracking -> NormalizedFilePath -> (Int -> Int) -> IO ()
162161
recordProgress InProgressState {..} file shift = do
163162
(prev, new) <- atomicallyNamed "recordProgress" $ STM.focus alterPrevAndNew file currentVar
164163
atomicallyNamed "recordProgress2" $ do
@@ -214,16 +213,13 @@ progressReporting' _newState Nothing _title _optProgressStyle = noProgressReport
214213
progressReporting' newState (Just lspEnv) title optProgressStyle = do
215214
inProgressState <- newState
216215
progressState <- newVar NotStarted
217-
let
218-
progressUpdate :: ProgressEvent -> m ()
216+
let progressUpdate :: ProgressEvent -> m ()
219217
progressUpdate event = liftIO $ updateStateVar $ Event event
220218
progressStop = updateStateVar StopProgress
221219
updateStateVar = modifyVar_ progressState . updateState (lspShakeProgressNew inProgressState)
222-
inProgress :: NormalizedFilePath -> m b -> m b
223-
inProgress = updateStateForFile inProgressState
224220
case inProgressState of
225221
InProgressStateOutSide {} -> return $ ProgressReportingOutSide progressUpdate progressStop
226-
InProgressState {} -> return $ ProgressReportingInSide progressUpdate inProgress progressStop
222+
InProgressState {} -> return $ ProgressReportingInSide progressUpdate (updateStateForFile inProgressState) progressStop
227223
where
228224
lspShakeProgressNew :: InProgressState a -> IO ()
229225
lspShakeProgressNew InProgressStateOutSide {..} = progressCounter lspEnv title optProgressStyle todo done

0 commit comments

Comments
 (0)