2019-05-10 10:38:13 +08:00
|
|
|
|
## JavaScript 调试扩展
|
|
|
|
|
|
|
|
|
|
配置模板 (默认值)
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"version": "0.0.1",
|
|
|
|
|
"configurations": [
|
|
|
|
|
{
|
|
|
|
|
"type": "topjs",
|
|
|
|
|
"request": "launch",
|
|
|
|
|
"name": "Launch Debugger",
|
2019-05-16 17:38:34 +08:00
|
|
|
|
"port": 30992,
|
2019-05-10 10:38:13 +08:00
|
|
|
|
"runtimeExecutable": "topjs3",
|
|
|
|
|
"program": "${workspaceFolder}/${command:getProgramPath}"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
2019-05-10 11:21:19 +08:00
|
|
|
|
可定制的字段有`port`, `runtimeExecutable`和`program`。
|
2019-05-10 10:38:13 +08:00
|
|
|
|
|
|
|
|
|
- `port`为任意未占用的端口号。
|
|
|
|
|
|
|
|
|
|
- `runtimeExecutable`为JavaScript引擎路径(如果没有在环境变量中)
|
2019-05-10 11:21:19 +08:00
|
|
|
|
|
|
|
|
|
- `program`会获取当前tab打开的文件的路径,`${workspaceFolder}`表示当前的工作目录,你也可以指定脚本的绝对路径。
|
2019-05-10 10:38:13 +08:00
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
截图
|
2019-05-10 11:21:19 +08:00
|
|
|
|
|
2019-05-16 17:38:34 +08:00
|
|
|
|
![screenshot](./assets/screenshot.gif)
|