@@ -25,7 +25,8 @@ module Development.IDE.Spans.AtPoint (
2525 ) where
2626
2727
28- import GHC.Data.FastString (lengthFS )
28+ import GHC.Data.FastString (LexicalFastString (.. ),
29+ lengthFS )
2930import qualified GHC.Utils.Outputable as O
3031
3132import Development.IDE.GHC.Error
@@ -50,7 +51,6 @@ import Control.Monad.Extra
5051import Control.Monad.IO.Class
5152import Control.Monad.Trans.Class
5253import Control.Monad.Trans.Maybe
53- import Data.Coerce (coerce )
5454import qualified Data.HashMap.Strict as HM
5555import qualified Data.Map.Strict as M
5656import Data.Maybe
@@ -580,18 +580,8 @@ defRowToSymbolInfo _ = Nothing
580580
581581pointCommand :: HieASTs t -> Position -> (HieAST t -> a ) -> [a ]
582582pointCommand hf pos k =
583- M. elems $ flip M. mapMaybeWithKey (getAsts hf) $ \ fs ast ->
584- -- Since GHC 9.2:
585- -- getAsts :: Map HiePath (HieAst a)
586- -- type HiePath = LexicalFastString
587- --
588- -- but before:
589- -- getAsts :: Map HiePath (HieAst a)
590- -- type HiePath = FastString
591- --
592- -- 'coerce' here to avoid an additional function for maintaining
593- -- backwards compatibility.
594- case selectSmallestContaining (sp $ coerce fs) ast of
583+ M. elems $ flip M. mapMaybeWithKey (getAsts hf) $ \ (LexicalFastString fs) ast ->
584+ case selectSmallestContaining (sp fs) ast of
595585 Nothing -> Nothing
596586 Just ast' -> Just $ k ast'
597587 where
0 commit comments