diff --git a/extensions/typescript-language-features/src/languageFeatures/quickFix.ts b/extensions/typescript-language-features/src/languageFeatures/quickFix.ts index 83f13a291a6..076ad1a5da4 100644 --- a/extensions/typescript-language-features/src/languageFeatures/quickFix.ts +++ b/extensions/typescript-language-features/src/languageFeatures/quickFix.ts @@ -20,10 +20,10 @@ import { applyCodeActionCommands, getEditForCodeAction } from './util/codeAction import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration'; type ApplyCodeActionCommand_args = { - readonly resource: vscode.Uri; + readonly document: vscode.TextDocument; readonly diagnostic: vscode.Diagnostic; readonly action: Proto.CodeFixAction; - readonly followupAction: (resource: vscode.Uri, diagnostic: vscode.Diagnostic, action: Proto.CodeFixAction, client: ITypeScriptServiceClient) => Promise | undefined; + readonly followupAction: (document: vscode.TextDocument, diagnostic: vscode.Diagnostic, action: Proto.CodeFixAction, client: ITypeScriptServiceClient) => Promise | undefined; }; class ApplyCodeActionCommand implements Command { @@ -36,7 +36,7 @@ class ApplyCodeActionCommand implements Command { private readonly telemetryReporter: TelemetryReporter, ) { } - public async execute({ resource, action, diagnostic, followupAction }: ApplyCodeActionCommand_args): Promise { + public async execute({ document, action, diagnostic, followupAction }: ApplyCodeActionCommand_args): Promise { /* __GDPR__ "quickFix.execute" : { "owner": "mjbvz", @@ -46,19 +46,14 @@ class ApplyCodeActionCommand implements Command { ] } */ - - console.log('resource : ', resource); - console.log('action : ', action); - console.log('diagnostic : ', diagnostic); - this.telemetryReporter.logTelemetry('quickFix.execute', { fixName: action.fixName }); - this.diagnosticManager.deleteDiagnostic(resource, diagnostic); + this.diagnosticManager.deleteDiagnostic(document.uri, diagnostic); const codeActionResult = await applyCodeActionCommands(this.client, action.commands, nulToken); if (followupAction) { - await followupAction(resource, diagnostic, action, this.client); + await followupAction(document, diagnostic, action, this.client); } return codeActionResult; } @@ -323,12 +318,12 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider { + private async classIncorrectlyImplementsInterfaceFollowupAction(document: vscode.TextDocument, diagnostic: vscode.Diagnostic, _action: Proto.CodeFixAction, client: ITypeScriptServiceClient): Promise { const findScopeEndLine = (startLine: number, navigationTree: Proto.NavigationTree[]): number => { for (const node of navigationTree) { @@ -342,42 +337,28 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider{ action: tsAction, diagnostic, resource, followupAction }], + arguments: [{ action: tsAction, diagnostic, document, followupAction }], title: '' }; return codeAction;