ghcide-2.9.0.0: The core of an IDE

Safe Haskell | None
Language | GHC2021

Development.IDE.Spans.AtPoint

Description

Gives information about symbols at a given point in DAML files. These are all pure functions that should execute quickly.

Synopsis

- atPoint :: IdeOptions -> HieAstResult -> DocAndTyThingMap -> HscEnv -> Position -> IO (Maybe (Maybe Range, [Text]))
- gotoDefinition :: forall (m :: Type -> Type) a. MonadIO m => WithHieDb -> LookupModule m -> IdeOptions -> Map ModuleName NormalizedFilePath -> HieASTs a -> Position -> MaybeT m [Location]
- gotoTypeDefinition :: forall (m :: Type -> Type). MonadIO m => WithHieDb -> LookupModule m -> IdeOptions -> HieAstResult -> Position -> MaybeT m [Location]
- documentHighlight :: forall (m :: Type -> Type) a. Monad m => HieASTs a -> RefMap a -> Position -> MaybeT m [DocumentHighlight]
- pointCommand :: HieASTs t -> Position -> (HieAST t -> a) -> [a]
- referencesAtPoint :: MonadIO m => WithHieDb -> NormalizedFilePath -> Position -> FOIReferences -> m [Location]
- computeTypeReferences :: Foldable f => f (HieAST Type) -> Map Name [Span]
- newtype FOIReferences = FOIReferences (HashMap NormalizedFilePath (HieAstResult, PositionMapping))
- defRowToSymbolInfo :: Res DefRow -> Maybe SymbolInformation
- getNamesAtPoint :: HieASTs a -> Position -> PositionMapping -> [Name]
- toCurrentLocation :: PositionMapping -> Location -> Maybe Location
- rowToLoc :: Res RefRow -> Maybe Location
- nameToLocation :: MonadIO m => WithHieDb -> LookupModule m -> Name -> m (Maybe [Location])
- type LookupModule (m :: Type -> Type) = FilePath -> ModuleName -> Unit -> Bool -> MaybeT m Uri

# Documentation

atPoint :: IdeOptions -> HieAstResult -> DocAndTyThingMap -> HscEnv -> Position -> IO (Maybe (Maybe Range, [Text])) #

Synopsis for the name at a given position.

gotoDefinition :: forall (m :: Type -> Type) a. MonadIO m => WithHieDb -> LookupModule m -> IdeOptions -> Map ModuleName NormalizedFilePath -> HieASTs a -> Position -> MaybeT m [Location] #

Locate the definition of the name at a given position.

gotoTypeDefinition :: forall (m :: Type -> Type). MonadIO m => WithHieDb -> LookupModule m -> IdeOptions -> HieAstResult -> Position -> MaybeT m [Location] #

documentHighlight :: forall (m :: Type -> Type) a. Monad m => HieASTs a -> RefMap a -> Position -> MaybeT m [DocumentHighlight] #

pointCommand :: HieASTs t -> Position -> (HieAST t -> a) -> [a] #

referencesAtPoint #

Arguments

:: MonadIO m |
=> WithHieDb |
-> NormalizedFilePath | The file the cursor is in
-> Position | position in the file
-> FOIReferences | references data for FOIs
-> m [Location] |

computeTypeReferences :: Foldable f => f (HieAST Type) -> Map Name [Span] #

newtype FOIReferences #

HieFileResult for files of interest, along with the position mappings

Constructors

FOIReferences (HashMap NormalizedFilePath (HieAstResult, PositionMapping)) |

defRowToSymbolInfo :: Res DefRow -> Maybe SymbolInformation #

getNamesAtPoint :: HieASTs a -> Position -> PositionMapping -> [Name] #

toCurrentLocation :: PositionMapping -> Location -> Maybe Location #

rowToLoc :: Res RefRow -> Maybe Location #

nameToLocation :: MonadIO m => WithHieDb -> LookupModule m -> Name -> m (Maybe [Location]) #

Given a `Name` attempt to find the location where it is defined.

type LookupModule (m :: Type -> Type) = FilePath -> ModuleName -> Unit -> Bool -> MaybeT m Uri #

Gives a Uri for the module, given the .hie file location and the the module info The Bool denotes if it is a boot module