Skip to content
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

Merged
merged 6 commits into from
Apr 17, 2017
Merged

docs: add vscode debug (#751) #767

merged 6 commits into from
Apr 17, 2017

Conversation

okoala
Copy link
Member

@okoala okoala commented Apr 17, 2017

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@mention-bot
Copy link

@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
Copy link

codecov bot commented Apr 17, 2017

Codecov Report

Merging #767 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #767   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          25     25           
  Lines         641    641           
=====================================
  Hits          641    641

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4c345d...aa610ba. Read the comment docs.

@@ -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 了。
Copy link
Member

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 了。
Copy link
Member

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.
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • javascript -> js
  • 跟上面的标题空一行

@okoala
Copy link
Member Author

okoala commented Apr 17, 2017

看看还有哪些需要优化~

Copy link
Member

@atian25 atian25 left a 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 配置进行启动。
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用词有点啰嗦

@atian25
Copy link
Member

atian25 commented Apr 17, 2017

我 +1, @dead-horse 看看还有问题没

@dead-horse
Copy link
Member

LGTM

@dead-horse dead-horse merged commit a8893f7 into eggjs:master Apr 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants