Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch customizations from LSP server #43

Merged
merged 5 commits into from
Oct 4, 2024
Merged

Conversation

pras0131
Copy link
Contributor

@pras0131 pras0131 commented Oct 1, 2024

Reference ticket: https://issues.amazon.com/issues/ECLIPSE-296

The PR aims to fetch customizations from the LSP server and removing the hardcoded customizations.
There is also a change in one of the conditions to save the preference - if someone has selected customization radio button but no customizations are available, then do not save the preference.

@pras0131 pras0131 requested a review from breedloj October 1, 2024 14:46
@@ -26,4 +34,17 @@ public static void triggerChangeConfigurationNotification(final Map<String, Obje
}
}

public static CompletableFuture<List<Customization>> listCustomizations() {
GetConfigurationFromServerParams params = new GetConfigurationFromServerParams();
params.setSection("aws.q");
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry not too familiar with the params yet. Where are these sections defined? I don't see them in the high level manifests / plugin.xml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see.

@@ -64,7 +72,6 @@ public void fill(final Menu menu, final int index) {
@Override
public void widgetSelected(final SelectionEvent e) {
CustomizationDialog dialog = new CustomizationDialog(shell);
// TODO: This mock will be replaced by an actual call to LSP
dialog.setCustomisationResponse(getCustomizations());
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: customisation -> customization. keep it consistent

customizations.add(new Customization("customization-arn-2", "Customization 2", "Code Whisperer customization 2"));
customizations.add(new Customization("customization-arn-3", "Customization 3", "Code Whisperer customization 3"));
try {
customizations = CustomizationUtil.listCustomizations().get();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way to make this populate asynchronously? This would block the UI thread, no?

Copy link
Contributor Author

@pras0131 pras0131 Oct 4, 2024

Choose a reason for hiding this comment

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

nice catch! I updated the code to fetch the customizations async and not block the UI thread to open the dialog.

@breedloj breedloj merged commit 341fd78 into main Oct 4, 2024
1 check passed
@breedloj breedloj deleted the paras/fetchCustomizations branch October 4, 2024 22:25
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