-
-
Notifications
You must be signed in to change notification settings - Fork 707
perf(linter): add codegen support for is_member_expression_kind in match
#14677
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
perf(linter): add codegen support for is_member_expression_kind in match
#14677
Conversation
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 Performance ReportMerging #14677 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the linter codegen by adding support for detecting is_member_expression_kind method calls in match expressions. The improvement allows the codegen to recognize when a rule uses this specific method and automatically include the relevant member expression AST variants in the node type set, rather than falling back to incomplete collection.
Key changes:
- Extended
MatchDetectorto handleis_member_expression_kindguard expressions in match arms - Added dependency on
RuleRunnerDatato access pre-parsed member expression kinds - Modified the detection logic to recognize and process this specific pattern
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tasks/linter_codegen/src/match_detector.rs | Added lifetime parameter, RuleRunnerData dependency, and new pattern matching for is_member_expression_kind method calls |
| tasks/linter_codegen/src/main.rs | Updated function call to pass rule_runner_data parameter to MatchDetector::from_run_func |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
d9a751d to
9b21901
Compare
Merge activity
|
…match (#14677) `is_member_expression_kind` is a known method that has a fixed number of AST variants that it will return `true` for. We already parse this out at the beginning of linter codegen, so we know what variants this will check for. So, we can extend the node types instead of simply bailing out early. <img width="713" height="376" alt="image" src="https://github.com/user-attachments/assets/d8e91df3-7ea8-4883-825a-196041e0dbcd" />
9b21901 to
f830bea
Compare

is_member_expression_kindis a known method that has a fixed number of AST variants that it will returntruefor. We already parse this out at the beginning of linter codegen, so we know what variants this will check for. So, we can extend the node types instead of simply bailing out early.