提交 0aaa7c9d 编写于 作者: M Matt Bierner

Pick up support for TS's new triggerSpan property on rename

上级 63c5c748
......@@ -6,6 +6,7 @@
import * as vscode from 'vscode';
import * as Proto from '../protocol';
import { ITypeScriptServiceClient } from '../typescriptService';
import API from '../utils/api';
import * as typeConverters from '../utils/typeConverters';
......@@ -28,6 +29,14 @@ class TypeScriptRenameProvider implements vscode.RenameProvider {
if (!renameInfo.canRename) {
return Promise.reject<vscode.Range>(renameInfo.localizedErrorMessage);
}
if (this.client.apiVersion.gte(API.v310)) {
const triggerSpan = (renameInfo as any).triggerSpan;
if (triggerSpan) {
return typeConverters.Range.fromTextSpan(triggerSpan);
}
}
return null;
}
......
......@@ -30,6 +30,7 @@ export default class API {
public static readonly v291 = API.fromSimpleString('2.9.1');
public static readonly v292 = API.fromSimpleString('2.9.2');
public static readonly v300 = API.fromSimpleString('3.0.0');
public static readonly v310 = API.fromSimpleString('3.1.0');
public static fromVersionString(versionString: string): API {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册