Interface RenameProvider

Language-specific service for handling rename requests and prepare rename requests.

interface RenameProvider {
    prepareRename(document: LangiumDocument<AstNode>, params: TextDocumentPositionParams, cancelToken?: CancellationToken): MaybePromise<undefined | Range>;
    rename(document: LangiumDocument<AstNode>, params: RenameParams, cancelToken?: CancellationToken): MaybePromise<undefined | WorkspaceEdit>;
}

Implemented by

Methods

  • Handle a prepare rename request.

    Parameters

    • document: LangiumDocument<AstNode>

      The document in which the prepare rename request was triggered.

    • params: TextDocumentPositionParams

      The prepare rename parameters.

    • OptionalcancelToken: CancellationToken

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

    Returns MaybePromise<undefined | Range>

    A range that describes the range of the symbol to be renamed.

    OperationCancelled if cancellation is detected during execution

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

  • Handle a rename request.

    Parameters

    • document: LangiumDocument<AstNode>

      The document in which the rename request was triggered.

    • params: RenameParams

      The rename parameters.

    • OptionalcancelToken: CancellationToken

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

    Returns MaybePromise<undefined | WorkspaceEdit>

    A workspace edit that describes the changes to be applied to the workspace.

    OperationCancelled if cancellation is detected during execution

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