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)
720
720
| Just tag <- requiresTag warning
721
721
= (w, fd & fdLspDiagnosticL %~ \ diag -> diag { _tags = Just $ tag : concat (_tags diag) })
722
722
#endif
723
- where
723
+ where
724
724
requiresTag :: WarningFlag -> Maybe DiagnosticTag
725
725
#if !MIN_VERSION_ghc(9,7,0)
726
726
-- 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
121
121
#if MIN_VERSION_ghc(9,6,1)
122
122
type ErrMsg = MsgEnvelope GhcMessage
123
123
type WarnMsg = MsgEnvelope GhcMessage
124
- #elif MIN_VERSION_ghc(9,3,0)
124
+ #else
125
125
type ErrMsg = MsgEnvelope DecoratedSDoc
126
126
type WarnMsg = MsgEnvelope DecoratedSDoc
127
+ #endif
127
128
128
129
mkPrintUnqualifiedDefault :: HscEnv -> GlobalRdrEnv -> PrintUnqualified
129
130
#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 =
94
94
attachedReason :: Traversal' Diagnostic (Maybe JSON. Value )
95
95
attachedReason = data_ . non (JSON. object [] ) . JSON. atKey " attachedReason"
96
96
97
- #if MIN_VERSION_ghc(9,3,0)
98
97
attachReason :: Maybe DiagnosticReason -> Diagnostic -> Diagnostic
99
98
attachReason Nothing = id
100
99
attachReason (Just wr) = attachedReason .~ fmap JSON. toJSON (showReason wr)
101
100
where
102
101
showReason = \ case
103
102
WarningWithFlag flag -> showFlag flag
104
103
_ -> 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
114
104
115
105
showFlag :: WarningFlag -> Maybe T. Text
116
106
showFlag flag = (" -W" <> ) . T. pack . flagSpecName <$> find ((== flag) . flagSpecFlag) wWarningFlags
You can’t perform that action at this time.
0 commit comments