Ide.Plugin.Cabal.Completion.Completions

haskell-language-server-2.9.0.0: LSP server for GHC

Safe Haskell | None
Language | GHC2021

Ide.Plugin.Cabal.Completion.Completions

Synopsis

- contextToCompleter :: Context -> Completer
- getContext :: MonadIO m => Recorder (WithPriority Log) -> CabalPrefixInfo -> [Field Position] -> m Context
- getCabalPrefixInfo :: FilePath -> PosPrefixInfo -> CabalPrefixInfo

# Documentation

contextToCompleter :: Context -> Completer #

Takes information about the completion context within the file and finds the correct completer to be applied.

getContext :: MonadIO m => Recorder (WithPriority Log) -> CabalPrefixInfo -> [Field Position] -> m Context #

Takes prefix info about the previously written text and a rope (representing a file), returns the corresponding context.

Can return Nothing if an error occurs.

TODO: first line can only have cabal-version: keyword

getCabalPrefixInfo :: FilePath -> PosPrefixInfo -> CabalPrefixInfo #

Takes information about the current file's file path, and the cursor position in the file; and builds a CabalPrefixInfo with the prefix up to that cursor position. Checks whether a suffix needs to be completed and calculates the range in the document where the completion action should be applied.