refactor(semantic): collapse class-table flag into ClassTableBuilder#22909
Merged
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Member
Author
Merge activity
|
…22909) ## Summary Follow-up cleanup to #22862 (which made the `oxc_semantic` `ClassTable` optional and off by default). Two small improvements: 1. **Collapse the duplicate flag.** #22862 added a `build_class_table` field on `SemanticBuilder` that existed only to be OR'd into the `ClassTableBuilder::enabled` flag that already exists. `with_class_table` now writes `class_table_builder.enabled` directly, and `build()` folds in the checker dependency with `enabled |= self.check_syntax_error`. One source of truth instead of two flags plus a bridge; behaviour is identical and order-independent. 2. **Fix linter-benchmark fidelity.** `tasks/benchmark/benches/linter.rs` runs `ConfigStoreBuilder::all()` but built its semantic without the class table, so after #22862 flipped the default the class-dependent rules (`no_dupe_class_members`, `no_unused_private_class_members`, `max_classes_per_file`) silently no-op'd there — the benchmark measured less work than production. Added `.with_class_table(true)` to match `service/runtime.rs`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
b09814b to
a8cb7d6
Compare
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.
Summary
Follow-up cleanup to #22862 (which made the
oxc_semanticClassTableoptional and off by default). Two small improvements:Collapse the duplicate flag. feat(semantic): make building the class table optional, off by default #22862 added a
build_class_tablefield onSemanticBuilderthat existed only to be OR'd into theClassTableBuilder::enabledflag that already exists.with_class_tablenow writesclass_table_builder.enableddirectly, andbuild()folds in the checker dependency withenabled |= self.check_syntax_error. One source of truth instead of two flags plus a bridge; behaviour is identical and order-independent.Fix linter-benchmark fidelity.
tasks/benchmark/benches/linter.rsrunsConfigStoreBuilder::all()but built its semantic without the class table, so after feat(semantic): make building the class table optional, off by default #22862 flipped the default the class-dependent rules (no_dupe_class_members,no_unused_private_class_members,max_classes_per_file) silently no-op'd there — the benchmark measured less work than production. Added.with_class_table(true)to matchservice/runtime.rs.🤖 Generated with Claude Code