Skip to content

Conversation

@greenpixels
Copy link

@greenpixels greenpixels commented Dec 6, 2025

Updated the debugging documentation for VS Code as the prior configurations was outdated

These where the previous issues of the example configuration

  • Warning: Missing property "program"
  • The attempt to launch cross-platform seems to be not supported. You can't run platform per OS, only pass in arguments per OS to program via args https://code.visualstudio.com/docs/debugtest/debugging-configuration#_platformspecific-properties
  • Going by the recommended project structure makes "preLaunchTask": "rust: cargo build" not execute correctly. Instead you need a separate tasks.json that builds rust in the correct folder. (See below)
    With the given changes these should no longer be a problem.
  • Removed the -e argument as starting the debug with godot in editor mode apparently does not keep any breakpoints set in Rust

I would have loved to omit the tasks.json, but sadly its not possible to set a working directory for cargo build (except for running when nightly channel)

Updated the debugging documentation for VS Code as the prior configurations was outdated
Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

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

Thanks!

{
"name": "Debug Project (Godot 4)",
"type": "lldb", // type provided by CodeLLDB extension
"type": "lldb",
Copy link
Member

Choose a reason for hiding this comment

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

Is the comment inaccurate, or why removed?

Copy link
Author

Choose a reason for hiding this comment

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

}
```

```jsonc
Copy link
Member

Choose a reason for hiding this comment

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

Note that while it's technically more correct, jsonc isn't associated with a syntax highlighter in mdbook, so the reader experience is worse than with json.

You can render the page with mdbook serve --open to quickly test this for yourself 🙂

Copy link
Author

@greenpixels greenpixels Dec 6, 2025

Choose a reason for hiding this comment

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

Yea, I quickly edited it in GitHubs Web Editor 🙃 I'll do it proper and run it locally, sorry for the holdup.

Comment on lines 35 to 37
"args": [
"-w"
],
Copy link
Member

Choose a reason for hiding this comment

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

Also here, you removed the -e and all comments. I understand why -e might not be preferrable as default choice, but you could still leave it there, commented-out, so that people who want it can quickly learn about it.

I don't see why you removed the comment for -w, it's not necessarily obvious what this argument does.

Copy link
Author

Choose a reason for hiding this comment

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

Opening it as editor with -e does not keep the breakpoints for LLDB. At least I was unable to make it work and I found several other sharing that problem on the discord.

I forgot mentioning this in my original PR description and will add it now.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Bromeon Bromeon added the error Mistake in the book label Dec 6, 2025
@greenpixels
Copy link
Author

greenpixels commented Dec 6, 2025

Apologies, I removed the comments because it was for myself and I copied over my configuration promptly, forgetting correctly merging the two.

I will better consolidate it with the previous version.

@Yarwin
Copy link
Contributor

Yarwin commented Dec 7, 2025

Note – I had issue with lldb in which I had to manually add br s -r rust_panic to make it stop on rust panics, not only the breakpoints – is it a case with VSCode?

In Zed I'm handling it by specifying: "initCommands": ["br s -r rust_panic"], in my config.


Oh, and remember about squashing commits later 😅

@greenpixels
Copy link
Author

Changed to json instead of jsonc and added back comments.
Unable to build locally due to mdbook issues I've mentioned on the discord (migration issues)

I also did a local squash rebase, but that seems to not have worked here ... my local git history looks good now, but seems it didn't transfer correctly.

Anyhow, if the PR is still not satisfactory then please treat it as stale or close it as I'm currently short on time, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error Mistake in the book

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants