Skip to content

Conversation

@adneufeld
Copy link
Contributor

@adneufeld adneufeld commented Jan 8, 2026

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:

  1. Debug test the current package
  2. Debug test the closest test function in the current file

#2 above also shows in the gutter next to the individual test functions as well.

Example:

image

@cla-bot cla-bot bot added the cla-signed label Jan 8, 2026
Copy link
Collaborator

@rxptr rxptr left a 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
Comment on lines 481 to 486
// Add a special prefix to clarify debugging tests
let label = if is_test {
format!("debug test: {}", base_label)
} else {
base_label
};
Copy link
Collaborator

@rxptr rxptr Jan 8, 2026

Choose a reason for hiding this comment

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

I believe this is redundant; in the debug modal, every task is a debug task. But specifically it makes the run button in the gutter look awkward:

Image

Copy link
Contributor Author

@adneufeld adneufeld Jan 9, 2026

Choose a reason for hiding this comment

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

Yeah good point, thanks for noticing that. I didn't realize the same task would show up in the gutter as well.

By just reverting these few changes I think it looks pretty good leaving that "test: " prefix on it.

image image

src/odin.rs Outdated
let label = resolved_label
.clone()
.strip_prefix("run: ")
.or_else(|| resolved_label.strip_prefix("test: "))
Copy link
Collaborator

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'

Copy link
Contributor Author

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

Copy link
Collaborator

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants