Skip to content

Commit 95df7a8

Browse files
committed
Refactor extension API calls
1 parent 6c7856d commit 95df7a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/extension.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import * as vscode from 'vscode';
66
export async function activate(context: vscode.ExtensionContext) {
77
// We call vscode-kotlin's API to fetch the build output path.
88
// Note that this code is only executed after vscode-kotlin is setup, so the API should be ready to receive requests.
9-
const vscodekotlinApi = vscode.extensions.getExtension('fwcd.kotlin').exports as ExtensionAPI;
9+
const vscodeKotlinApi = vscode.extensions.getExtension('fwcd.kotlin').exports as ExtensionAPI;
1010

11+
console.log(vscodeKotlinApi)
1112
// Execute a java workspace command to update the kotlin build output path. This triggers a classpath change on the JDT language server.
12-
await vscode.commands.executeCommand("java.execute.workspaceCommand", "kotlin.java.setKotlinBuildOutput", vscodekotlinApi.getBuildOutputPath());
13+
await vscode.commands.executeCommand("java.execute.workspaceCommand", "kotlin.java.setKotlinBuildOutput", vscodeKotlinApi.buildOutputPath);
1314
}
1415

1516
// vscode-kotlin API stub.
1617
interface ExtensionAPI {
17-
getBuildOutputPath(): string;
18-
}
18+
buildOutputPath: string;
19+
}

0 commit comments

Comments
 (0)