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

[JAVAVSCODE-71] Updated download.jdk command configuration to open JDK downloader window even if no folder is open in workspace #72

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

Achal1607
Copy link
Member

Earlier only if some Java project or Java file was open in the workspace then only jdk downloader command could be executed from the command palette. So, it's configuration has been updated so that it can be executed even if workspace is empty.

Closes #71

…dow even if no folder is open in workspace

Signed-off-by: Achal Talati <[email protected]>
@Achal1607 Achal1607 requested a review from lahodaj November 9, 2023 08:18
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 9, 2023
@@ -444,6 +444,10 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
throw `Client ${c} doesn't support new project`;
}
}));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_PREFIX + ".download.jdk", async () => {
let c : LanguageClient = await client;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder about the await client here - is that necessary? I think many other commands are waiting for the client (which I think in practice means "wait for the language server to come up, and connect to the language client embedded in the extension", but I can be wrong), as they actually use the language server. But this specific command runs without the server, and should even run when the server is unable to run (e.g. due to a missing JDK).

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I thought we need to wait for the language server but you are correct. So, I have updated the commit accordingly. Thanks.

@Achal1607 Achal1607 requested a review from lahodaj November 27, 2023 16:14
Copy link
Member

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

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

Looks OK to me.

Copy link
Member

@arvindaprameya arvindaprameya left a comment

Choose a reason for hiding this comment

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

LGTM

@arvindaprameya arvindaprameya merged commit 63339ea into oracle:main Nov 28, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command 'Download, install and use JDK' resulted in an error command 'jdk.download.jdk' not found
3 participants