Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- contextToCompleter :: Context -> Completer
- getContext :: MonadIO m => Recorder (WithPriority Log) -> CabalPrefixInfo -> Rope -> MaybeT m Context
- getCabalPrefixInfo :: FilePath -> PosPrefixInfo -> CabalPrefixInfo
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.