haskell-language-server-2.9.0.0: LSP server for GHC
Safe HaskellSafe-Inferred
LanguageGHC2021

Ide.Plugin.Cabal.Completion.Completions

Synopsis

Documentation

contextToCompleter :: Context -> Completer Source #

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 Source #

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 Source #

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.