Skip to content

[rust] Support attach_comments in Rust bindings - #4354

Open
reese wants to merge 2 commits into
ruby:mainfrom
reese:reese-rust-comments
Open

reese wants to merge 2 commits into
ruby:mainfrom
reese:reese-rust-comments

Conversation

@reese

@reese reese commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

On the tin. This adds the attach_comments option to the parse options and a comments method on nodes that can return them, which is the same API used for #4255.

I opted to fold both types of comments (the Vec of the entire file's comments + the attached comments from a node) into the Comments iterator, though I'd be fine to have a separate NodeComments iterator if that's preferred. As it stands though, I changed Comments to store a source, one of which reads from the stored Vec and the other which uses pm_node_comment to lazily read them.

@reese
reese force-pushed the reese-rust-comments branch from aeea4b2 to 9209436 Compare November 10, 2026 03:51

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant