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