Skip to content

Commit 6428c00

Browse files
committed
move api to stable, microsoft#7340
1 parent 8c1e3a7 commit 6428c00

3 files changed

Lines changed: 15 additions & 22 deletions

File tree

src/vs/vscode.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,6 +2746,18 @@ declare module 'vscode' {
27462746
* signaled by returning `undefined` or `null`.
27472747
*/
27482748
provideRenameEdits(document: TextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit>;
2749+
2750+
/**
2751+
* Optional function for resolving and validating a position *before* running rename. The result can
2752+
* be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol
2753+
* which is being renamed - when omitted the text in the returned range is used.
2754+
*
2755+
* @param document The document in which rename will be invoked.
2756+
* @param position The position at which rename will be invoked.
2757+
* @param token A cancellation token.
2758+
* @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`.
2759+
*/
2760+
resolveRenameLocation?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Range | { range: Range, placeholder: string }>;
27492761
}
27502762

27512763
/**

src/vs/vscode.proposed.d.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -490,25 +490,6 @@ declare module 'vscode' {
490490

491491
//#endregion
492492

493-
//#region Joh: rename context
494-
495-
export interface RenameProvider2 extends RenameProvider {
496-
497-
/**
498-
* Optional function for resolving and validating a position at which rename is
499-
* being carried out.
500-
*
501-
* @param document The document in which rename will be invoked.
502-
* @param position The position at which rename will be invoked.
503-
* @param token A cancellation token.
504-
* @return The range of the identifier that is to be renamed. The lack of a result can signaled by returning `undefined` or `null`.
505-
*/
506-
resolveRenameLocation?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Range | { range: Range, placeholder: string }>;
507-
508-
}
509-
510-
//#endregion
511-
512493
//#region Joao: SCM validation
513494

514495
/**

src/vs/workbench/api/node/extHostLanguageFeatures.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,14 @@ class NavigateTypeAdapter {
467467

468468
class RenameAdapter {
469469

470-
static supportsResolving(provider: vscode.RenameProvider2): boolean {
470+
static supportsResolving(provider: vscode.RenameProvider): boolean {
471471
return typeof provider.resolveRenameLocation === 'function';
472472
}
473473

474474
private _documents: ExtHostDocuments;
475-
private _provider: vscode.RenameProvider2;
475+
private _provider: vscode.RenameProvider;
476476

477-
constructor(documents: ExtHostDocuments, provider: vscode.RenameProvider2) {
477+
constructor(documents: ExtHostDocuments, provider: vscode.RenameProvider) {
478478
this._documents = documents;
479479
this._provider = provider;
480480
}

0 commit comments

Comments
 (0)