@@ -1100,15 +1100,16 @@ updateFileDiagnostics fp k ShakeExtras{logger, diagnostics, hiddenDiagnostics, p
1100
1100
let uri = filePathToUri' fp
1101
1101
let delay = if null newDiags then 0.1 else 0
1102
1102
registerEvent debouncer delay uri $ do
1103
- mask_ $ modifyVar_ publishedDiagnostics $ \ published -> do
1103
+ join $ mask_ $ modifyVar publishedDiagnostics $ \ published -> do
1104
1104
let lastPublish = HMap. lookupDefault [] uri published
1105
- when (lastPublish /= newDiags) $ case lspEnv of
1106
- Nothing -> -- Print an LSP event.
1107
- logInfo logger $ showDiagnosticsColored $ map (fp,ShowDiag ,) newDiags
1108
- Just env -> LSP. runLspT env $
1109
- LSP. sendNotification LSP. STextDocumentPublishDiagnostics $
1110
- LSP. PublishDiagnosticsParams (fromNormalizedUri uri) ver (List newDiags)
1111
- pure $! HMap. insert uri newDiags published
1105
+ ! published' = HMap. insert uri newDiags published
1106
+ action = when (lastPublish /= newDiags) $ case lspEnv of
1107
+ Nothing -> -- Print an LSP event.
1108
+ logInfo logger $ showDiagnosticsColored $ map (fp,ShowDiag ,) newDiags
1109
+ Just env -> LSP. runLspT env $
1110
+ LSP. sendNotification LSP. STextDocumentPublishDiagnostics $
1111
+ LSP. PublishDiagnosticsParams (fromNormalizedUri uri) ver (List newDiags)
1112
+ return (published', action)
1112
1113
1113
1114
newtype Priority = Priority Double
1114
1115
0 commit comments