Skip to content

feat: expose comments to parsing without changing API#178

Closed
todpunk wants to merge 1 commit into
facebook:mainfrom
todpunk:todpunk/expose-comments-in-ast
Closed

feat: expose comments to parsing without changing API#178
todpunk wants to merge 1 commit into
facebook:mainfrom
todpunk:todpunk/expose-comments-in-ast

Conversation

@todpunk

@todpunk todpunk commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

This should allow me to do things like merge BUILD.in comments for gazelle into the resulting BUILD, or other such things. It doesn't change the API so current usage is unaffected.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 13, 2026
@meta-codesync

meta-codesync Bot commented Mar 13, 2026

Copy link
Copy Markdown

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D96525032. (Because this pull request was imported automatically, there will not be any future comments.)

@nataliejameson

Copy link
Copy Markdown
@ndmitchell ndmitchell self-assigned this May 19, 2026

@JakobDegen JakobDegen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync

meta-codesync Bot commented May 20, 2026

Copy link
Copy Markdown

@ndmitchell merged this pull request in 992542c.

meta-codesync Bot pushed a commit to facebook/buck2 that referenced this pull request May 20, 2026
Summary:
This should allow me to do things like merge BUILD.in comments for gazelle into the resulting BUILD, or other such things. It doesn't change the API so current usage is unaffected.

X-link: facebook/starlark-rust#178

Reviewed By: JakobDegen

Differential Revision: D96525032

Pulled By: ndmitchell

fbshipit-source-id: e1acb3b06a58580c37128501145dd3c5f1ed45ca
@ndmitchell

Copy link
Copy Markdown
Contributor

Thanks for the diff! I implemented it in a slightly different way which avoids doing the string allocation, since with a Span we actually have all the info we need to get the underlying string stored in the AstModule. I also added some tests, which should be sufficient to confirm it still does what you need.

@nataliejameson

Copy link
Copy Markdown

@ndmitchell Thanks so much for getting this merged in (and yeah, I was going to mention that string alloc in there, so thanks for fixing that up). Any chance we'll be getting a new release on crates.io soon, then, so we don't have to hit our famously reliable friend github to clone the repo for this patch?

@ndmitchell

Copy link
Copy Markdown
Contributor

@nataliejameson working on the release now. Hoping to get it out today.

@nataliejameson

Copy link
Copy Markdown

#thanks I have no idea if this is still a thing, but thank you!

@ndmitchell

Copy link
Copy Markdown
Contributor

See #194 for the issue tracking a new release.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

4 participants