Skip to content

Log a warning for every diagnostic received when doDiagnostics=False #1537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ghcide/src/Development/IDE/Core/Shake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ defineEarlyCutoff'
-> Action (Maybe BS.ByteString, IdeResult v)
-> Action (RunResult (A (RuleResult k)))
defineEarlyCutoff' doDiagnostics key file old mode action = do
extras@ShakeExtras{state, inProgress} <- getShakeExtras
extras@ShakeExtras{state, inProgress, logger} <- getShakeExtras
options <- getIdeOptions
(if optSkipProgress options key then id else withProgressVar inProgress file) $ do
val <- case old of
Expand Down Expand Up @@ -974,8 +974,9 @@ defineEarlyCutoff' doDiagnostics key file old mode action = do
(toShakeValue ShakeResult bs, Failed b)
Just v -> pure (maybe ShakeNoCutoff ShakeResult bs, Succeeded (vfsVersion =<< modTime) v)
liftIO $ setValues state key file res (Vector.fromList diags)
when doDiagnostics $
updateFileDiagnostics file (Key key) extras $ map (\(_,y,z) -> (y,z)) diags
if doDiagnostics
then updateFileDiagnostics file (Key key) extras $ map (\(_,y,z) -> (y,z)) diags
else forM_ diags $ \d -> liftIO $ logWarning logger $ showDiagnosticsColored [d]
let eq = case (bs, fmap decodeShakeValue old) of
(ShakeResult a, Just (ShakeResult b)) -> a == b
(ShakeStale a, Just (ShakeStale b)) -> a == b
Expand Down