Support environment variable for port number in launch.json debug configuration (#984)

This commit is contained in:
Jinbo Wang 2021-04-22 09:41:54 +08:00 committed by GitHub
parent 21c9f1ab4f
commit bed2489f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -403,7 +403,7 @@
"description": "%java.debugger.attach.hostName.description%"
},
"port": {
"type": "number",
"type": ["number", "string"],
"description": "%java.debugger.attach.port.description%"
},
"processId": {

View File

@ -313,7 +313,8 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
}
}
} else if (config.request === "attach") {
if (config.hostName && config.port) {
if (config.hostName && config.port && Number.isInteger(Number(config.port))) {
config.port = Number(config.port);
config.processId = undefined;
// Continue if the hostName and port are configured.
} else if (config.processId !== undefined) {