From 61dbe8cc3ded88411fa3bb758dbc0feb4678cb9f Mon Sep 17 00:00:00 2001 From: Nicolas Borges Date: Tue, 17 Dec 2024 14:26:39 -0500 Subject: [PATCH] add UI notification to alert user of deprecated manifest version --- .../amazonq/lsp/manager/DefaultLspManager.java | 18 ++++++++++++++++++ .../eclipse/amazonq/util/Constants.java | 2 ++ 2 files changed, 20 insertions(+) diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/manager/DefaultLspManager.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/manager/DefaultLspManager.java index 33fd05a5..8ca90759 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/manager/DefaultLspManager.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/manager/DefaultLspManager.java @@ -14,6 +14,11 @@ import java.util.HashSet; import java.util.Optional; +import org.eclipse.swt.widgets.Display; +import software.aws.toolkits.eclipse.amazonq.util.Constants; +import software.aws.toolkits.eclipse.amazonq.util.ToolkitNotification; +import org.eclipse.mylyn.commons.ui.dialogs.AbstractNotificationPopup; + import software.aws.toolkits.eclipse.amazonq.exception.AmazonQPluginException; import software.aws.toolkits.eclipse.amazonq.lsp.manager.fetcher.ArtifactUtils; import software.aws.toolkits.eclipse.amazonq.lsp.manager.fetcher.LspFetcher; @@ -83,6 +88,10 @@ private LspInstallResult fetchLspInstallation() { } Manifest manifest = fetchManifest(); + if (manifest.isManifestDeprecated()) { + showDeprecatedManifestNotification(); + } + var platform = platformOverride != null ? platformOverride : PluginUtils.getPlatform(); var architecture = architectureOverride != null ? architectureOverride : PluginUtils.getArchitecture(); @@ -238,6 +247,15 @@ private static void makeExecutable(final Path filePath) throws IOException { PosixFilePermission.OTHERS_READ, PosixFilePermission.OTHERS_EXECUTE)); Files.setPosixFilePermissions(filePath, permissions); } + private static void showDeprecatedManifestNotification() { + Display.getDefault().asyncExec(() -> { + AbstractNotificationPopup notification = new ToolkitNotification( + Display.getDefault(), + Constants.MANIFEST_DEPRECATED_NOTIFICATION_TITLE, + Constants.MANIFEST_DEPRECATED_NOTIFICATION_BODY); + notification.open(); + }); + } public static class Builder { private String manifestUrl; diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/Constants.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/Constants.java index c8cbc518..f0946f2f 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/Constants.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/Constants.java @@ -19,6 +19,8 @@ private Constants() { public static final String LSP_CODE_REFERENCES_OPT_OUT_KEY = "includeSuggestionsWithCodeReferences"; public static final String IDE_CUSTOMIZATION_NOTIFICATION_TITLE = "Amazon Q Customization"; public static final String IDE_CUSTOMIZATION_NOTIFICATION_BODY_TEMPLATE = "Amazon Q inline suggestions are now coming from the %s"; + public static final String MANIFEST_DEPRECATED_NOTIFICATION_TITLE = "Amazon Q Manifest Version is Deprecated"; + public static final String MANIFEST_DEPRECATED_NOTIFICATION_BODY = "Current toolkit version will stop receiving updates. Please update the extension for continued support"; public static final String DEFAULT_Q_FOUNDATION_DISPLAY_NAME = "Amazon Q foundation (Default)"; public static final String LOGIN_TYPE_KEY = "LOGIN_TYPE"; public static final String LOGIN_IDC_PARAMS_KEY = "IDC_PARAMS";