Skip to content

Fix "Select larger syntax node" for Rust doc comments#50395

Closed
wetneb wants to merge 1 commit intozed-industries:mainfrom
wetneb:44331-fix-rust-doc-comment-handling
Closed

Fix "Select larger syntax node" for Rust doc comments#50395
wetneb wants to merge 1 commit intozed-industries:mainfrom
wetneb:44331-fix-rust-doc-comment-handling

Conversation

@wetneb
Copy link
Copy Markdown

@wetneb wetneb commented Feb 28, 2026

Closes #44331.

This switches to a version of the Rust tree-sitter parser which correctly attaches the doc comments to the nodes they annotate.

This new parser also contains a range of improvements to the parsing of other aspects of the language, meaning that the query files required more adaptations in other places. You can see the details of those changes in the commit log of the grammar. Many of such changes have been submitted upstream, but the upstream repo isn't very actively maintained.

Release Notes:

  • Improved Rust support by switching to the tree-sitter-rust-orchard parser

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 28, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @wetneb on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Feb 28, 2026
Fixes zed-industries#44331.

This switches to a version of the Rust tree-sitter parser which
correctly attaches the doc comments to the nodes they annotate.

This new parser also contains a range of improvements to the
parsing of other aspects of the language, meaning that the query
files required more adaptations in other places.
@wetneb wetneb force-pushed the 44331-fix-rust-doc-comment-handling branch from ff037ce to 03c63fd Compare February 28, 2026 14:08
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Feb 28, 2026
@wetneb wetneb marked this pull request as draft March 6, 2026 20:36
@wetneb wetneb marked this pull request as draft March 6, 2026 20:36
@wetneb
Copy link
Copy Markdown
Author

wetneb commented Mar 6, 2026

Some more queries need updating for the changes introduced in the grammar, I'll see if it's doable.

@SomeoneToIgnore
Copy link
Copy Markdown
Contributor

Thank you, will close this draft as stale for now to keep the queue cleaner.

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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Select larger syntax node" on a rust struct with attributes doesn't work as expected.

2 participants