Skip to content

Commit a857b9e

Browse files
dylan-thinnesJaro Reinders
authored and
Jaro Reinders
committed
Fix up mistakes from merge, TODO fix merge issues for 9.3.0
1 parent 9337f25 commit a857b9e

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

ghcide/src/Development/IDE/GHC/Compat/Outputable.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ pprNoLocMsgEnvelope (MsgEnvelope { errMsgDiagnostic = e
121121
#if MIN_VERSION_ghc(9,6,1)
122122
type ErrMsg = MsgEnvelope GhcMessage
123123
type WarnMsg = MsgEnvelope GhcMessage
124-
#elif MIN_VERSION_ghc(9,3,0)
124+
#else
125125
type ErrMsg = MsgEnvelope DecoratedSDoc
126126
type WarnMsg = MsgEnvelope DecoratedSDoc
127+
#endif
127128

128129
mkPrintUnqualifiedDefault :: HscEnv -> GlobalRdrEnv -> PrintUnqualified
129130
#if MIN_VERSION_ghc(9,5,0)

ghcide/src/Development/IDE/Types/Diagnostics.hs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,13 @@ ideErrorFromLspDiag lspDiag fdFilePath origMsg =
9494
attachedReason :: Traversal' Diagnostic (Maybe JSON.Value)
9595
attachedReason = data_ . non (JSON.object []) . JSON.atKey "attachedReason"
9696

97-
#if MIN_VERSION_ghc(9,3,0)
9897
attachReason :: Maybe DiagnosticReason -> Diagnostic -> Diagnostic
9998
attachReason Nothing = id
10099
attachReason (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

115105
showFlag :: WarningFlag -> Maybe T.Text
116106
showFlag flag = ("-W" <>) . T.pack . flagSpecName <$> find ((== flag) . flagSpecFlag) wWarningFlags

0 commit comments

Comments
 (0)