Skip to content

Conversation

tsmaeder
Copy link
Contributor

This adds a VS Code command that

  1. Opens a "Open Directory" dialog to select the root of a VM install
  2. Allows to select a "Known JRE Name" for the VM install
  3. If all goes well, adds an entry to the user settings

Copy link
Member

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

Seems mostly fine. Just be aware this overlaps with https://github.com/microsoft/vscode-java-pack/blob/main/src/java-runtime/index.ts and it probably would have been ideal to move that page here.

canSelectMany: false,
title: 'Select JDK Directory',
});
if (directory) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth validating the directory by at least checking ${directory}/bin/javac exists to ensure it's probably a valid JDK ?


export namespace JavaRuntimes {
export async function initialize(context: vscode.ExtensionContext): Promise<void> {
context.subscriptions.push(vscode.commands.registerCommand('java.runtimes.add', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

I'd probably add "java.runtimes.add" to Commands.

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.

2 participants