File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed
ghcide/src/Development/IDE Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -720,7 +720,7 @@ tagDiag (w@(Just (WarningWithFlag warning)), fd)
720720 | Just tag <- requiresTag warning
721721 = (w, fd & fdLspDiagnosticL %~ \ diag -> diag { _tags = Just $ tag : concat (_tags diag) })
722722#endif
723- where
723+ where
724724 requiresTag :: WarningFlag -> Maybe DiagnosticTag
725725#if !MIN_VERSION_ghc(9,7,0)
726726 -- doesn't exist on 9.8, we use WarningWithCategory instead
Original file line number Diff line number Diff line change @@ -121,9 +121,10 @@ pprNoLocMsgEnvelope (MsgEnvelope { errMsgDiagnostic = e
121121#if MIN_VERSION_ghc(9,6,1)
122122type ErrMsg = MsgEnvelope GhcMessage
123123type WarnMsg = MsgEnvelope GhcMessage
124- #elif MIN_VERSION_ghc(9,3,0)
124+ #else
125125type ErrMsg = MsgEnvelope DecoratedSDoc
126126type WarnMsg = MsgEnvelope DecoratedSDoc
127+ #endif
127128
128129mkPrintUnqualifiedDefault :: HscEnv -> GlobalRdrEnv -> PrintUnqualified
129130#if MIN_VERSION_ghc(9,5,0)
Original file line number Diff line number Diff line change @@ -94,23 +94,13 @@ ideErrorFromLspDiag lspDiag fdFilePath origMsg =
9494attachedReason :: Traversal' Diagnostic (Maybe JSON. Value )
9595attachedReason = data_ . non (JSON. object [] ) . JSON. atKey " attachedReason"
9696
97- #if MIN_VERSION_ghc(9,3,0)
9897attachReason :: Maybe DiagnosticReason -> Diagnostic -> Diagnostic
9998attachReason Nothing = id
10099attachReason (Just wr) = attachedReason .~ fmap JSON. toJSON (showReason wr)
101100 where
102101 showReason = \ case
103102 WarningWithFlag flag -> showFlag flag
104103 _ -> Nothing
105- #else
106- attachReason :: WarnReason -> Diagnostic -> Diagnostic
107- attachReason wr = attachedReason .~ fmap JSON. toJSON (showReason wr)
108- where
109- showReason = \ case
110- NoReason -> Nothing
111- Reason flag -> showFlag flag
112- ErrReason flag -> showFlag =<< flag
113- #endif
114104
115105showFlag :: WarningFlag -> Maybe T. Text
116106showFlag flag = (" -W" <> ) . T. pack . flagSpecName <$> find ((== flag) . flagSpecFlag) wWarningFlags
You can’t perform that action at this time.
0 commit comments