From 2d000e803fc7b1c0ef49fc4b707a7630c7150660 Mon Sep 17 00:00:00 2001 From: FluoriteCafe-work <202210574+FluoriteCafe-work@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:30:51 +0800 Subject: [PATCH 1/6] chore: strings --- src/upgrade/upgradeManager.ts | 6 +++--- src/upgrade/utility.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/upgrade/upgradeManager.ts b/src/upgrade/upgradeManager.ts index 9808a3ac..e11c1149 100644 --- a/src/upgrade/upgradeManager.ts +++ b/src/upgrade/upgradeManager.ts @@ -11,7 +11,7 @@ import { Commands } from "../commands"; import notificationManager from "./display/notificationManager"; import { Settings } from "../settings"; import assessmentManager from "./assessmentManager"; -import { checkOrInstallAppModExtension, checkOrPromptToInstallAppModExtension } from "./utility"; +import { checkOrInstallAppModExtension, checkOrPopupToInstallAppModExtension } from "./utility"; const DEFAULT_UPGRADE_PROMPT = "Upgrade Java project dependency to latest version."; @@ -33,9 +33,9 @@ class UpgradeManager { // Show modernization view context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.VIEW_MODERNIZE_JAVA_PROJECT, async () => { - await checkOrPromptToInstallAppModExtension( + await checkOrPopupToInstallAppModExtension( ExtensionName.APP_MODERNIZATION_FOR_JAVA, - "Install GitHub Copilot app modernization to modernize the Java project.", + `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to modernize Java projects. Would you like to install it to modernize this project?`, "Install Extension and Modernize"); await commands.executeCommand("workbench.view.extension.azureJavaMigrationExplorer"); })); diff --git a/src/upgrade/utility.ts b/src/upgrade/utility.ts index b14bb81b..b99530c5 100644 --- a/src/upgrade/utility.ts +++ b/src/upgrade/utility.ts @@ -79,11 +79,11 @@ async function checkOrPromptToEnableAppModExtension() { return; } - // The extension is disabled if we cannot detect the extension after installing it. + // The extension is in a disabled state since we cannot detect the extension after installing it. await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA); const BTN_TEXT = "Show extension in sidebar"; const choice2 = await window.showInformationMessage( - `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is needed for the feature to work but it seems disabled. Please enable it manually and try again.`, + `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required for the feature but seems disabled. Please enable it manually and try again.`, BTN_TEXT ); if (choice2 === BTN_TEXT) { @@ -91,7 +91,7 @@ async function checkOrPromptToEnableAppModExtension() { } } -export async function checkOrPromptToInstallAppModExtension( +export async function checkOrPopupToInstallAppModExtension( extensionIdToCheck: string, notificationText: string, buttonText: string): Promise { @@ -99,7 +99,7 @@ export async function checkOrPromptToInstallAppModExtension( return; } - const choice = await window.showInformationMessage(notificationText, buttonText); + const choice = await window.showInformationMessage(notificationText, { modal: true }, buttonText); if (choice === buttonText) { await commands.executeCommand("workbench.extensions.installExtension", ExtensionName.APP_MODERNIZATION_FOR_JAVA); } else { From 9f2548663812f8b9df1b0b57b7c8018d2013e7de Mon Sep 17 00:00:00 2001 From: FluoriteCafe-work <202210574+FluoriteCafe-work@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:31:59 +0800 Subject: [PATCH 2/6] docs: CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02058291..d763d838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## 0.25.2 +- ux - Improve wording on project modernization by @FluoriteCafe-work in https://github.com/microsoft/vscode-java-dependency/pull/912 - ux - Check extension existence on-the-fly when needed by @FluoriteCafe-work in https://github.com/microsoft/vscode-java-dependency/pull/911 ## 0.25.0 From 9e8954b700f4c1f4e88ac874945b65f1448d9d56 Mon Sep 17 00:00:00 2001 From: Ray Sun <202210574+FluoriteCafe-work@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:36:21 +0800 Subject: [PATCH 3/6] chore: wording Co-authored-by: Miller Wang <69189193+wangmingliang-ms@users.noreply.github.com> --- src/upgrade/upgradeManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/upgrade/upgradeManager.ts b/src/upgrade/upgradeManager.ts index e11c1149..ad304720 100644 --- a/src/upgrade/upgradeManager.ts +++ b/src/upgrade/upgradeManager.ts @@ -35,7 +35,7 @@ class UpgradeManager { context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.VIEW_MODERNIZE_JAVA_PROJECT, async () => { await checkOrPopupToInstallAppModExtension( ExtensionName.APP_MODERNIZATION_FOR_JAVA, - `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to modernize Java projects. Would you like to install it to modernize this project?`, + `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to modernize Java projects. Would you like to install it and modernize this project?`, "Install Extension and Modernize"); await commands.executeCommand("workbench.view.extension.azureJavaMigrationExplorer"); })); From e26dfa36cd60a4e078e4d1e8af00fb0480e55e64 Mon Sep 17 00:00:00 2001 From: FluoriteCafe-work <202210574+FluoriteCafe-work@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:56:22 +0800 Subject: [PATCH 4/6] feat: pop-up on disabled extension --- src/upgrade/upgradeManager.ts | 6 +++--- src/upgrade/utility.ts | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/upgrade/upgradeManager.ts b/src/upgrade/upgradeManager.ts index ad304720..87fe3372 100644 --- a/src/upgrade/upgradeManager.ts +++ b/src/upgrade/upgradeManager.ts @@ -11,7 +11,7 @@ import { Commands } from "../commands"; import notificationManager from "./display/notificationManager"; import { Settings } from "../settings"; import assessmentManager from "./assessmentManager"; -import { checkOrInstallAppModExtension, checkOrPopupToInstallAppModExtension } from "./utility"; +import { checkOrInstallAppModExtensionForUpgrade, checkOrPopupToInstallAppModExtensionForModernization } from "./utility"; const DEFAULT_UPGRADE_PROMPT = "Upgrade Java project dependency to latest version."; @@ -26,14 +26,14 @@ class UpgradeManager { // Upgrade project context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_UPGRADE_WITH_COPILOT, async (promptText?: string) => { - await checkOrInstallAppModExtension(ExtensionName.APP_MODERNIZATION_UPGRADE_FOR_JAVA); + await checkOrInstallAppModExtensionForUpgrade(ExtensionName.APP_MODERNIZATION_UPGRADE_FOR_JAVA); const promptToUse = promptText ?? DEFAULT_UPGRADE_PROMPT; await commands.executeCommand(Commands.GOTO_AGENT_MODE, { prompt: promptToUse }); })); // Show modernization view context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.VIEW_MODERNIZE_JAVA_PROJECT, async () => { - await checkOrPopupToInstallAppModExtension( + await checkOrPopupToInstallAppModExtensionForModernization( ExtensionName.APP_MODERNIZATION_FOR_JAVA, `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to modernize Java projects. Would you like to install it and modernize this project?`, "Install Extension and Modernize"); diff --git a/src/upgrade/utility.ts b/src/upgrade/utility.ts index b99530c5..43c32a12 100644 --- a/src/upgrade/utility.ts +++ b/src/upgrade/utility.ts @@ -74,7 +74,7 @@ export function normalizePath(path: string): string { return Uri.parse(path).toString(); } -async function checkOrPromptToEnableAppModExtension() { +async function checkOrPromptToEnableAppModExtension(keyword: string) { if (extensions.getExtension(ExtensionName.APP_MODERNIZATION_FOR_JAVA)) { return; } @@ -83,7 +83,8 @@ async function checkOrPromptToEnableAppModExtension() { await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA); const BTN_TEXT = "Show extension in sidebar"; const choice2 = await window.showInformationMessage( - `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required for the feature but seems disabled. Please enable it manually and try again.`, + `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to ${keyword} Java projects but it seems disabled. Please enable it manually and try again.`, + { modal: true }, BTN_TEXT ); if (choice2 === BTN_TEXT) { @@ -91,7 +92,7 @@ async function checkOrPromptToEnableAppModExtension() { } } -export async function checkOrPopupToInstallAppModExtension( +export async function checkOrPopupToInstallAppModExtensionForModernization( extensionIdToCheck: string, notificationText: string, buttonText: string): Promise { @@ -106,15 +107,15 @@ export async function checkOrPopupToInstallAppModExtension( return; } - await checkOrPromptToEnableAppModExtension(); + await checkOrPromptToEnableAppModExtension("modernize"); } -export async function checkOrInstallAppModExtension( +export async function checkOrInstallAppModExtensionForUpgrade( extensionIdToCheck: string): Promise { if (extensions.getExtension(extensionIdToCheck)) { return; } await commands.executeCommand("workbench.extensions.installExtension", ExtensionName.APP_MODERNIZATION_FOR_JAVA); - await checkOrPromptToEnableAppModExtension(); + await checkOrPromptToEnableAppModExtension("upgrade"); } \ No newline at end of file From 3a57737ea5aa08a52c918b59b40e0724dbcc767c Mon Sep 17 00:00:00 2001 From: FluoriteCafe-work <202210574+FluoriteCafe-work@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:58:13 +0800 Subject: [PATCH 5/6] chore: telemetry for `extensionDisabled` event --- src/upgrade/utility.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/upgrade/utility.ts b/src/upgrade/utility.ts index 43c32a12..7ec3cce0 100644 --- a/src/upgrade/utility.ts +++ b/src/upgrade/utility.ts @@ -5,6 +5,7 @@ import { commands, extensions, Uri, window } from "vscode"; import * as semver from "semver"; import { UpgradeReason, type UpgradeIssue } from "./type"; import { ExtensionName, Upgrade } from "../constants"; +import { instrumentOperation } from "vscode-extension-telemetry-wrapper"; function findEolDate(currentVersion: string, eolDate: Record): string | null { @@ -80,16 +81,18 @@ async function checkOrPromptToEnableAppModExtension(keyword: string) { } // The extension is in a disabled state since we cannot detect the extension after installing it. - await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA); - const BTN_TEXT = "Show extension in sidebar"; - const choice2 = await window.showInformationMessage( - `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to ${keyword} Java projects but it seems disabled. Please enable it manually and try again.`, - { modal: true }, - BTN_TEXT - ); - if (choice2 === BTN_TEXT) { + await instrumentOperation("java.dependency.extensionDisabled", async () => { await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA); - } + const BTN_TEXT = "Show extension in sidebar"; + const choice2 = await window.showInformationMessage( + `${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension is required to ${keyword} Java projects but it seems disabled. Please enable it manually and try again.`, + { modal: true }, + BTN_TEXT + ); + if (choice2 === BTN_TEXT) { + await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA); + } + })() } export async function checkOrPopupToInstallAppModExtensionForModernization( From 3765bfda603ba547dd250ac5db37e6e3a0b0ec04 Mon Sep 17 00:00:00 2001 From: FluoriteCafe-work <202210574+FluoriteCafe-work@users.noreply.github.com> Date: Fri, 26 Sep 2025 16:04:02 +0800 Subject: [PATCH 6/6] chore: lint --- src/upgrade/utility.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/upgrade/utility.ts b/src/upgrade/utility.ts index 7ec3cce0..09588801 100644 --- a/src/upgrade/utility.ts +++ b/src/upgrade/utility.ts @@ -92,7 +92,7 @@ async function checkOrPromptToEnableAppModExtension(keyword: string) { if (choice2 === BTN_TEXT) { await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA); } - })() + })(); } export async function checkOrPopupToInstallAppModExtensionForModernization(