mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-21 05:31:11 +00:00
Install @vscode/dwarf-debugging alongside js-debug so WebAssembly sources can be debugged. Skip this when the user supplies their own adapter path, and log failures to the console without aborting the adapter setup. ## Summary I discussed this in this thread : https://github.com/zed-industries/zed/discussions/65313 It allows Zed to debug web assembly, in my case I was writing it in Rust. This is fairly low effort addition as the debugger Zed is already using has the hooks for this built in, so we just need to install the npm package to have it work. The only downside I can see is that `@vscode/dwarf-debugging` is 53MB after being downloaded. ## Testing I built this on Arch and tested this with a small wasm-bindgen project written in Rust. I debugged it with this config, being served from [trunk](https://trunk-rs.github.io/trunk/). ```json { "adapter": "JavaScript", "label": "Launch Chrome (Trunk)", "type": "chrome", "request": "launch", "url": "http://127.0.0.1:8080/", "webRoot": "$ZED_WORKTREE_ROOT/dist" }, ``` I set breakpoints in the changed code and could see that it downloaded and installed correctly (this also printed in the debug console). All `cargo test` pass. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - Added DWARF debugging to JavaScript debugger. Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||