ghcide-2.9.0.0: The core of an IDE

Safe Haskell | None
Language | GHC2021

Development.IDE.Spans.LocalBindings

Synopsis

- data Bindings
- getLocalScope :: Bindings -> RealSrcSpan -> [(Name, Maybe Type)]
- getFuzzyScope :: Bindings -> Position -> Position -> [(Name, Maybe Type)]
- getDefiningBindings :: Bindings -> RealSrcSpan -> [(Name, Maybe Type)]
- getFuzzyDefiningBindings :: Bindings -> Position -> Position -> [(Name, Maybe Type)]
- bindings :: RefMap Type -> Bindings

# Documentation

data Bindings #

The available bindings at every point in a Haskell tree.

#### Instances

Instances details

NFData Bindings # |
Instance details Defined in Development.IDE.Spans.LocalBindings Methods rnf :: Bindings -> () #
Monoid Bindings # |
Instance details Defined in Development.IDE.Spans.LocalBindings Methods mempty :: Bindings # mappend :: Bindings -> Bindings -> Bindings # mconcat :: [Bindings] -> Bindings #
Semigroup Bindings # |
Instance details Defined in Development.IDE.Spans.LocalBindings Methods (<>) :: Bindings -> Bindings -> Bindings # sconcat :: NonEmpty Bindings -> Bindings # stimes :: Integral b => b -> Bindings -> Bindings #
Show Bindings # |
Instance details Defined in Development.IDE.Spans.LocalBindings Methods showsPrec :: Int -> Bindings -> ShowS # show :: Bindings -> String # showList :: [Bindings] -> ShowS #

getLocalScope :: Bindings -> RealSrcSpan -> [(Name, Maybe Type)] #

Given a `Bindings` get every identifier in scope at the given `RealSrcSpan`,

getFuzzyScope :: Bindings -> Position -> Position -> [(Name, Maybe Type)] #

Lookup all names in scope in any span that intersects the interval defined by the two positions. This is meant for use with the fuzzy `PositionRange` returned by `PositionMapping`

getDefiningBindings :: Bindings -> RealSrcSpan -> [(Name, Maybe Type)] #

Given a `Bindings`, get every binding currently active at a given `RealSrcSpan`,

getFuzzyDefiningBindings :: Bindings -> Position -> Position -> [(Name, Maybe Type)] #

Given a `Bindings`, get every binding that intersects the interval defined by the two positions. This is meant for use with the fuzzy `PositionRange` returned by `PositionMapping`

bindings :: RefMap Type -> Bindings #