mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 19:59:37 +00:00
Fix compile for current TS version
This commit is contained in:
@@ -298,7 +298,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
|
|||||||
}
|
}
|
||||||
this.formattingOptionsManager.ensureConfigurationForDocument(document, token);
|
this.formattingOptionsManager.ensureConfigurationForDocument(document, token);
|
||||||
|
|
||||||
const args: Proto.GetApplicableRefactorsRequestArgs = {
|
const args: Proto.GetApplicableRefactorsRequestArgs & { kind?: string } = {
|
||||||
...typeConverters.Range.toFileRangeRequestArgs(file, rangeOrSelection),
|
...typeConverters.Range.toFileRangeRequestArgs(file, rangeOrSelection),
|
||||||
triggerReason: this.toTsTriggerReason(context),
|
triggerReason: this.toTsTriggerReason(context),
|
||||||
kind: context.only?.value
|
kind: context.only?.value
|
||||||
@@ -385,8 +385,8 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static getKind(refactor: Proto.RefactorActionInfo) {
|
private static getKind(refactor: Proto.RefactorActionInfo) {
|
||||||
if (refactor.kind) {
|
if ((refactor as Proto.RefactorActionInfo & { kind?: string }).kind) {
|
||||||
return vscode.CodeActionKind.Empty.append(refactor.kind);
|
return vscode.CodeActionKind.Empty.append((refactor as Proto.RefactorActionInfo & { kind?: string }).kind!);
|
||||||
}
|
}
|
||||||
const match = allKnownCodeActionKinds.find(kind => kind.matches(refactor));
|
const match = allKnownCodeActionKinds.find(kind => kind.matches(refactor));
|
||||||
return match ? match.kind : vscode.CodeActionKind.Refactor;
|
return match ? match.kind : vscode.CodeActionKind.Refactor;
|
||||||
|
|||||||
Reference in New Issue
Block a user