Skip to content

feat(syntax): introduce CommentNodeId#11214

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-21-feat_syntax_introduce_commentnodeid_
May 24, 2025
Merged

feat(syntax): introduce CommentNodeId#11214
graphite-app[bot] merged 1 commit intomainfrom
05-21-feat_syntax_introduce_commentnodeid_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 21, 2025

First step towards #11213.

Introduce CommentNodeId, which we'll add to AST structs.

Note: CommentNodeId wraps a u32, not a NonMaxU32. CommentNodeIds 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.

Copy link
Member Author

overlookmotel commented May 21, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label May 21, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented May 21, 2025

CodSpeed Instrumentation Performance Report

Merging #11214 will not alter performance

Comparing 05-21-feat_syntax_introduce_commentnodeid_ (c2c0268) with main (c16ea02)

Summary

✅ 38 untouched benchmarks

@Boshen Boshen self-assigned this May 21, 2025
@overlookmotel overlookmotel changed the base branch from main to graphite-base/11214 May 22, 2025 23:57
@overlookmotel overlookmotel force-pushed the 05-21-feat_syntax_introduce_commentnodeid_ branch from 719466f to c4bddcb Compare May 22, 2025 23:58
@overlookmotel overlookmotel changed the base branch from graphite-base/11214 to 05-21-feat_ast_tools_allow_deriving_clonein_on_types_with_clone_in_default_attr May 22, 2025 23:58
@github-actions github-actions bot added A-ast Area - AST A-ast-tools Area - AST tools labels May 22, 2025
@overlookmotel overlookmotel marked this pull request as ready for review May 23, 2025 00:02
@graphite-app graphite-app bot changed the base branch from 05-21-feat_ast_tools_allow_deriving_clonein_on_types_with_clone_in_default_attr to graphite-base/11214 May 23, 2025 06:50
@graphite-app graphite-app bot force-pushed the graphite-base/11214 branch from 0af3781 to 0eb1a8b Compare May 23, 2025 06:56
@graphite-app graphite-app bot force-pushed the 05-21-feat_syntax_introduce_commentnodeid_ branch from c4bddcb to 6bedcef Compare May 23, 2025 06:56
@graphite-app graphite-app bot changed the base branch from graphite-base/11214 to main May 23, 2025 06:57
@graphite-app graphite-app bot force-pushed the 05-21-feat_syntax_introduce_commentnodeid_ branch from 6bedcef to ed5c98c Compare May 23, 2025 06:57
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label May 24, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented May 24, 2025

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.
@graphite-app graphite-app bot force-pushed the 05-21-feat_syntax_introduce_commentnodeid_ branch from ed5c98c to c2c0268 Compare May 24, 2025 02:44
@graphite-app graphite-app bot merged commit c2c0268 into main May 24, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 05-21-feat_syntax_introduce_commentnodeid_ branch May 24, 2025 02:51
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 24, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants