-
Notifications
You must be signed in to change notification settings - Fork 5
Add debug test tasks #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
rxptr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, it looks good, only a tiny change.
src/odin.rs
Outdated
| // Add a special prefix to clarify debugging tests | ||
| let label = if is_test { | ||
| format!("debug test: {}", base_label) | ||
| } else { | ||
| base_label | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/odin.rs
Outdated
| let label = resolved_label | ||
| .clone() | ||
| .strip_prefix("run: ") | ||
| .or_else(|| resolved_label.strip_prefix("test: ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this line was fine, it makes the gutter more clean. Now we have debug: test: 'Test name'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I found with this is that by removing the test: prefix it also removes it from the label in the F4 Debug menu making it unclear the task is for debugging tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, let's just drop the colon (": ") then.



This PR enhances the existing Odin Zed extension to support debugging tests so you can catch breakpoints in tests with ease.
In most cases this creates two new debug tasks:
#2above also shows in the gutter next to the individual test functions as well.Example: