@@ -363,16 +363,17 @@ updatePositionMap uri changes = pluginGetFile "updatePositionMap: " uri $ \file
363
363
-- ---------------------------------------------------------------------
364
364
365
365
publishDiagnostics :: (MonadIO m , MonadReader REnv m )
366
- => Int -> J. NormalizedUri -> J. TextDocumentVersion -> DiagnosticsBySource -> m ()
367
- publishDiagnostics maxToSend uri' mv diags = do
366
+ => J. NormalizedUri -> J. TextDocumentVersion -> DiagnosticsBySource -> m ()
367
+ publishDiagnostics uri' mv diags = do
368
368
lf <- asks lspFuncs
369
- publishDiagnostics' lf maxToSend uri' mv diags
369
+ publishDiagnostics' lf uri' mv diags
370
370
371
371
372
372
publishDiagnostics' :: MonadIO m
373
- => Core. LspFuncs c -> Int -> J. NormalizedUri -> J. TextDocumentVersion -> DiagnosticsBySource -> m ()
374
- publishDiagnostics' lf maxToSend uri' mv diags =
375
- liftIO $ Core. publishDiagnosticsFunc lf maxToSend uri' mv diags
373
+ => Core. LspFuncs Config -> J. NormalizedUri -> J. TextDocumentVersion -> DiagnosticsBySource -> m ()
374
+ publishDiagnostics' lf uri' mv diags = do
375
+ config <- liftIO $ fromMaybe Data.Default. def <$> Core. config lf
376
+ liftIO $ Core. publishDiagnosticsFunc lf (maxNumberOfProblems config) uri' mv diags
376
377
377
378
378
379
-- ---------------------------------------------------------------------
@@ -947,18 +948,17 @@ requestDiagnosticsNormal tn file mVer = do
947
948
sendOneGhc :: J. DiagnosticSource -> (J. NormalizedUri , [Diagnostic ]) -> R ()
948
949
sendOneGhc pid (fileUri,ds) = do
949
950
if any (hasSeverity J. DsError ) ds
950
- then publishDiagnostics maxToSend fileUri Nothing
951
+ then publishDiagnostics fileUri Nothing
951
952
(Map. fromList [(Just " hlint" ,SL. toSortedList [] ),(Just pid,SL. toSortedList ds)])
952
953
else sendOne pid (fileUri,ds)
953
954
954
955
sendOne pid (fileUri,ds) = do
955
- publishDiagnostics maxToSend fileUri Nothing (Map. fromList [(Just pid,SL. toSortedList ds)])
956
+ publishDiagnostics fileUri Nothing (Map. fromList [(Just pid,SL. toSortedList ds)])
956
957
957
958
hasSeverity :: J. DiagnosticSeverity -> J. Diagnostic -> Bool
958
959
hasSeverity sev (J. Diagnostic _ (Just s) _ _ _ _) = s == sev
959
960
hasSeverity _ _ = False
960
- sendEmpty = publishDiagnostics maxToSend (J. toNormalizedUri file) Nothing (Map. fromList [(Just " bios" ,SL. toSortedList [] )])
961
- maxToSend = maxNumberOfProblems clientConfig
961
+ sendEmpty = publishDiagnostics (J. toNormalizedUri file) Nothing (Map. fromList [(Just " bios" ,SL. toSortedList [] )])
962
962
963
963
let sendHlint = hlintOn clientConfig
964
964
when sendHlint $ do
0 commit comments