Skip to content

Commit 3a57737

Browse files
chore: telemetry for extensionDisabled event
1 parent e26dfa3 commit 3a57737

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/upgrade/utility.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { commands, extensions, Uri, window } from "vscode";
55
import * as semver from "semver";
66
import { UpgradeReason, type UpgradeIssue } from "./type";
77
import { ExtensionName, Upgrade } from "../constants";
8+
import { instrumentOperation } from "vscode-extension-telemetry-wrapper";
89

910

1011
function findEolDate(currentVersion: string, eolDate: Record<string, string>): string | null {
@@ -80,16 +81,18 @@ async function checkOrPromptToEnableAppModExtension(keyword: string) {
8081
}
8182

8283
// The extension is in a disabled state since we cannot detect the extension after installing it.
83-
await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA);
84-
const BTN_TEXT = "Show extension in sidebar";
85-
const choice2 = await window.showInformationMessage(
86-
`${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to ${keyword} Java projects but it seems disabled. Please enable it manually and try again.`,
87-
{ modal: true },
88-
BTN_TEXT
89-
);
90-
if (choice2 === BTN_TEXT) {
84+
await instrumentOperation("java.dependency.extensionDisabled", async () => {
9185
await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA);
92-
}
86+
const BTN_TEXT = "Show extension in sidebar";
87+
const choice2 = await window.showInformationMessage(
88+
`${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to ${keyword} Java projects but it seems disabled. Please enable it manually and try again.`,
89+
{ modal: true },
90+
BTN_TEXT
91+
);
92+
if (choice2 === BTN_TEXT) {
93+
await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA);
94+
}
95+
})()
9396
}
9497

9598
export async function checkOrPopupToInstallAppModExtensionForModernization(

0 commit comments

Comments
 (0)