refactor(linter/plugins, parser/napi): generate type IDs maps as variants#17174
Merged
graphite-app[bot] merged 1 commit intomainfrom Dec 20, 2025
Conversation
This was referenced Dec 20, 2025
Member
Author
This was referenced Dec 20, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the code generation for NODE_TYPE_IDS_MAP to use a single source template with variants, rather than manually constructing separate versions for parser and linter. The refactoring uses the existing generate_variants! macro with conditional compilation comments to create two output variants that differ only in whether they include the FUNCTION_NODE_TYPE_IDS export.
- Unified the source template for type ID maps with conditional
/* IF LINTER */blocks - Applied the variant generator pattern (already used for walker code) to type ID map generation
- Moved
function_node_ids.sort_unstable()earlier to ensure sorting before template interpolation
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tasks/ast_tools/src/generators/estree_visit.rs | Modified generator to use variant system with conditional LINTER flag instead of manually creating two versions; moved sorting of function_node_ids earlier |
| napi/parser/src-js/generated/visit/type_ids.js | Generated parser variant without FUNCTION_NODE_TYPE_IDS export; minor formatting changes (removed inline comments) |
| apps/oxlint/src-js/generated/type_ids.ts | Generated oxlint variant with FUNCTION_NODE_TYPE_IDS export; minor formatting changes (removed inline comments) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
382828e to
9839836
Compare
daabe4a to
101b8a6
Compare
Contributor
Merge activity
|
…ants (#17174) Pure refactor. Generate the JS files containing `NODE_TYPE_IDS_MAP` as variants of a single source code file, instead of constructing to two different versions for parser and linter manually. This makes changes in further PRs to come easier to implement.
101b8a6 to
bc8ab2e
Compare
9839836 to
24a8d9e
Compare
Base automatically changed from
om/12-20-fix_ast_tools_fix_formatting_of_variants
to
main
December 20, 2025 14:08
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.

Pure refactor. Generate the JS files containing
NODE_TYPE_IDS_MAPas variants of a single source code file, instead of constructing to two different versions for parser and linter manually.This makes changes in further PRs to come easier to implement.