Skip to content

Conversation

FluoriteCafe-work
Copy link
Contributor

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors extension dependency checking from a static initialization-time check to an on-demand approach. Instead of pre-checking if extensions are installed and setting context variables, the code now checks and prompts for extension installation when the related functionality is actually invoked.

  • Replaced static extension existence checks with dynamic on-demand checking
  • Added a utility function to handle extension checking, installation prompts, and fallback to manual enablement
  • Simplified command visibility conditions by removing the isModernizationExtensionInstalled context check

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/upgrade/utility.ts Added checkOrInstallExtension function to handle dynamic extension checking and installation prompts
src/upgrade/upgradeManager.ts Refactored to use on-demand extension checking instead of static checks and context setting
package.json Removed isModernizationExtensionInstalled condition from command visibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@wenytang-ms
Copy link
Contributor

why not just revert previous PR directly?


// Commands to be used
context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_UPGRADE_WITH_COPILOT, async (promptText?: string) => {
await checkOrInstallExtension(ExtensionName.APP_MODERNIZATION_UPGRADE_FOR_JAVA, ExtensionName.APP_MODERNIZATION_FOR_JAVA);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to confirm this part of design. So we still keep upgrade manager command, but you will check the installation of app mod extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes; the command depends on another command (javaupgrade.gotoAgentMode) which is provided by AppMod extension.

@FluoriteCafe-work FluoriteCafe-work marked this pull request as draft September 26, 2025 05:35
@FluoriteCafe-work
Copy link
Contributor Author

why not just revert previous PR directly?

@wenytang-ms because the feature can still be here without depending on other extensions - this PR is just modifying the parts that have hard dependency on AppMod extension.

@FluoriteCafe-work FluoriteCafe-work marked this pull request as ready for review September 26, 2025 06:55
@wenytang-ms
Copy link
Contributor

also update the package version to release, and changelog

@FluoriteCafe-work
Copy link
Contributor Author

also update the package version to release, and changelog

@wenytang-ms done in 39bc5bd, thanks!

@chagong
Copy link
Contributor

chagong commented Sep 26, 2025

The logic looks good to me. But we have lots of user facing strings for this feature, is it necessary to put them into package.nls.json? Which I think should be required for localization. Maybe @testforstephen can confirm.

@FluoriteCafe-work FluoriteCafe-work merged commit b8548d6 into microsoft:main Sep 26, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants