File tree 1 file changed +13
-3
lines changed
plugins/hls-eval-plugin/src/Ide/Plugin/Eval
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,22 @@ queueForEvaluation ide nfp = do
58
58
59
59
#if MIN_VERSION_ghc(9,2,0)
60
60
getAnnotations :: Development.IDE.GHC.Compat. Located HsModule -> [LEpaComment ]
61
- getAnnotations (L _ (HsModule { hsmodAnn = anns'})) = priorComments $ epAnnComments anns'
61
+ getAnnotations (L _ m@ (HsModule { hsmodAnn = anns'})) =
62
+ priorComments annComments <> getFollowingComments annComments
63
+ <> concatMap getCommentsForDecl (hsmodImports m)
64
+ <> concatMap getCommentsForDecl (hsmodDecls m)
65
+ where
66
+ annComments = epAnnComments anns'
67
+
68
+ getCommentsForDecl :: GenLocated (SrcSpanAnn' (EpAnn ann )) e
69
+ -> [LEpaComment ]
70
+ getCommentsForDecl (L (SrcSpanAnn (EpAnn _ _ cs) _) _) = priorComments cs <> getFollowingComments cs
71
+ getCommentsForDecl (L (SrcSpanAnn (EpAnnNotUsed ) _) _) = []
62
72
63
73
apiAnnComments' :: ParsedModule -> [SrcLoc. RealLocated EpaCommentTok ]
64
74
apiAnnComments' pm = do
65
- L span' (EpaComment c span ) <- getAnnotations $ pm_parsed_source pm
66
- pure (L (anchor span' ) c)
75
+ L span (EpaComment c _ ) <- getAnnotations $ pm_parsed_source pm
76
+ pure (L (anchor span ) c)
67
77
68
78
pattern RealSrcSpanAlready :: SrcLoc. RealSrcSpan -> SrcLoc. RealSrcSpan
69
79
pattern RealSrcSpanAlready x = x
You can’t perform that action at this time.
0 commit comments