Ide.Plugin.Cabal.Completion.Completer.Simple

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

Safe Haskell | None
Language | GHC2021

Ide.Plugin.Cabal.Completion.Completer.Simple

Synopsis

- noopCompleter :: Completer
- errorNoopCompleter :: Log -> Completer
- constantCompleter :: [Text] -> Completer
- nameCompleter :: Completer
- weightedConstantCompleter :: [Text] -> Map Text Double -> Completer
- mkDefaultCompletionItem :: Text -> CompletionItem
- mkSimpleCompletionItem :: Range -> Text -> CompletionItem
- mkCompletionItem :: Range -> Text -> Text -> CompletionItem

# Documentation

noopCompleter :: Completer #

Completer to be used when no completion suggestions are implemented for the field

errorNoopCompleter :: Log -> Completer #

Completer to be used when no completion suggestions are implemented for the field and a log message should be emitted.

constantCompleter :: [Text] -> Completer #

Completer to be used when a simple set of values can be completed for a field.

nameCompleter :: Completer #

Completer to be used for the field `name:` value.

This is almost always the name of the cabal file. However, it is not forbidden by the specification to have a different name, it is just forbidden on hackage.

weightedConstantCompleter :: [Text] -> Map Text Double -> Completer #

Completer to be used when a set of values with priority weights attached to some values are to be completed for a field.

The higher the weight, the higher the priority to show the value in the completion suggestion.

If the value does not occur in the weighted map its weight is defaulted to zero.

mkDefaultCompletionItem :: Text -> CompletionItem #

Creates a CompletionItem with the given text as the label where the completion item kind is keyword.

mkSimpleCompletionItem :: Range -> Text -> CompletionItem #

Returns a CompletionItem with the given starting position and text to be inserted, where the displayed text is the same as the inserted text.

mkCompletionItem :: Range -> Text -> Text -> CompletionItem #

Returns a completionItem with the given starting position, text to be inserted and text to be displayed in the completion suggestion.