Interface CompletionProvider

Language-specific service for handling completion requests.

interface CompletionProvider {
    completionOptions?: CompletionProviderOptions;
    getCompletion(document: LangiumDocument<AstNode>, params: CompletionParams, cancelToken?: CancellationToken): MaybePromise<undefined | CompletionList>;
}

Implemented by

Properties

completionOptions?: CompletionProviderOptions

Contains the completion options for this completion provider.

If multiple languages return different options, they are merged before being sent to the language client.

Methods

  • Handle a completion request.

    Parameters

    • document: LangiumDocument<AstNode>

      the document for which the completion request was triggered

    • params: CompletionParams

      the completion parameters

    • OptionalcancelToken: CancellationToken

      a token that can be used to cancel the request

    Returns MaybePromise<undefined | CompletionList>

    OperationCancelled if cancellation is detected during execution

    ResponseError if an error is detected that should be sent as response to the client