Skip to content

Commit

Permalink
Fix compile for current TS version
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Jan 5, 2021
1 parent 3ed300e commit a48ef56
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
}
this.formattingOptionsManager.ensureConfigurationForDocument(document, token);

const args: Proto.GetApplicableRefactorsRequestArgs = {
const args: Proto.GetApplicableRefactorsRequestArgs & { kind?: string } = {
...typeConverters.Range.toFileRangeRequestArgs(file, rangeOrSelection),
triggerReason: this.toTsTriggerReason(context),
kind: context.only?.value
Expand Down Expand Up @@ -385,8 +385,8 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
}

private static getKind(refactor: Proto.RefactorActionInfo) {
if (refactor.kind) {
return vscode.CodeActionKind.Empty.append(refactor.kind);
if ((refactor as Proto.RefactorActionInfo & { kind?: string }).kind) {
return vscode.CodeActionKind.Empty.append((refactor as Proto.RefactorActionInfo & { kind?: string }).kind!);
}
const match = allKnownCodeActionKinds.find(kind => kind.matches(refactor));
return match ? match.kind : vscode.CodeActionKind.Refactor;
Expand Down

0 comments on commit a48ef56

Please sign in to comment.