Problem Statement
The trace callees and trace callers commands work at the symbol name level only, with no way to scope a symbol to a class, namespace, or file. This makes the feature nearly unusable for PHP where:
- Almost all code lives inside classes
- Common method names like execute, handle, run, boot exist across dozens of unrelated classes
- Targeting a class name returns 0 callees — the class is found, but its methods are not walked
Reproduction with a PHP codebase:
Finds the class but returns 0 callees
grepai trace callees "CreateDiscountAction" --mode precise
Returns 640 results across completely unrelated classes
grepai trace callees "execute" --mode precise
Not recognized — no qualified symbol syntax supported
grepai trace callees "CreateDiscountAction::execute" --mode precise
grepai trace callees "CreateDiscountAction@execute" --mode precise
Proposed Solution
Support qualified symbol syntax using Class::method:
grepai trace callees "CreateDiscountAction::execute"
grepai trace callers "DiscountService::create"
This is the most natural fit — :: is already how PHP refer to class methods. No new flags needed, just symbol name parsing that splits on :: and scopes the method lookup to the matching class.
Alternatives Considered
--file flag — scope the symbol to a specific file or glob:
grepai trace callees "index" --file "app/Http/Controllers/UserController.php"
grepai trace callees "handle" --file "app/Jobs/**"
Works, but requires knowing the file path upfront and is more verbose. Would still be a useful complementary addition.
--class flag — explicit class scoping:
grepai trace callees "execute" --class "CreateUserAction"
or with full namespace:
grepai trace callees "execute" --class "App\Actions\CreateUserAction"
Clean, but adds a new flag. The inline Class::method syntax feels more natural for day-to-day use.
Category
Search / Indexing
Additional Context
For Go or Python with uniquely named top-level functions, trace works great. The limitation only surfaces in OOP-heavy codebases where method names are scoped to classes by design. Supporting Class::method (or Class@method for languages that use @) would make trace as useful for PHP/Java projects as it currently is for Go.
Contribution
Problem Statement
The trace callees and trace callers commands work at the symbol name level only, with no way to scope a symbol to a class, namespace, or file. This makes the feature nearly unusable for PHP where:
Reproduction with a PHP codebase:
Finds the class but returns 0 callees
grepai trace callees "CreateDiscountAction" --mode preciseReturns 640 results across completely unrelated classes
grepai trace callees "execute" --mode preciseNot recognized — no qualified symbol syntax supported
grepai trace callees "CreateDiscountAction::execute" --mode precisegrepai trace callees "CreateDiscountAction@execute" --mode preciseProposed Solution
Support qualified symbol syntax using Class::method:
grepai trace callees "CreateDiscountAction::execute"grepai trace callers "DiscountService::create"This is the most natural fit — :: is already how PHP refer to class methods. No new flags needed, just symbol name parsing that splits on :: and scopes the method lookup to the matching class.
Alternatives Considered
--file flag — scope the symbol to a specific file or glob:
grepai trace callees "index" --file "app/Http/Controllers/UserController.php"grepai trace callees "handle" --file "app/Jobs/**"Works, but requires knowing the file path upfront and is more verbose. Would still be a useful complementary addition.
--class flag — explicit class scoping:
grepai trace callees "execute" --class "CreateUserAction"or with full namespace:
grepai trace callees "execute" --class "App\Actions\CreateUserAction"Clean, but adds a new flag. The inline Class::method syntax feels more natural for day-to-day use.
Category
Search / Indexing
Additional Context
For Go or Python with uniquely named top-level functions, trace works great. The limitation only surfaces in OOP-heavy codebases where method names are scoped to classes by design. Supporting Class::method (or Class@method for languages that use @) would make trace as useful for PHP/Java projects as it currently is for Go.
Contribution