@@ -25,7 +25,8 @@ module Development.IDE.Spans.AtPoint (
25
25
) where
26
26
27
27
28
- import GHC.Data.FastString (lengthFS )
28
+ import GHC.Data.FastString (LexicalFastString (.. ),
29
+ lengthFS )
29
30
import qualified GHC.Utils.Outputable as O
30
31
31
32
import Development.IDE.GHC.Error
@@ -50,7 +51,6 @@ import Control.Monad.Extra
50
51
import Control.Monad.IO.Class
51
52
import Control.Monad.Trans.Class
52
53
import Control.Monad.Trans.Maybe
53
- import Data.Coerce (coerce )
54
54
import qualified Data.HashMap.Strict as HM
55
55
import qualified Data.Map.Strict as M
56
56
import Data.Maybe
@@ -580,18 +580,8 @@ defRowToSymbolInfo _ = Nothing
580
580
581
581
pointCommand :: HieASTs t -> Position -> (HieAST t -> a ) -> [a ]
582
582
pointCommand 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
595
585
Nothing -> Nothing
596
586
Just ast' -> Just $ k ast'
597
587
where
0 commit comments