Skip to content

Commit 7134037

Browse files
authored
Add metrics for change jdk action (#1274)
Signed-off-by: Sheng Chen <[email protected]>
1 parent a55527d commit 7134037

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/classpath/classpathConfigurationView.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,13 @@ const setOutputPath = instrumentOperation("classpath.setOutputPath", async (oper
346346
}
347347
});
348348

349-
const changeJdk = instrumentOperation("classpath.changeJdk", async (_operationId: string, currentProjectRoot: vscode.Uri, jdkPath: string) => {
349+
const changeJdk = instrumentOperation("classpath.changeJdk", async (operationId: string, currentProjectRoot: vscode.Uri, jdkPath: string) => {
350+
const actionResult: Record<string, string> = {
351+
name: "classpath.configuration",
352+
kind: "use-existing-jdk"
353+
};
350354
if (jdkPath === "add-new-jdk") {
355+
actionResult.kind = "add-new-jdk";
351356
const javaHome: vscode.Uri[] | undefined = await vscode.window.showOpenDialog({
352357
defaultUri: vscode.workspace.workspaceFolders?.[0].uri,
353358
openLabel: "Select JDK Home",
@@ -367,6 +372,11 @@ const changeJdk = instrumentOperation("classpath.changeJdk", async (_operationId
367372
currentProjectRoot.toString(),
368373
jdkPath
369374
);
375+
376+
actionResult.message = result.message;
377+
actionResult.code = result.success ? "0" : "1";
378+
sendInfo(operationId, actionResult);
379+
370380
if (result.success) {
371381
const activeVmInstallPath = result.message;
372382
let vmInstalls: VmInstall[] = await getVmInstallsFromLS();

0 commit comments

Comments
 (0)