@@ -17,7 +17,7 @@ module Development.IDE.GHC.Compat(
1717 NameCacheUpdater (.. ),
1818#if MIN_VERSION_ghc(9,3,0)
1919 getMessages ,
20- diagnosticMessage ,
20+ renderDiagnosticMessageWithHints ,
2121 nameEnvElts ,
2222#else
2323 upNameCache ,
@@ -402,7 +402,7 @@ type WarnMsg = MsgEnvelope DecoratedSDoc
402402getMessages' :: PState -> DynFlags -> (Bag WarnMsg , Bag ErrMsg )
403403getMessages' pst dflags =
404404#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
406406#else
407407#if MIN_VERSION_ghc(9,2,0)
408408 bimap (fmap pprWarning) (fmap pprError) $
@@ -413,11 +413,16 @@ getMessages' pst dflags =
413413#endif
414414#endif
415415
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+
416421#if MIN_VERSION_ghc(9,2,0)
417422pattern PFailedWithErrorMessages :: forall a b . (b -> Bag (MsgEnvelope DecoratedSDoc )) -> ParseResult a
418423pattern PFailedWithErrorMessages msgs
419424#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)
421426#else
422427 <- PFailed (const . fmap pprError . getErrorMessages -> msgs)
423428#endif
0 commit comments