File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
plugins/hls-eval-plugin/src/Ide/Plugin/Eval Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,20 @@ 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'})) = let annComments = epAnnComments anns'
62
+ in priorComments annComments
63
+ <> concatMap getCommentsForDecl (hsmodDecls m)
64
+ <> concatMap getCommentsForDecl (hsmodImports m)
65
+
66
+ getCommentsForDecl :: GenLocated (SrcSpanAnn' (EpAnn ann )) e
67
+ -> [LEpaComment ]
68
+ getCommentsForDecl (L (SrcSpanAnn (EpAnn _ _ cs) _) _) = priorComments cs <> getFollowingComments cs
69
+ getCommentsForDecl (L (SrcSpanAnn (EpAnnNotUsed ) _) _) = []
62
70
63
71
apiAnnComments' :: ParsedModule -> [SrcLoc. RealLocated EpaCommentTok ]
64
72
apiAnnComments' pm = do
65
- L span' (EpaComment c span ) <- getAnnotations $ pm_parsed_source pm
66
- pure (L (anchor span' ) c)
73
+ L span (EpaComment c _ ) <- getAnnotations $ pm_parsed_source pm
74
+ pure (L (anchor span ) c)
67
75
68
76
pattern RealSrcSpanAlready :: SrcLoc. RealSrcSpan -> SrcLoc. RealSrcSpan
69
77
pattern RealSrcSpanAlready x = x
You can’t perform that action at this time.
0 commit comments