mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
Pick up support for TS's new triggerSpan property on rename
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user