diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index f637aad8448..9ce91242cb1 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2746,6 +2746,18 @@ declare module 'vscode' { * signaled by returning `undefined` or `null`. */ provideRenameEdits(document: TextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult; + + /** + * 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. + * + * @param document The document in which rename will be invoked. + * @param position The position at which rename will be invoked. + * @param token A cancellation token. + * @return 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`. + */ + resolveRenameLocation?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; } /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 01ee496996d..454722f40c5 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -490,25 +490,6 @@ declare module 'vscode' { //#endregion - //#region Joh: rename context - - export interface RenameProvider2 extends RenameProvider { - - /** - * Optional function for resolving and validating a position at which rename is - * being carried out. - * - * @param document The document in which rename will be invoked. - * @param position The position at which rename will be invoked. - * @param token A cancellation token. - * @return The range of the identifier that is to be renamed. The lack of a result can signaled by returning `undefined` or `null`. - */ - resolveRenameLocation?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; - - } - - //#endregion - //#region Joao: SCM validation /** diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index 2c5b7c4eb7d..5e99422f862 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -467,14 +467,14 @@ class NavigateTypeAdapter { class RenameAdapter { - static supportsResolving(provider: vscode.RenameProvider2): boolean { + static supportsResolving(provider: vscode.RenameProvider): boolean { return typeof provider.resolveRenameLocation === 'function'; } private _documents: ExtHostDocuments; - private _provider: vscode.RenameProvider2; + private _provider: vscode.RenameProvider; - constructor(documents: ExtHostDocuments, provider: vscode.RenameProvider2) { + constructor(documents: ExtHostDocuments, provider: vscode.RenameProvider) { this._documents = documents; this._provider = provider; }