Skip to content

Commit

Permalink
rename it to prepareRename, #48700
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Apr 26, 2018
1 parent 39748bd commit 6f4d130
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2764,7 +2764,7 @@ declare module 'vscode' {
* @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<Range | { range: Range, placeholder: string }>;
prepareRename?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Range | { range: Range, placeholder: string }>;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/api/node/extHostLanguageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ class NavigateTypeAdapter {
class RenameAdapter {

static supportsResolving(provider: vscode.RenameProvider): boolean {
return typeof provider.resolveRenameLocation === 'function';
return typeof provider.prepareRename === 'function';
}

private _documents: ExtHostDocuments;
Expand Down Expand Up @@ -511,14 +511,14 @@ class RenameAdapter {
}

resolveRenameLocation(resource: URI, position: IPosition): TPromise<modes.RenameLocation> {
if (typeof this._provider.resolveRenameLocation !== 'function') {
if (typeof this._provider.prepareRename !== 'function') {
return TPromise.as(undefined);
}

let doc = this._documents.getDocumentData(resource).document;
let pos = TypeConverters.toPosition(position);

return asWinJsPromise(token => this._provider.resolveRenameLocation(doc, pos, token)).then(rangeOrLocation => {
return asWinJsPromise(token => this._provider.prepareRename(doc, pos, token)).then(rangeOrLocation => {

let range: vscode.Range;
let text: string;
Expand Down

0 comments on commit 6f4d130

Please sign in to comment.