hls-cabal-plugin-2.5.0.0: Cabal integration plugin with Haskell Language Server
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 -> Rope -> MaybeT 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.