Skip to content

Commit 8d310fb

Browse files
committed
Fix up mistakes from merge, TODO fix merge issues for 9.3.0
1 parent c248bb3 commit 8d310fb

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ tcRnModule hsc_env tc_helpers pmod = do
365365
do hscTypecheckRenameWithDiagnostics hscEnvTmp ms $
366366
HsParsedModule { hpm_module = parsedSource pmod
367367
, hpm_src_files = pm_extra_src_files pmod
368-
, hpm_annotations = pm_annotations pmod
369368
}
370369
let rn_info = case mrn_info of
371370
Just x -> x
@@ -708,11 +707,12 @@ tagDiag (w@(Just (WarningWithCategory cat)), fd)
708707
tagDiag (w@(Just (WarningWithFlags warnings)), fd)
709708
| tags <- mapMaybe requiresTag (toList warnings)
710709
= (w, fd & fdLspDiagnosticL %~ \diag -> diag { _tags = Just $ tags ++ concat (_tags diag) })
711-
tagDiag (w@(Just (WarningWithFlag warning)), (nfp, sh, fd))
710+
#else
711+
tagDiag (w@(Just (WarningWithFlag warning)), fd)
712712
| Just tag <- requiresTag warning
713-
= (w, fd & fdLspDiagnosticL %~ \diag -> { _tags = Just $ tag : concat (_tags diag) })
713+
= (w, fd & fdLspDiagnosticL %~ \diag -> diag { _tags = Just $ tag : concat (_tags diag) })
714714
#endif
715-
where
715+
where
716716
requiresTag :: WarningFlag -> Maybe DiagnosticTag
717717
#if !MIN_VERSION_ghc(9,7,0)
718718
-- doesn't exist on 9.8, we use WarningWithCategory instead
@@ -1111,7 +1111,7 @@ parseFileContents env customPreprocessor filename ms = do
11111111
sourceParser
11121112
DiagnosticSeverity_Warning
11131113
(fmap attachNoStructuredError preproc_warns)
1114-
(parsed', msgs) <- liftIO $ applyPluginsParsedResultAction env ms hpm_annotations parsed psMessages
1114+
(parsed', msgs) <- liftIO $ applyPluginsParsedResultAction env ms parsed psMessages
11151115
let (warns, errors) = renderMessages msgs
11161116

11171117
-- Just because we got a `POk`, it doesn't mean there

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ renderMessages msgs =
318318
let renderMsgs extractor = (fmap . fmap) renderDiagnosticMessageWithHints . getMessages $ extractor msgs
319319
#endif
320320
in (renderMsgs psWarnings, renderMsgs psErrors)
321-
in (renderMsgs psWarnings, renderMsgs psErrors)
322321

323322
#if MIN_VERSION_ghc(9,6,1)
324323
pattern PFailedWithErrorMessages :: forall a b. (b -> Bag (MsgEnvelope GhcMessage)) -> ParseResult a

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ pprNoLocMsgEnvelope (MsgEnvelope { errMsgDiagnostic = e
123123
#if MIN_VERSION_ghc(9,6,1)
124124
type ErrMsg = MsgEnvelope GhcMessage
125125
type WarnMsg = MsgEnvelope GhcMessage
126-
#elif MIN_VERSION_ghc(9,3,0)
126+
#else
127127
type ErrMsg = MsgEnvelope DecoratedSDoc
128128
type WarnMsg = MsgEnvelope DecoratedSDoc
129+
#endif
129130

130131
mkPrintUnqualifiedDefault :: HscEnv -> GlobalRdrEnv -> PrintUnqualified
131132
#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)