@@ -633,12 +633,14 @@ suggestDeleteUnusedBinding
633633 } = Just (reLoc lname, matches)
634634 extractNameAndMatchesFromFunBind _ = Nothing
635635
636+ -- | For given name, find the span of related type signature.
636637 findRelatedSigSpan' :: PositionIndexedString -> String -> LSig GhcPs -> [Range ]
637638 findRelatedSigSpan' indexedContent name = \ case
638639#if MIN_VERSION_ghc(9,9,0)
639640 (L (EpAnn sigSpan _ c) sig) ->
640641 let l = epaLocationRealSrcSpan sigSpan
641642 in case findRelatedSigSpan1 name sig of
643+ -- On GHC 9.10+ this will include Haddock comments.
642644 Just (_span, True ) -> pure . extendForSpaces indexedContent . toRange $ l `withCommentSpan` c
643645#else
644646 (reLoc -> L (RealSrcSpan l _) sig) ->
@@ -2119,10 +2121,11 @@ matchRegExMultipleImports message = do
21192121 return (binding, imps)
21202122
21212123#if MIN_VERSION_ghc(9,9,0)
2124+ -- | Expand signature span to include Haddock.
21222125withCommentSpan :: RealSrcSpan -> EpAnnComments -> RealSrcSpan
21232126withCommentSpan idL = foldl' combineRealSrcSpans idL . map commsSrc . commsToList
21242127 where
2125- -- commsSrc :: GenLocated (EpaLocation' a) e -> RealSrcSpan
2128+ commsSrc :: GenLocated (EpaLocation' a ) e -> RealSrcSpan
21262129 commsSrc (L l _) = epaLocationRealSrcSpan l
21272130 commsToList :: EpAnnComments -> [LEpaComment ]
21282131 commsToList = \ case
0 commit comments