- Laravel Suite
- Laravel Suite, tree-sitter based blade syntax highlighting and completion support for laravel blade files.
- 340 Installs
-
This extension is allowed to:
- Read Files
- Launch Subprocesses
Readme
Laravel Suite
- ~~The extension is not quite there yet, because of the
shortcomings with
tree-sitter-php
. However feel free to use it for experimenting and testing. I would appreciate any feedbacks.~~
πThe Extension is now V1.0.0 π
β οΈ Needless to say, if you have the Blade Extension installed, you need to uninstall or disable. Otherwise this extension won't work as expected
Sponsorship β€οΈ
If this project & tree-sitter-blade put a delightful smile on your face, don't forget to star β both projects or maybe sponsor... β€οΈπ
Introduction
This is a tree-sitter
π³ based syntax highlighting and
autocompletion, built on top of the brand newβ¨
tree-sitter-blade
which was created with this project in mind.
Hoping for this extension to be an all in one for Laravel projects. A bit ambitious but hopefully we can get there one day!
Features
- Integration with tree-sitter-blade is up to date as of 10.x and growing!
- Syntax highlighting and autocompletion support for all
blade
, including the custom if statements π± and related projects such as the much anticipated upcoming π Livewire v3.0. -
php
injection support π₯³ (this was one of the major hurdles see tree-sitter-blade#5 and Nova Forum for the backstory π)- To find out how this was resolved checkout v1.0.0 release notes / Changelog
- This is a temporary measure, to overcome the
tree-sitter-php
shortcomings, until thesplit_parser
is merged intotree-sitter-php
and then it is adopted by Nova's first party PHP syntax highlighting. Which could possibly a long time until we see that...
-
Context aware autocompletion
-
There is a bug π associated with Nova which has been reported, until then it wont be as great as expected.
-
For currently supported directives see the changelog or github release notes
- New completions will be added in parallel to
tree-sitter-blade
, as that project grows
-
-
Support for indentation increase/decrease after pressing return key
-
Folding Support
Staying up-to-date?
Just star β or watch π Laravel Suite and tree-sitter-blade
Issues:
Tree-Sitter-Blade π³
If you see any problem with parsing, very likely it is related to
the tree-sitter-blade
. So please
raise an issue on that repo
Laravel Suite
Anything else please raise an issue on Laravel Suite repo
What if I dont know? π€·ββοΈ
Well raise it in either repos and I will link it up to the correct repo, I won't bite, I promise! After all it is hard to draw the line sometimes especially for highlighting or folding.
DisclaimerThis project is not approved, sponsored, or affiliated with Laravel, Laravel or its related projects
Changelog
v1.5.0
New Stuff β¨:
- Bumps
tree-sitter-blade
to v0.7.0 - Full support Template Inheritance
@aware
@parent
- inline
@section
- nested
@section
with@endsection
or@show
end directive
v1.4.0
New Stuff β¨:
- Bumps
tree-sitter-blade
to v0.6.0 - Added support for
bracket
selectors, allowing the themes to take advantage of. #14 - Support for Laravel Pennant
@feature
@elsefeature
Bug Fix π:
- Fixed bug #15
v1.2.0
New Features β¨:
- bumped
tree-sitter-blade
π³ to v0.4.1 - Support for Authorisation Directives:
@can
@canany
@cannot
@elsecan
@elsecannot
@elsecanany
v.1.1.1
Bug Fixes: π
- Fixes attribute html injection problems. See #11
v1.1.0
New Features β¨:
1. Completion now covers all the directives supported in
tree-sitter-blade
and they are as it follows:
- loops
@for
@foreach
@forelse
@while
- Livewire πͺΌ
@persist
@teleport
@volt
2. Syntax Highlighting adjustment
- The attribute directives now match the theme colouring for
tag.attribute.name
- For other directives theme selector has been changed to
tag.framework
so that it is semantically correct
Bug Fixes: π
- Fixed the issue
@verbatim
adding parameter in completion - Remove duplicate
@break
until the issue is fixed in #10
π£ 1.0.0 π
Finally support for php
injection π₯³ as well php autocompletion that is provided by Nova! see below for more info π
- This includes
- inside
parameters
,{{ }}
@php @endphp
or anywhere else you expect syntax highlighting!
- inside
- The
php
injection would have NOT been possible without the work done @CalebDW on the coretree-sitter-php
π see tree-sitter-php split_parser pull request draft- To get this work, I cloned the
split_parser draft
, thenphp-only
subsyntax was created in Nova - Then all the first party
completions
,queries
were copied, and adjusted to support the newphp-only
sub-syntax - This is a temporary measure until the pull request is merged, and then adopted by Nova, which might take a long time.
- To get this work, I cloned the
Other Updates
- Updated the submodules to the latest version
- Completion file names all adjusted to avoid confusion, prefixed
with
php
orblade
- Added adjusted
makeFile
totree-sitter-php-only
to allow generation of correct dynamic library for Nova
0.2.2
- Extension typo fix...
0.2.0
New Features:
bumped the tree-sitter to v0.3.2, which includes:
- a lot of bug fixes,
- Folding Support
- Directive support for Livewire including the upcoming v3.0
Using Symbolic icons so that completion can be distinguished easier and semantic.
@vite
support- Completions refactored and categorised to follow their order they appear in tree-sitter grammar as well as following the rule_names
- Autocompletions:
- attributes
@class
@style
@checked
@selected
@disabled
@readonly
@required
- keywords
@csrf
@viteReactRefresh
@livewireStyles
@livewireScripts
@livewireScriptConfig
- inline directives
@extend
@yield
@include
@includeIf
@includeWhen
@includeUnless
@includeFirst
@props
@method
@inject
@each
@vite
@livewire
@Switch
@case
@break
@default
- conditionals and if statements
@section
@fragment
@once
@verbatim
@push
@pushOnce
@pushIf
@prepend
@prependOnce
@if
@Unless
@isset
@auth
@guest
@production
@env
@hasSection
@sectionMissing
@error
@php
tags
- attributes
Adjustment to auto indentation increase/decrease
Bug Fix π:
- Issues with context aware completion see #7 resulting with problem completing the attribute directives as well as none relating completion showing in attributes
0.1.0
- Support for code folding for blade directives
- bumped the
tree-sitter-blade
to 0.1.2
Version 0.0.6
- Extension rearrangements for slimming purposes.
- Streamlining the build process & including the code signing
Version 0.0.5
- Initial Release
- Integration with
tree-sitter-blade
- Support for automatic indentation increase and decrease
- Very basic context aware autocompletion (not complete at all)