Move language-specific debugging docs to the page for each language (#33692)

Release Notes:

- N/A
This commit is contained in:
Cole Miller
2025-07-01 16:02:12 -04:00
committed by GitHub
parent 0e2e5b8b0d
commit b7bfdd3383
13 changed files with 411 additions and 345 deletions

View File

@@ -4,6 +4,7 @@ JavaScript support is available natively in Zed.
- Tree-sitter: [tree-sitter/tree-sitter-javascript](https://github.com/tree-sitter/tree-sitter-javascript)
- Language Server: [typescript-language-server/typescript-language-server](https://github.com/typescript-language-server/typescript-language-server)
- Debug Adapter: [vscode-js-debug](https://github.com/microsoft/vscode-js-debug)
## Code formatting
@@ -174,6 +175,54 @@ You can configure ESLint's `workingDirectory` setting:
}
```
## Debugging
Zed supports debugging JavaScript code out of the box.
The following can be debugged without writing additional configuration:
- Tasks from `package.json`
- Tests written using several popular frameworks (Jest, Mocha, Vitest, Jasmine)
Run {#action debugger::Start} ({#kb debugger::Start}) to see a contextual list of these predefined debug tasks.
As for all languages, configurations from `.vscode/launch.json` are also available for debugging in Zed.
If your use-case isn't covered by any of these, you can take full control by adding debug configurations to `.zed/debug.json`. See below for example configurations.
### Debug the current file
```json
[
{
"adapter": "JavaScript",
"label": "Debug JS file",
"type": "node",
"request": "launch",
"program": "$ZED_FILE",
"skipFiles": ["<node_internals>/**"]
}
]
```
This implicitly runs the current file using `node`.
### Launch a web app in Chrome
```json
[
{
"adapter": "JavaScript",
"label": "Debug app in Chrome",
"type": "chrome",
"request": "launch",
"file": "$ZED_WORKTREE_ROOT/index.html",
"webRoot": "$ZED_WORKTREE_ROOT",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"]
}
]
```
## See also
- [Yarn documentation](./yarn.md) for a walkthrough of configuring your project to use Yarn.