Provide jarmanifest/argfile approachs to shorten the command line#532
Conversation
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
| - `integratedTerminal` - VS Code integrated terminal. | ||
| - `externalTerminal` - External terminal that can be configured in user settings. | ||
| - `shortenCommandLine` - The specified command line style to launch the program. Defaults to `none`. | ||
| - `none` - Launch the program with the standard command line 'java [options] classname [args]'. |
There was a problem hiding this comment.
Add 'auto' as the default value to unblock majority of use cases.
There was a problem hiding this comment.
A new PR microsoft/java-debug#254 on java-debug to help compute the launch command length.
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
| - `internalConsole` - VS Code debug console (input stream not supported). | ||
| - `integratedTerminal` - VS Code integrated terminal. | ||
| - `externalTerminal` - External terminal that can be configured in user settings. | ||
| - `shortenCommandLine` - The specified command line style to launch the program. Defaults to `auto`. |
There was a problem hiding this comment.
Should provide background for this option. In most case, user should not care about this issue. Or add a trouble shooting section for this problem.
| "shortenCommandLine": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "auto", |
There was a problem hiding this comment.
sequence: none should be put above auto
There was a problem hiding this comment.
Is there any explanation why need to sort the sequence like this?
There was a problem hiding this comment.
none is consistent with the original semantic
| "java.debugger.launch.integratedTerminal.description": "VS Code integrated terminal.", | ||
| "java.debugger.launch.externalTerminal.description": "External terminal that can be configured in user settings.", | ||
| "java.debugger.launch.console.description": "The specified console to launch the program.", | ||
| "java.debugger.launch.shortenCommandLine.auto": "Auto detect the command line length and determine whether to shorten the command line via the appropriate approach.", |
There was a problem hiding this comment.
Auto ==> "Automatically"
Should use full word in the description section. Auto standalone means car...
the ==> an
| config.vmArgs = this.concatArgs(config.vmArgs); | ||
| } | ||
|
|
||
| await populateShortenCommandLineField(config); |
There was a problem hiding this comment.
Does this only apply to the launch scenario? If so, it should come together with the launch logic section.
| } | ||
| } | ||
|
|
||
| function checkJavaVersion(javaHome: string): Promise<number> { |
There was a problem hiding this comment.
agree. but prefer to do it with a new PR when the change in vscode-java is ready.
| const javaHome = await getJavaHome(); | ||
| const javaVersion = await checkJavaVersion(javaHome); | ||
| const recommendedApproach = javaVersion <= 8 ? shortenApproach.jarmanifest : shortenApproach.argfile; | ||
| if (config.console === "internalConsole") { |
There was a problem hiding this comment.
If this command current for Windows, please add a logic such as os.platform == 'win32` to filter where this code applies
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang jinbwan@microsoft.com
Fix the bug #110.
Add a new config
shortenCommandLinein launch.json to handle long classpath cases. The possible values arenone/jarmanifest/argfile.Peer PR on java-debug side: microsoft/java-debug#253
Closes #110