@@ -12,14 +12,18 @@ module Development.IDE.Spans.LocalBindings
12
12
import Control.DeepSeq
13
13
import Control.Monad
14
14
import Data.Bifunctor
15
- import Data.IntervalMap.FingerTree (IntervalMap , Interval (.. ))
16
- import qualified Data.IntervalMap.FingerTree as IM
17
- import qualified Data.List as L
18
- import qualified Data.Map as M
19
- import qualified Data.Set as S
20
- import Development.IDE.GHC.Compat (RefMap , identType , identInfo , getScopeFromContext , getBindSiteFromContext , Scope (.. ), Name , Type )
15
+ import Data.IntervalMap.FingerTree (Interval (.. ), IntervalMap )
16
+ import qualified Data.IntervalMap.FingerTree as IM
17
+ import qualified Data.List as L
18
+ import qualified Data.Map as M
19
+ import qualified Data.Set as S
20
+ import Development.IDE.GHC.Compat (Name , RefMap , Scope (.. ), Type ,
21
+ getBindSiteFromContext ,
22
+ getScopeFromContext , identInfo ,
23
+ identType )
21
24
import Development.IDE.GHC.Error
22
25
import Development.IDE.Types.Location
26
+ import Name (isSystemName )
23
27
import NameEnv
24
28
import SrcLoc
25
29
@@ -53,7 +57,7 @@ localBindings refmap = bimap mk mk $ unzip $ do
53
57
Just scopes <- pure $ getScopeFromContext info
54
58
scope <- scopes >>= \ case
55
59
LocalScope scope -> pure $ realSrcSpanToInterval scope
56
- _ -> []
60
+ _ -> []
57
61
pure ( scope
58
62
, unitNameEnv name (name,ty)
59
63
)
@@ -115,7 +119,8 @@ getDefiningBindings bs rss
115
119
-- This is meant for use with the fuzzy `PositionRange` returned by `PositionMapping`
116
120
getFuzzyScope :: Bindings -> Position -> Position -> [(Name , Maybe Type )]
117
121
getFuzzyScope bs a b
118
- = nameEnvElts
122
+ = filter (not . isSystemName . fst )
123
+ $ nameEnvElts
119
124
$ foldMap snd
120
125
$ IM. intersections (Interval a b)
121
126
$ getLocalBindings bs
0 commit comments