@@ -1199,7 +1199,7 @@ updateFileDiagnostics :: MonadIO m
1199
1199
-> ShakeExtras
1200
1200
-> [(ShowDiagnostic ,Diagnostic )] -- ^ current results
1201
1201
-> m ()
1202
- updateFileDiagnostics recorder fp ver k ShakeExtras {diagnostics, hiddenDiagnostics, publishedDiagnostics, debouncer, lspEnv} current =
1202
+ updateFileDiagnostics recorder fp ver k ShakeExtras {diagnostics, hiddenDiagnostics, publishedDiagnostics, debouncer, lspEnv, ideTesting} current0 =
1203
1203
liftIO $ withTrace (" update diagnostics " <> fromString(fromNormalizedFilePath fp)) $ \ addTag -> do
1204
1204
addTag " key" (show k)
1205
1205
let (currentShown, currentHidden) = partition ((== ShowDiag ) . fst ) current
@@ -1208,6 +1208,7 @@ updateFileDiagnostics recorder fp ver k ShakeExtras{diagnostics, hiddenDiagnosti
1208
1208
addTagUnsafe msg t x v = unsafePerformIO(addTag (msg <> t) x) `seq` v
1209
1209
update :: (forall a . String -> String -> a -> a ) -> [Diagnostic ] -> STMDiagnosticStore -> STM [Diagnostic ]
1210
1210
update addTagUnsafe new store = addTagUnsafe " count" (show $ Prelude. length new) $ setStageDiagnostics addTagUnsafe uri ver (T. pack $ show k) new store
1211
+ current = second diagsFromRule <$> current0
1211
1212
addTag " version" (show ver)
1212
1213
mask_ $ do
1213
1214
-- Mask async exceptions to ensure that updated diagnostics are always
@@ -1230,6 +1231,11 @@ updateFileDiagnostics recorder fp ver k ShakeExtras{diagnostics, hiddenDiagnosti
1230
1231
LSP. sendNotification LSP. STextDocumentPublishDiagnostics $
1231
1232
LSP. PublishDiagnosticsParams (fromNormalizedUri uri) (fmap fromIntegral ver) (List newDiags)
1232
1233
return action
1234
+ where
1235
+ diagsFromRule c
1236
+ | coerce ideTesting = c{_source = ((T. pack(show k) <> " :" ) <> ) <$> _source c}
1237
+ | otherwise = c
1238
+
1233
1239
1234
1240
newtype Priority = Priority Double
1235
1241
0 commit comments