feat(laravel): go-to-definition and find-references for config keys and env variables#93
Merged
AJenbo merged 7 commits intoAJenbo:mainfrom Apr 27, 2026
Merged
Conversation
Owner
|
Nice addition I clean up some minor things and added triggers for |
AJenbo
approved these changes
Apr 27, 2026
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (68.46%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
- Coverage 86.42% 86.32% -0.10%
==========================================
Files 162 164 +2
Lines 102869 103617 +748
==========================================
+ Hits 88901 89445 +544
- Misses 13968 14172 +204 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
config('app.name'),Config::get('app.name'), orConfig::set('app.name')now jumps tothe matching key declaration in
config/app.php. Nested paths (e.g.config('api.keys.secret')) resolve into subdirectory config files."Find All References" lists every call site across the project plus the
declaration in
config/*.php. Uses pre-builtSymbolKind::LaravelStringKeyspans — no per-file re-parse.
env('APP_KEY')jumps to thecorresponding line in
.env.walk_all_php_expressionsandextract_string_literalintolaravel/helpers.rsto avoid boilerplateduplication in future Laravel-specific navigations.
How it works
Config key usages (
config(),Config::get,Config::set) are indexed asSymbolKind::LaravelStringKeyduring workspace scan. Cross-file referencesearch iterates these pre-built spans identically to the existing
find_member_referencespattern — O(symbols), not O(files × parse-cost).Declaration lookup parses only the target
config/*.phpfile on demand;that file set is small (typically < 20) and each parse is cheap.
Env variable resolution is single-file only: it parses the current file to
locate the cursor's
env('KEY')call, then does a text search in.env.Test plan
cargo test— 395 passedcargo clippy— cleancargo fmt --check— cleanphp -l example.php/ assertions — passnested keys, find-references from usage and declaration sites
env()go-to-definition