-
Notifications
You must be signed in to change notification settings - Fork 67
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: search for built-ins inside functions #430
Conversation
9731381
to
e54a35d
Compare
e54a35d
to
53e4b0f
Compare
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
crates/core/src/built_in_functions.rs (1)
Issue Found: Incorrect parameter passed to
call_from_args
The new parameter
name
is not being correctly passed to thecall_from_args
function. Instead,kind
is being passed.
- File:
crates/core/src/pattern_compiler/call_compiler.rs
- Line: The call to
BuiltIns::call_from_args
needs to pass thename
parameter instead ofkind
.Please update the function call to correctly pass the
name
parameter.Analysis chain
Line range hint
88-98
: LGTM! But verify the usage of the new parametername
.The code changes are approved.
However, ensure that all calls to
call_from_args
correctly pass the newname
parameter.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all calls to `call_from_args` correctly pass the new `name` parameter. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type rust -A 5 $'call_from_args'Length of output: 976
Script:
#!/bin/bash # Description: Extract lines around the call to `call_from_args` in `crates/core/src/pattern_compiler/call_compiler.rs` to verify the correct usage of the `name` parameter. # Extract lines around the call to `call_from_args`. rg --type rust -A 10 -B 5 $'BuiltIns::call_from_args' crates/core/src/pattern_compiler/call_compiler.rsLength of output: 809
WalkthroughWalkthroughThe changes introduce several enhancements to the pattern matching and analysis capabilities across multiple modules. Key improvements include the introduction of the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Analysis
participant ProblemManager
participant PatternInfo
User->>CLI: run_apply_pattern()
CLI->>Analysis: check for uncommitted changes
Analysis->>ProblemManager: retrieve problem definitions
ProblemManager->>Analysis: provide StaticDefinitions
Analysis->>PatternInfo: create with uses_ai info
PatternInfo-->>CLI: return pattern info
CLI-->>User: display results
Recent review detailsConfiguration used: .coderabbit.yaml Files ignored due to path filters (4)
Files selected for processing (16)
Additional context usedLearnings (1)
Additional comments not posted (36)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
LGTM
5 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Allow us to statically analyze a pattern for llm_chat usage.
The goal is to replace the (very) hacky
isAi
function we currently use.Summary by CodeRabbit
New Features
StaticDefinitions
to improve pattern matching performance and clarity.PatternInfo
structure to include a field indicating AI utilization.Bug Fixes
Chores
Greptile Summary
This is an auto-generated summary
Enhanced static analysis for detecting built-in functions within the codebase, including updates to track AI usage in parsing processes.
crates/grit-pattern-matcher/src/pattern/call_built_in.rs
to add aname
field toCallBuiltIn
struct, improving identification and handling of built-in function calls.crates/cli_bin/tests/snapshots/
to include a newusesAi
field set tofalse
, aiding in tracking AI usage in parsing.GritCall
andPatternName
implementations forCallBuiltIn
utilize the newname
field for enhanced pattern matching capabilities.