diff --git a/extensions/html/server/src/modes/javascriptMode.ts b/extensions/html/server/src/modes/javascriptMode.ts
index 73dc3a67228..59e4b0bb569 100644
--- a/extensions/html/server/src/modes/javascriptMode.ts
+++ b/extensions/html/server/src/modes/javascriptMode.ts
@@ -84,7 +84,7 @@ export function getJavascriptMode(documentRegions: LanguageModelCache {
+ public async execute(_file: string, codeActions: CodeAction[]): Promise {
if (codeActions.length === 0) {
return true;
}
if (codeActions.length === 1) {
- return applyCodeAction(this.client, codeActions[0], file);
+ return applyCodeAction(this.client, codeActions[0]);
}
interface MyQuickPickItem extends QuickPickItem {
@@ -165,7 +165,7 @@ class ApplyCompletionCodeActionCommand implements Command {
if (!action) {
return false;
}
- return applyCodeAction(this.client, action, file);
+ return applyCodeAction(this.client, action);
}
}
@@ -250,10 +250,10 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
}
try {
- const args = {
+ const args: CompletionsRequestArgs = {
...vsPositionToTsFileLocation(file, position),
includeExternalModuleExports: config.autoImportSuggestions
- } as CompletionsRequestArgs;
+ };
const msg = await this.client.execute('completions', args, token);
// This info has to come from the tsserver. See https://github.com/Microsoft/TypeScript/issues/2831
// let isMemberCompletion = false;
diff --git a/extensions/typescript/src/utils/codeAction.ts b/extensions/typescript/src/utils/codeAction.ts
index f7a22c10aec..e3fc0178af1 100644
--- a/extensions/typescript/src/utils/codeAction.ts
+++ b/extensions/typescript/src/utils/codeAction.ts
@@ -29,8 +29,7 @@ export function getEditForCodeAction(
export async function applyCodeAction(
client: ITypeScriptServiceClient,
- action: Proto.CodeAction,
- file: string
+ action: Proto.CodeAction
): Promise {
const workspaceEdit = getEditForCodeAction(client, action);
if (workspaceEdit) {
@@ -38,17 +37,16 @@ export async function applyCodeAction(
return false;
}
}
- return applyCodeActionCommands(client, action, file);
+ return applyCodeActionCommands(client, action);
}
export async function applyCodeActionCommands(
client: ITypeScriptServiceClient,
- action: Proto.CodeAction,
- file: string
+ action: Proto.CodeAction
): Promise {
if (action.commands && action.commands.length) {
for (const command of action.commands) {
- const response = await client.execute('applyCodeActionCommand', { file, command });
+ const response = await client.execute('applyCodeActionCommand', { command });
if (!response || !response.body) {
return false;
}