Language Features

class esbonio.server.LanguageFeature(server)[source]

Base class for language features.

completion(context)[source]

Called when a completion request matches one of the specified triggers.

document_change(params)[source]

Called when a text document is changed.

document_close(params)[source]

Called when a text document is closed.

document_open(params)[source]

Called when a text document is opened.

document_save(params)[source]

Called when a text document is saved.

document_symbol(params)[source]

Called when a document symbols request is received.

initialize(params)[source]

Called during initialize.

initialized(params)[source]

Called when the initialized notification is received.

shutdown(params)[source]

Called when the server is instructed to shutdown by the client.

workspace_symbol(params)[source]

Called when a workspace symbols request is received.

Completion

class esbonio.server.CompletionTrigger(patterns, languages=NOTHING, characters=NOTHING)[source]

Define when the feature’s completion method should be called.

characters: set[str]

Characters which, when typed, should trigger a completion request.

If empty, this trigger will ignore any trigger characters.

languages: set[str]

Languages in which the completion trigger should fire.

If empty, the document’s language will be ignored.

patterns: list[re.Pattern]

A list of regular expressions to try

class esbonio.server.CompletionContext(uri, doc, match, position, language, capabilities)[source]

Captures the context within which a completion request has been made.

capabilities: types.ClientCapabilities

The client’s capabilities.

property commit_characters_support: bool

Indicates if the client supports commit characters.

property deprecated_support: bool

Indicates if the client supports the deprecated field on a CompletionItem.

doc: TextDocument

The document within which the completion request was made.

property documentation_formats: list[MarkupKind]

The list of documentation formats supported by the client.

property insert_replace_support: bool

Indicates if the client supports InsertReplaceEdit.

language: str

The language where the completion request was made.

match: re.Match

The match object describing the site of the completion request.

position: types.Position

The position at which the completion request was made.

property preselect_support: bool

Indicates if the client supports the preselect field on a CompletionItem.

property snippet_support: bool

Indicates if the client supports snippets

property supported_tags: list[CompletionItemTag]

The list of CompletionItemTags supported by the client.

uri: Uri

The uri for the document in which the completion request was made.