Skip to content

Commit

Permalink
add UI notification to alert user of deprecated manifest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Borges committed Dec 17, 2024
1 parent 7d0945c commit 61dbe8c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 61dbe8c

Please sign in to comment.