Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"typescript": "^6.0.3"
},
"devDependencies": {
"node-gyp": "^13.0.1",
"sass-embedded": "^1.99.0"
}
}
Binary file added src/assets/img/debuggingZed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 52 additions & 1 deletion src/content/docs/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Image} from 'astro:assets';
import { Icon } from 'astro-icon/components';

import vscodeDebugging from '../../assets/img/debugging.png';
import zedDebugging from '../../assets/img/debuggingZed.png';
import performanceProfile from '../../assets/img/performance-profile.png';

![banner](../../assets/banners/banner13.png)
Expand Down Expand Up @@ -86,6 +87,56 @@ You can then set breakpoints in your code and inspect variables!
<sup>Render process debugging in VSCode!</sup>
</center>

### Debugging in Zed
If you are using [Zed](https://zed.dev/), you can set up debugging by editing the `.zed/debug.json` file with `Run > Edit debug.json...`.
Put the following content into that file:

```json5 title=".vscode/launch.json"
[
{
"label": "Kando: Main Process",
"type": "node",
"request": "launch",
"consoleName": "Kando: Main Process",
"adapter": "JavaScript",
"runtimeExecutable": "${ZED_WORKTREE_ROOT}/node_modules/.bin/tsx",
"runtimeArgs": [
"node_modules/@electron-forge/cli/src/electron-forge-start",
"--",
"--remote-debugging-port=9223"
],
"attachSimplePort": 9223,
"timeout": 10000,
"console": "integratedTerminal",
},
{
"label": "Kando: Renderer Processes",
"type": "chrome",
"adapter": "JavaScript",
"request": "attach",
"port": 9223,
"webRoot": "${ZED_WORKTREE_ROOT}",
"timeout": 100000
}
]
```
<Aside type="note" title="Not Working?">
If breakpoints in the renderer process do not work, it can be that port `9223` is already in use or not working for some other reason.
You can try changing it to another port like `12345`.
Make sure to change it in all places in the `launch.json` file above.
</Aside>

Once this is in place, you can start debugging Kando by running the "Kando: Main Process" configuration first, then the "Kando: Renderer Processes" configuration after.
This will start the main process and attach the debugger to both the main process and the renderer processes.
You can then set breakpoints in your code and inspect variables!

<center>
<Image src={zedDebugging} alt="debugging in Zed" class="shadow"/>
</center>
<center>
<sup>Render process debugging in Zed!</sup>
</center>

### Other IDEs

Have you successfully set up debugging in another IDE?
Expand Down Expand Up @@ -136,4 +187,4 @@ This is extremely useful to identify performance bottlenecks in your code.

<Aside type="tip" title="Need Help?">
If you encounter a problem at any stage, feel free to ask for help in the **#support** or **#dev-chat** channel on [Kando's Discord Server](https://discord.gg/hZwbVSDkhy)!
</Aside>
</Aside>