-
Notifications
You must be signed in to change notification settings - Fork 874
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
Supporting source file launcher in VS Code extension #6262
Conversation
if (!(argumentsObject instanceof String)) { | ||
return null; | ||
} | ||
return Arrays.asList(((String) argumentsObject).trim().split(" ")); //NOI18N |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe handle possible escaping (`BaseUtilities.parseParameters ?)
compileClassPathImplementation.setDelegates(spec2CP(classpath)); | ||
compileModulePathImplementation.setDelegates(spec2CP(modulepath)); | ||
|
||
System.err.println("compileClassPath: " + compileClassPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging leftovers
case "--module-path": case "-p": | ||
modulepath = parameter; | ||
break; | ||
case "--source": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also -source
with 1 dash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but I don't think it should be here - these are source launcher options (as opposed to javac options), and source launcher does not support -source
.
String sourceLevel = SourceLevelResultImpl.DEFAULT_SL; | ||
|
||
for (int i = 0; i < newOptions.size(); i++) { | ||
if (i + 1 >= newOptions.size()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe limit the loop to just newOptions.size() -1
?
} | ||
|
||
if (compilerArgs.contains(SOURCE_FLAG)) { | ||
compilerArgs = m.replaceAll("--enable-preview " + SOURCE_FLAG + " " + realNewSourceLevel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the constant ENABLE_PREVIEW_FLAG
?
This looks good, thank you for making this change! Appoved |
bc9417f
to
42caa8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine. Thanks.
(Single) source file launcher support has multiple problems inside VS Code - especially settings that are inside NetBeans done through file attributes are not accessible. This patch attempts to use the Run Configuration tab/settings to provide options for launching the single file. The same options are also parsed for use in the editor.
^Add meaningful description above
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log
) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.