@@ -17,7 +17,7 @@ module Development.IDE.GHC.Compat(
17
17
NameCacheUpdater (.. ),
18
18
#if MIN_VERSION_ghc(9,3,0)
19
19
getMessages ,
20
- diagnosticMessage ,
20
+ renderDiagnosticMessageWithHints ,
21
21
nameEnvElts ,
22
22
#else
23
23
upNameCache ,
@@ -402,7 +402,7 @@ type WarnMsg = MsgEnvelope DecoratedSDoc
402
402
getMessages' :: PState -> DynFlags -> (Bag WarnMsg , Bag ErrMsg )
403
403
getMessages' pst dflags =
404
404
#if MIN_VERSION_ghc(9,3,0)
405
- bimap (fmap (fmap diagnosticMessage ) . getMessages) (fmap (fmap diagnosticMessage ) . getMessages) $ getPsMessages pst
405
+ bimap (fmap (fmap renderDiagnosticMessageWithHints ) . getMessages) (fmap (fmap renderDiagnosticMessageWithHints ) . getMessages) $ getPsMessages pst
406
406
#else
407
407
#if MIN_VERSION_ghc(9,2,0)
408
408
bimap (fmap pprWarning) (fmap pprError) $
@@ -413,11 +413,16 @@ getMessages' pst dflags =
413
413
#endif
414
414
#endif
415
415
416
+ #if MIN_VERSION_ghc(9,3,0)
417
+ renderDiagnosticMessageWithHints :: Diagnostic a => a -> DecoratedSDoc
418
+ renderDiagnosticMessageWithHints a = unionDecoratedSDoc (diagnosticMessage a) (mkDecorated $ map ppr $ diagnosticHints a)
419
+ #endif
420
+
416
421
#if MIN_VERSION_ghc(9,2,0)
417
422
pattern PFailedWithErrorMessages :: forall a b . (b -> Bag (MsgEnvelope DecoratedSDoc )) -> ParseResult a
418
423
pattern PFailedWithErrorMessages msgs
419
424
#if MIN_VERSION_ghc(9,3,0)
420
- <- PFailed (const . fmap (fmap diagnosticMessage ) . getMessages . getPsErrorMessages -> msgs)
425
+ <- PFailed (const . fmap (fmap renderDiagnosticMessageWithHints ) . getMessages . getPsErrorMessages -> msgs)
421
426
#else
422
427
<- PFailed (const . fmap pprError . getErrorMessages -> msgs)
423
428
#endif
0 commit comments