-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
docs: add vscode debug (#751) #767
Conversation
@okoala, thanks for your PR! By analyzing the history of the files in this pull request, we identified @shaoshuai0102, @atian25 and @jtyjty99999 to be potential reviewers. |
Codecov Report
@@ Coverage Diff @@
## master #767 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 25 25
Lines 641 641
=====================================
Hits 641 641 Continue to review full report at Codecov.
|
@@ -257,6 +257,82 @@ $ DEBUG=egg* npm run dev | |||
|
|||
![](https://cloud.githubusercontent.com/assets/227713/24495078/9bf8aaa2-1566-11e7-8dbd-2def56f904d3.png) | |||
|
|||
### 使用 VSCode 进行调试 | |||
|
|||
> 由于在开发阶段,当我们修改代码并保存后,应用会自动重启 worker。但是每次 worker 的更新都会使得调试端口发生变化,而 vscode 是需要 attach 到固定的调试端口的。于是我们启用了一个叫 ```proxyworker``` 单独的代理服务,默认端口为 ```10086```,worker 的调试信息会被代理到这个服务上。这样 vscode 通过固定 attach 到 proxyworker 来调试 worker 了。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一段没必要加引用吧?
proxyworker 和 10086 可以只用一个 `
@@ -257,6 +257,82 @@ $ DEBUG=egg* npm run dev | |||
|
|||
![](https://cloud.githubusercontent.com/assets/227713/24495078/9bf8aaa2-1566-11e7-8dbd-2def56f904d3.png) | |||
|
|||
### 使用 VSCode 进行调试 | |||
|
|||
由于在开发阶段,当我们修改代码并保存后,应用会自动重启 worker。但是每次 worker 的更新都会使得调试端口发生变化,而 vscode 是需要 attach 到固定的调试端口的。于是我们启用了一个叫 ```proxyworker``` 的代理服务,worker 的调试信息会被代理到这个服务上。这样 vscode 通过固定 attach 到 proxyworker 来调试 worker 了。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- vscode 大小写,并且加链接
- proxyworker 的 ` 只需要一个
##### 3. 在 .vscode/launch.json 添加调试配置: | ||
```javascript | ||
{ | ||
// Use IntelliSense to learn about possible Node.js debug attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没用的注释干掉
``` | ||
|
||
##### 3. 在 .vscode/launch.json 添加调试配置: | ||
```javascript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- javascript -> js
- 跟上面的标题空一行
看看还有哪些需要优化~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其他+1
|
||
##### 4. 开始调试 | ||
|
||
在 [VSCode](https://code.visualstudio.com/) 中,切换到调试页面。选择 Debug Egg 配置进行启动。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里链接不需要,下面有了
|
||
在 [VSCode](https://code.visualstudio.com/) 中,切换到调试页面。选择 Debug Egg 配置进行启动。 | ||
|
||
更多 VSCode Debug 用法可以参见 VSCode 文档: [Node.js Debugging in VS Code](https://code.visualstudio.com/docs/nodejs/nodejs-debugging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用词有点啰嗦
我 +1, @dead-horse 看看还有问题没 |
LGTM |
Checklist
Affected core subsystem(s)
Description of change