Skip to content

debugger: Fix running ignored Rust tests in nested modules - #54787

Merged
tomhoule merged 1 commit into
mainfrom
tomhoule-zlxzkpvpsksq
Jun 10, 2026
Merged

debugger: Fix running ignored Rust tests in nested modules#54787
tomhoule merged 1 commit into
mainfrom
tomhoule-zlxzkpvpsksq

Conversation

@tomhoule

@tomhoule tomhoule commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Debugging an ignored Rust test whose code lives in a nested module (e.g. variant_get::test::get_complex_variant) sometimes exited immediately with "0 tests matched", When the test name itself came from tree-sitter runnable capture, which sees only the bare function identifier. So --exact get_complex_variant filtered out the actual test.

The fix is to only append --exact when the name contains ::. rust-analyzer's experimental/runnables produces qualified paths and keeps the disambiguation introduced in #43110, and the runnables from tree-sitter no longer break for nested modules.

Closes #51810.

Release Notes:

  • Fixed debugging Rust tests in nested modules sometimes immediately exiting with "0 tests matched".

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 24, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Apr 24, 2026
@tomhoule tomhoule changed the title debugger: Fix debug of Rust tests in nested modules debugger: Fix running Rust tests in nested modules from debugger Apr 24, 2026
@tomhoule tomhoule changed the title debugger: Fix running Rust tests in nested modules from debugger debugger: Fix running Rust tests in nested modules Apr 24, 2026
@tomhoule
tomhoule marked this pull request as ready for review April 27, 2026 19:40
@tomhoule
tomhoule requested a review from Anthony-Eid April 27, 2026 19:41
@tomhoule tomhoule changed the title debugger: Fix running Rust tests in nested modules debugger: Fix running ignored Rust tests in nested modules May 19, 2026
Debugging a Rust test whose code lives in a nested module (e.g. `variant_get::test::get_complex_variant`) sometimes exited immediately with "0 tests matched", When the test name itself came from tree-sitter runnable capture, which sees only the bare function identifier. So `--exact get_complex_variant` filtered out the actual test.

The fix is to only append `--exact` when the name contains `::`. rust-analyzer's `experimental/runnables` produces qualified paths and keeps the #43110 disambiguation benefit, and the runnables from tree-sitter no longer break for nested modules.

Closes #51810.

Release Notes:

- Fixed debugging Rust tests in nested modules sometimes immediately exiting with "0 tests matched".
@tomhoule
tomhoule added this pull request to the merge queue Jun 10, 2026
Merged via the queue into main with commit c52842c Jun 10, 2026
32 checks passed
@tomhoule
tomhoule deleted the tomhoule-zlxzkpvpsksq branch June 10, 2026 13:09
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…tries#54787)

Debugging an ignored Rust test whose code lives in a nested module (e.g.
`variant_get::test::get_complex_variant`) sometimes exited immediately
with "0 tests matched", When the test name itself came from tree-sitter
runnable capture, which sees only the bare function identifier. So
`--exact get_complex_variant` filtered out the actual test.

The fix is to only append `--exact` when the name contains `::`.
rust-analyzer's `experimental/runnables` produces qualified paths and
keeps the disambiguation introduced in zed-industries#43110, and the runnables from
tree-sitter no longer break for nested modules.

Closes zed-industries#51810.

Release Notes:

- Fixed debugging Rust tests in nested modules sometimes immediately
exiting with "0 tests matched".
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…tries#54787)

Debugging an ignored Rust test whose code lives in a nested module (e.g.
`variant_get::test::get_complex_variant`) sometimes exited immediately
with "0 tests matched", When the test name itself came from tree-sitter
runnable capture, which sees only the bare function identifier. So
`--exact get_complex_variant` filtered out the actual test.

The fix is to only append `--exact` when the name contains `::`.
rust-analyzer's `experimental/runnables` produces qualified paths and
keeps the disambiguation introduced in zed-industries#43110, and the runnables from
tree-sitter no longer break for nested modules.

Closes zed-industries#51810.

Release Notes:

- Fixed debugging Rust tests in nested modules sometimes immediately
exiting with "0 tests matched".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust: Debugging fails for tests in nested modules due to missing path prefix in binary arguments

2 participants