Theia API Documentation v1.65.0
    Preparing search index...

    The rename provider interface defines the contract between extensions and the rename-feature.

    interface RenameProvider {
        prepareRename?(
            document: TextDocument,
            position: Position,
            token: CancellationToken,
        ): ProviderResult<Range | { placeholder: string; range: Range }>;
        provideRenameEdits(
            document: TextDocument,
            position: Position,
            newName: string,
            token: CancellationToken,
        ): ProviderResult<WorkspaceEdit>;
    }
    Index

    Methods

    • Optional function for resolving and validating a position before running rename. The result can be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol which is being renamed - when omitted the text in the returned range is used.

      Parameters

      Returns ProviderResult<Range | { placeholder: string; range: Range }>

      The range or range and placeholder text of the identifier that is to be renamed. The lack of a result can signaled by returning undefined or null.