Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/upgrade/upgradeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.";

Expand All @@ -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 and modernize this project?`,
"Install Extension and Modernize");
await commands.executeCommand("workbench.view.extension.azureJavaMigrationExplorer");
}));
Expand Down
8 changes: 4 additions & 4 deletions src/upgrade/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,27 @@ 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.`,
Comment thread
FluoriteCafe-work marked this conversation as resolved.
Outdated
BTN_TEXT
);
if (choice2 === BTN_TEXT) {
await commands.executeCommand("workbench.extensions.search", ExtensionName.APP_MODERNIZATION_FOR_JAVA);
}
}

export async function checkOrPromptToInstallAppModExtension(
export async function checkOrPopupToInstallAppModExtension(
extensionIdToCheck: string,
notificationText: string,
buttonText: string): Promise<void> {
if (extensions.getExtension(extensionIdToCheck)) {
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 {
Expand Down
Loading