parent
09afa054ee
commit
f516d17267
1 changed files with 10 additions and 2 deletions
|
@ -11,6 +11,13 @@ import { ITypeScriptServiceClient, ServerResponse } from '../typescriptService';
|
|||
import API from '../utils/api';
|
||||
import * as typeConverters from '../utils/typeConverters';
|
||||
|
||||
// TODO: Remove when we pick up TS 3.2
|
||||
declare module '../protocol' {
|
||||
interface RenameTextSpan extends TextSpan {
|
||||
readonly prefixText?: string;
|
||||
readonly suffixText?: string;
|
||||
}
|
||||
}
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
|
@ -102,8 +109,9 @@ class TypeScriptRenameProvider implements vscode.RenameProvider {
|
|||
for (const spanGroup of locations) {
|
||||
const resource = this.client.toResource(spanGroup.file);
|
||||
if (resource) {
|
||||
for (const textSpan of spanGroup.locs) {
|
||||
edit.replace(resource, typeConverters.Range.fromTextSpan(textSpan), newName);
|
||||
for (const textSpan of spanGroup.locs as Proto.RenameTextSpan[]) {
|
||||
edit.replace(resource, typeConverters.Range.fromTextSpan(textSpan),
|
||||
(textSpan.prefixText || '') + newName + (textSpan.suffixText || ''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue