Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 8b5fcfe

Browse files
mkenne11vlad-shatskyi
authored andcommitted
Vscode debug doc changes for config files (#1200)
Changes made to vscode debug instructions including: - Updated "tasks.json" to version 2.0.0 format. - Compile task references the default "compile" script from package.json. - Updated "launch.json" to specify Windows path for "runtimeExecutable" parameters.
1 parent d4fcf37 commit 8b5fcfe

File tree

2 files changed

+37
-15
lines changed

2 files changed

+37
-15
lines changed

docs/images/launch_task_prestart.png

939 Bytes
Loading

docs/vscodedebugging.md

+37-15
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ The contents of these files should be as follows.
3333
"type": "node",
3434
"request": "launch",
3535
"name": "Electron Main",
36+
// Mac OS & Linux process runtime executable
3637
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
38+
"windows": {
39+
// Windows process runtime executable
40+
"runtimeExecutable": "${workspaceRoot}\\node_modules\\.bin\\electron.cmd"
41+
},
3742
"program": "${workspaceRoot}/compiled/src/main/Main.js",
3843
"protocol": "inspector",
3944
"stopOnEntry": false,
@@ -54,7 +59,12 @@ The contents of these files should be as follows.
5459
"name": "Debug renderer process",
5560
"type": "chrome",
5661
"request": "launch",
62+
// Mac OS & Linux process runtime executable
5763
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
64+
"windows": {
65+
// Windows process runtime executable
66+
"runtimeExecutable": "${workspaceRoot}\\node_modules\\.bin\\electron.cmd"
67+
},
5868
"runtimeArgs": [
5969
"${workspaceRoot}/",
6070
"--enable-logging",
@@ -67,28 +77,38 @@ The contents of these files should be as follows.
6777
]
6878
}
6979
```
70-
Note. On Windows the `runtimeExecutable` parameter should be changed to:
71-
`${workspaceRoot}/node_modules/.bin/electron.cmd`
7280

7381
<b>b. tasks.json</b>
7482
```
7583
{
76-
"version": "0.1.0",
77-
"command": "npm",
78-
"isShellCommand": true,
79-
"args": [],
80-
"showOutput": "always",
81-
"echoCommand": true,
84+
"version": "2.0.0",
85+
"presentation": {
86+
"echo": true,
87+
"reveal": "always",
88+
"focus": false,
89+
"panel": "new"
90+
},
8291
"tasks": [
8392
{
93+
// Custom prestart task i.e. npm run prestart.
8494
"taskName": "prestart",
85-
"args": ["run", "prestart"],
86-
"suppressTaskName": true
95+
"command": "npm",
96+
"args": [
97+
"run",
98+
"prestart"
99+
],
100+
"type": "shell",
101+
"group": "build",
102+
// Specify tsc problem matcher.
103+
"problemMatcher": ["$tsc-watch"]
87104
},
88105
{
89-
"taskName": "compile",
90-
"args": ["run", "compile"],
91-
"suppressTaskName": true
106+
// Default compile task from package.json i.e. npm run compile.
107+
"type": "npm",
108+
"script": "compile",
109+
"group": "build",
110+
// Specify tsc problem matcher.
111+
"problemMatcher": ["$tsc-watch"]
92112
}
93113
]
94114
}
@@ -102,7 +122,9 @@ To build the project in vscode open the activity search box by selecting the `
102122

103123
![prestart task launch](images/launch_task_prestart.png "prestart task launch")
104124

105-
Note. If the code has been modified and no updates to dependent node modules were made you can compile the project by entering `task compile` into the search box. Or from the command line run `npn run compile`.
125+
If the code has been modified and no updates to dependent node modules were made you can compile the project by entering `task compile` into the search box. Or from the command line run `npn run compile`.
126+
127+
Note. The compile task is a npm script defined in `package.json` which vscode detects and displays as `npm: compile` in the search box.
106128

107129
## Step 4. Debug the project
108130

@@ -115,4 +137,4 @@ To enter debugging mode select the <b>Debug</b> icon on the left hand side menu.
115137
To launch a debug session, from the top left hand side of the <b>Debug</b> window select `Debug rendered process` and press the Play button.
116138
Note. A breakpoint needs to be placed in the code prior to launching a debug session, to allow stepping through code.
117139

118-
These instructions were tested on vscode version 1.12.1.
140+
These instructions were tested on vscode version 1.16.0.

0 commit comments

Comments
 (0)