mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
also quick rename type parameters, ignore declare only things
This commit is contained in:
@@ -14,7 +14,7 @@ import * as typeConverters from '../utils/typeConverters';
|
||||
class TypeScriptOnTypeRenameProvider implements vscode.OnTypeRenameProvider {
|
||||
|
||||
private static enabledKinds = new Set<string>([
|
||||
Kind.let, Kind.const, Kind.localVariable, Kind.parameter
|
||||
Kind.let, Kind.const, Kind.localVariable, Kind.parameter, Kind.typeParameter
|
||||
]);
|
||||
|
||||
public constructor(
|
||||
@@ -52,6 +52,9 @@ class TypeScriptOnTypeRenameProvider implements vscode.OnTypeRenameProvider {
|
||||
}
|
||||
|
||||
const ranges = renameResponse.body.locs[0].locs.map(typeConverters.Range.fromTextSpan);
|
||||
if (ranges.length <= 1) {
|
||||
return undefined; // not enough usages
|
||||
}
|
||||
return new vscode.OnTypeRenameRanges(ranges);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user