Yard Brave Blade Navigator
VSCode extension for Go to Definition, document links, and autocomplete in Blade templates (Bedrock + Sage).
Features
- Go to Definition (Cmd+Click / F12) — jump directly to
<x-component> and @include() targets
- Document Links — underlined clickable links for all resolvable blade references
- Autocomplete —
<x- triggers component name suggestions from the current and parent theme
Supported syntax
| Blade syntax |
Resolves to |
<x-alert> |
components/alert.blade.php |
<x-meta.item> |
components/meta/item.blade.php |
<x-facetwp.filters> |
components/facetwp/filters.blade.php |
@include('partials.header') |
partials/header.blade.php |
@include('blocks.FacetWP.index', [...]) |
blocks/FacetWP/index.blade.php |
@includeIf('partials.hero') |
partials/hero.blade.php |
@includeWhen($cond, 'partials.sidebar') |
partials/sidebar.blade.php |
@includeUnless($cond, 'partials.footer') |
partials/footer.blade.php |
Requirements
- Bedrock + Sage WordPress project
- Themes at
web/app/themes/{theme}/
- Blade files under
resources/views/
Theme resolution
- Detects current theme from the open file's path
- Reads
style.css Template: field to find parent theme
- Checks current theme first, falls back to parent theme
- Defaults to no parent if
Template: is absent
Setup
- Install from the VS Code Marketplace
- Open your Bedrock project root in VSCode
- Open any
.blade.php file — the extension activates automatically
Publishing a new version
Bump version in package.json
Install vsce globally (once):
npm install -g @vscode/vsce
Build and package:
npm run compile
vsce package
# produces vscode-brave-blade-navigator-x.x.x.vsix
Upload at marketplace.visualstudio.com/manage/publishers/yard-extension-packs — click the extension → Update → upload the .vsix file.
Or publish via CLI with an Azure PAT (Marketplace → Manage scope):
vsce publish --pat <your-azure-PAT>
Architecture
BladeParser regex extraction of <x-*> and @include() tokens
ThemeResolver detect current + parent theme from file path
FileIndex sync fs scan at activation, O(1) map lookup
ComponentResolver <x-name> → candidate absolute paths
IncludeResolver @include('dot.path') → candidate absolute paths
DefinitionProvider Go to Definition (thin wrapper over above)
DocumentLinkProvider underlined links (thin wrapper)
CompletionProvider <x- autocomplete (thin wrapper)
| |