Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80490fa

Browse files
Customize launching connector to support cwd and enviroment variable (microsoft#119)
* Customize launching connector to support cwd and enviroment variable Signed-off-by: Jinbo Wang <[email protected]> * disable tslint rule for 'Interpolation will only work for template strings' error Signed-off-by: Jinbo Wang <[email protected]>
1 parent 6d47290 commit 80490fa

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
4848
- `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.
4949
- `vmArgs` - The extra options and system properties for the JVM (e.g. -Xms\<size\> -Xmx\<size\> -D\<name\>=\<value\>).
5050
- `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.
51+
- `cwd` - The working directory of the program.
52+
- `env` - The extra environment variables for the program.
5153

5254
### Attach
5355

package.json

+11
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@
9393
"type": "string",
9494
"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.",
9595
"default": "UTF-8"
96+
},
97+
"cwd": {
98+
"type": "string",
99+
"description": "The working directory of the program.",
100+
"default": "${workspaceFolder}"
101+
},
102+
"env": {
103+
"type": "object",
104+
"description": "The extra environment variables for the program.",
105+
"default": {}
96106
}
97107
}
98108
},
@@ -140,6 +150,7 @@
140150
"type": "java",
141151
"name": "Debug (Launch)",
142152
"request": "launch",
153+
"cwd": "^\"\\${workspaceFolder}\"",
143154
"mainClass": "",
144155
"args": ""
145156
}

src/configurationProvider.ts

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
3333
type: "java",
3434
name: this.constructLaunchConfigName(item.mainClass, item.projectName, cache),
3535
request: "launch",
36+
// tslint:disable-next-line
37+
cwd: "${workspaceFolder}",
3638
mainClass: item.mainClass,
3739
projectName: item.projectName,
3840
args: "",

0 commit comments

Comments
 (0)