Interface DefinitionProvider

Language-specific service for handling go to definition requests.

interface DefinitionProvider {
    getDefinition(document: LangiumDocument<AstNode>, params: DefinitionParams, cancelToken?: CancellationToken): MaybePromise<undefined | LocationLink[]>;
}

Implemented by

Methods

  • Handle a go to definition request.

    Parameters

    • document: LangiumDocument<AstNode>

      The document in which the request was triggered.

    • params: DefinitionParams

      The parameters of the request.

    • OptionalcancelToken: CancellationToken

      A cancellation token that can be used to cancel the request.

    Returns MaybePromise<undefined | LocationLink[]>

    A list of location links to the definition(s) of the symbol at the given position.

    OperationCancelled if cancellation is detected during execution

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