Skip to content

Conversation

@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Feb 14, 2019

Signed-off-by: Jinbo Wang jinbwan@microsoft.com

Fix the bug #110.

Add a new config shortenCommandLine in launch.json to handle long classpath cases. The possible values are none/jarmanifest/argfile.

Peer PR on java-debug side: microsoft/java-debug#253

Closes #110

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Copy link
Member

@Eskibear Eskibear left a comment

Choose a reason for hiding this comment

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

LGTM

- `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]'.
Copy link
Member

Choose a reason for hiding this comment

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

Add 'auto' as the default value to unblock majority of use cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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>
README.md Outdated
- `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`.
Copy link
Contributor

@yaohaizh yaohaizh Feb 18, 2019

Choose a reason for hiding this comment

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

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.

package.json Outdated
"shortenCommandLine": {
"type": "string",
"enum": [
"auto",
Copy link
Contributor

Choose a reason for hiding this comment

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

sequence: none should be put above auto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there any explanation why need to sort the sequence like this?

Copy link
Contributor

Choose a reason for hiding this comment

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

none is consistent with the original semantic

package.nls.json Outdated
"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.",
Copy link
Contributor

Choose a reason for hiding this comment

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

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

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> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the third place that we need parse/check java version. Please work with @Eskibear & @jdneo for how we can consolidate this part logic together or put in the vscode java API part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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") {
Copy link
Contributor

Choose a reason for hiding this comment

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

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>
@testforstephen
Copy link
Contributor Author

@akaroml @yaohaizh PR updated.

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
@testforstephen testforstephen merged commit 7abda57 into master Feb 21, 2019
@testforstephen testforstephen deleted the jinbo_cli branch February 21, 2019 06:53
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.

5 participants