Customize launching connector to support cwd and enviroment variable (#119)

* Customize launching connector to support cwd and enviroment variable

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

* disable tslint rule for 'Interpolation will only work for template strings' error

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
This commit is contained in:
Jinbo Wang 2017-11-01 09:45:25 +08:00 committed by GitHub
parent 6d47290b3c
commit 80490fa150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -48,6 +48,8 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
- `encoding` - The `file.encoding` setting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.
- `vmArgs` - The extra options and system properties for the JVM (e.g. -Xms\<size\> -Xmx\<size\> -D\<name\>=\<value\>).
- `projectName` - The preferred project in which the debugger searches for classes. There could be duplicated class names in different projects. This setting also works when the debugger looks for the specified main class when launching a program.
- `cwd` - The working directory of the program.
- `env` - The extra environment variables for the program.
### Attach

View File

@ -93,6 +93,16 @@
"type": "string",
"description": "The file.encoding setting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.",
"default": "UTF-8"
},
"cwd": {
"type": "string",
"description": "The working directory of the program.",
"default": "${workspaceFolder}"
},
"env": {
"type": "object",
"description": "The extra environment variables for the program.",
"default": {}
}
}
},
@ -140,6 +150,7 @@
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"cwd": "^\"\\${workspaceFolder}\"",
"mainClass": "",
"args": ""
}

View File

@ -33,6 +33,8 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
type: "java",
name: this.constructLaunchConfigName(item.mainClass, item.projectName, cache),
request: "launch",
// tslint:disable-next-line
cwd: "${workspaceFolder}",
mainClass: item.mainClass,
projectName: item.projectName,
args: "",