-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add vscode debug support #2571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add vscode debug support #2571
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
|
|
||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "BoostNote Main", | ||
| "protocol": "inspector", | ||
| "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", | ||
| "runtimeArgs": [ | ||
| "--remote-debugging-port=9223", | ||
| "--hot", | ||
| "${workspaceFolder}/index.js" | ||
| ], | ||
| "windows": { | ||
| "runtimeExecutable": "${workspaceFolder}/node_modeules/.bin/electron.cmd" | ||
| } | ||
| }, | ||
| { | ||
| "type": "chrome", | ||
| "request": "attach", | ||
| "name": "BoostNote Renderer", | ||
| "port": 9223, | ||
| "webRoot": "${workspaceFolder}", | ||
| "sourceMapPathOverrides": { | ||
| "webpack:///./~/*": "${webRoot}/node_modules/*", | ||
| "webpack:///*": "${webRoot}/*" | ||
| } | ||
| } | ||
| ], | ||
| "compounds": [ | ||
| { | ||
| "name": "BostNote All", | ||
| "configurations": ["BoostNote Main", "BoostNote Renderer"] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| // See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
| // for the documentation about the tasks.json format | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "Build Boostnote", | ||
| "group": "build", | ||
| "type": "npm", | ||
| "script": "watch", | ||
| "isBackground": true, | ||
| "presentation": { | ||
| "reveal": "always", | ||
| }, | ||
| "problemMatcher": { | ||
| "pattern":[ | ||
| { | ||
| "regexp": "^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$", | ||
| "file": 1, | ||
| "location": 2, | ||
| "message": 3 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,36 @@ | ||
| # How to debug Boostnote (Electron app) | ||
| This page is also available in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md). | ||
| # How to debug BoostNote (Electron app) | ||
|
|
||
| This page is also available in [Japanese](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md). | ||
enyaxu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Debug with Google Chrome developer Tools | ||
| Boostnote is an Electron app so it's based on Chromium; developers can use `Developer Tools` just like Google Chrome. | ||
|
|
||
| You can toggle the `Developer Tools` like this: | ||
|  | ||
| (https://cloud.githubusercontent.com/assets/11307908/24343585/162187e2-127c-11e7-9c01-23578db03ecf.png) | ||
|
|
||
| The `Developer Tools` will look like this: | ||
|  | ||
| (https://cloud.githubusercontent.com/assets/11307908/24343545/eff9f3a6-127b-11e7-94cf-cb67bfda634a.png) | ||
|
|
||
| When errors occur, the error messages are displayed at the `console`. | ||
|
|
||
| ## Debugging | ||
| ### Debugging | ||
| For example, you can use the `debugger` to set a breakpoint in the code like this: | ||
|
|
||
|  | ||
| (https://cloud.githubusercontent.com/assets/11307908/24343879/9459efea-127d-11e7-9943-f60bf7f66d4a.png) | ||
enyaxu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This is just an illustrative example, you should find a way to debug which fits your style. | ||
|
|
||
| ## References | ||
| ### References | ||
| * [Official document of Google Chrome about debugging](https://developer.chrome.com/devtools) | ||
|
|
||
| ## Debug with Visual Studio Code | ||
|
|
||
| 1. Install **[Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome "Install Debugger for Chrome")** plugin for Visual Studio Code. Then restart it. | ||
| 2. Pressing **Shift+Command+B** or running ** Run Build Task** from the global **Terminal** menu, then pick the task named **Build Boostnote**. | ||
enyaxu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 3. When above task is running, open **Debug view** in **Activity Bar** on the side of VS Code or use shortcut **Shift+Command+D**. | ||
| 4. Select the configuration named **Boostnote All** from the **Debug configuration**, then click the green arrow button or press **F5**. | ||
enyaxu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 5. Now you should find **Boostnote** is running. You will see two process is running, one named **Boostnote Main**,other named **Boostnote Renderer**. Now you can set **debug breakpoint** in vscode. If you find **breakpoints** is unverified, you need to switch process. | ||
enyaxu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### References | ||
| * [Electron application debugging](https://electronjs.org/docs/tutorial/application-debugging) | ||
| * [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.