Skip to content

Commit

Permalink
New launch config to start & wait for debugger
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon authored and xorye committed Jun 5, 2020
1 parent e01d3e0 commit fabcf75
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
"preLaunchTask": "npm: watch"
},
{
"name": "Launch Extension & Wait for remote debugger",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
"preLaunchTask": "npm: watch",
"env": {
"SUSPEND_SERVER":"true"
}
},
{
"name": "Launch Tests",
"type": "extensionHost",
Expand Down
8 changes: 5 additions & 3 deletions src/javaServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ export function prepareExecutable(requirements: RequirementsData, xmlJavaExtensi
function prepareParams(requirements: RequirementsData, xmlJavaExtensions: string[], context: ExtensionContext): string[] {
let params: string[] = [];
if (DEBUG) {
params.push('-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1054,quiet=y');
// suspend=y is the default. Use this form if you need to debug the server startup code:
//params.push('-agentlib:jdwp=transport=dt_socket,server=y,address=1054');
if (process.env['SUSPEND_SERVER'] === 'true') {
params.push('-agentlib:jdwp=transport=dt_socket,server=y,address=1054');
} else {
params.push('-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1054,quiet=y');
}
}
let vmargsCheck = workspace.getConfiguration().inspect(xmlServerVmargs).workspaceValue;
if (vmargsCheck !== undefined) {
Expand Down

0 comments on commit fabcf75

Please sign in to comment.