feat(syntax): introduce CommentNodeId#11214
Merged
graphite-app[bot] merged 1 commit intomainfrom May 24, 2025
Merged
Conversation
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #11214 will not alter performanceComparing Summary
|
719466f to
c4bddcb
Compare
This was referenced May 22, 2025
This was referenced May 23, 2025
0af3781 to
0eb1a8b
Compare
c4bddcb to
6bedcef
Compare
6bedcef to
ed5c98c
Compare
Contributor
Merge activity
|
First step towards #11213. Introduce `CommentNodeId`, which we'll add to AST structs. Note: `CommentNodeId` wraps a `u32`, not a `NonMaxU32`. `CommentNodeId`s will be created in parser, every node will have one, and they will never change thereafter. So we don't need to wrap in `Cell<Option<CommentNodeId>>`, the way we do with e.g. `ScopeId`. So `NonMaxU32` offers no benefit here, and would be slightly more costly. Add a method `get_comment_node_id` to `AstBuilder` which other `AstBuilder` methods will call to populate a field with a `CommentNodeId` field. This method is currently a dummy. `CommentNodeId` is marked `#[clone_in(default)]`, `#[content_eq(skip)]`, `#[estree(skip)]`, so adding this field to AST types will not disrupt any other code.
ed5c98c to
c2c0268
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Nov 14, 2025
Pure refactor. Remove dead import of `CommentNodeId`. It was introduced in #11214, but we didn't end up using it.
graphite-app bot
pushed a commit
that referenced
this pull request
Nov 14, 2025
Pure refactor. `CommentNodeId` was introduced in #11214, but we didn't end up using it. We'll remove it entirely when we put `NodeId`s in AST nodes. This import is dead code, so remove it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

First step towards #11213.
Introduce
CommentNodeId, which we'll add to AST structs.Note:
CommentNodeIdwraps au32, not aNonMaxU32.CommentNodeIds will be created in parser, every node will have one, and they will never change thereafter. So we don't need to wrap inCell<Option<CommentNodeId>>, the way we do with e.g.ScopeId. SoNonMaxU32offers no benefit here, and would be slightly more costly.Add a method
get_comment_node_idtoAstBuilderwhich otherAstBuildermethods will call to populate a field with aCommentNodeIdfield. This method is currently a dummy.CommentNodeIdis marked#[clone_in(default)],#[content_eq(skip)],#[estree(skip)], so adding this field to AST types will not disrupt any other code.