Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ast_tools): add #[builder(default)] attribute for structs and enums #9203

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Feb 18, 2025

Add a #[builder(default)] attribute which can be used on structs or enums to indicate that AST builder methods should not require this field.

Use that attribute on ScopeId, SymbolId and ReferenceId, to replace the hard-coded list of semantic ID types in codegen for AstBuilder.

Does not affect generated code, only the mechanisms by which it's generated.

@github-actions github-actions bot added A-ast-tools Area - AST tools C-enhancement Category - New feature or request labels Feb 18, 2025
Copy link
Contributor Author

overlookmotel commented Feb 18, 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.

Copy link

codspeed-hq bot commented Feb 18, 2025

CodSpeed Performance Report

Merging #9203 will not alter performance

Comparing 02-18-feat_ast_tools_add_builder_default_attribute_for_structs_and_enums (3e7b21c) with main (be27164)

Summary

✅ 33 untouched benchmarks

Copy link

graphite-app bot commented Feb 18, 2025

Merge activity

…enums (#9203)

Add a `#[builder(default)]` attribute which can be used on structs or enums to indicate that AST builder methods should not require this field.

Use that attribute on `ScopeId`, `SymbolId` and `ReferenceId`, to replace the hard-coded list of semantic ID types in codegen for `AstBuilder`.

Does not affect generated code, only the mechanisms by which it's generated.
@graphite-app graphite-app bot force-pushed the 02-18-feat_ast_tools_add_builder_default_attribute_for_structs_and_enums branch from 5d9ec0a to 3e7b21c Compare February 18, 2025 14:50
graphite-app bot pushed a commit that referenced this pull request Feb 18, 2025
#9204)

Extend `#[builder(default)]` attribute added in #9203 to also be usable on struct fields.

This will enable adding a `pure: bool` field to some structs, without altering the signature of AST builder methods.

Does not alter any generated code.
@graphite-app graphite-app bot merged commit 3e7b21c into main Feb 18, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 02-18-feat_ast_tools_add_builder_default_attribute_for_structs_and_enums branch February 18, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue 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.

1 participant