|
1 | 1 | // Copyright (c) Microsoft Corporation. All rights reserved.
|
2 | 2 | // Licensed under the MIT license.
|
3 | 3 |
|
4 |
| -import { commands, type ExtensionContext, workspace, type WorkspaceFolder } from "vscode"; |
| 4 | +import { commands, type ExtensionContext, extensions, workspace, type WorkspaceFolder } from "vscode"; |
5 | 5 | import * as semver from 'semver'
|
6 | 6 | import { Jdtls } from "../java/jdtls";
|
7 | 7 | import { languageServerApiManager } from "../languageServerApi/languageServerApiManager";
|
8 | 8 | import { NodeKind, type INodeData } from "../java/nodeData";
|
9 |
| -import { Upgrade } from "../constants"; |
| 9 | +import { ExtensionName, Upgrade } from "../constants"; |
10 | 10 | import { UpgradeIssue, UpgradeReason } from "./type";
|
11 | 11 | import { instrumentOperationAsVsCodeCommand } from "vscode-extension-telemetry-wrapper";
|
12 | 12 | import { Commands } from "../commands";
|
@@ -91,6 +91,8 @@ class UpgradeManager {
|
91 | 91 | context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.VIEW_TRIGGER_JAVA_UPGRADE_TOOL, (promptText?: string) => {
|
92 | 92 | this.runUpgrade(promptText ?? DEFAULT_UPGRADE_PROMPT);
|
93 | 93 | }));
|
| 94 | + commands.executeCommand('setContext', 'isModernizationExtensionInstalled', |
| 95 | + !!extensions.getExtension(ExtensionName.APP_MODERNIZATION_FOR_JAVA)); |
94 | 96 | context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.VIEW_MODERNIZE_JAVA_PROJECT, () => {
|
95 | 97 | commands.executeCommand("workbench.view.extension.azureJavaMigrationExplorer");
|
96 | 98 | }));
|
|
0 commit comments