- Laravel Suite
- Laravel Suite, tree-sitter based blade syntax highlighting and completion support for laravel blade files.
- 1641 Installs
-
This extension is allowed to:
- Read Files
- Launch Subprocesses
Readme
Laravel Suite
⚠️ 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
1. Integration with tree-sitter-blade
- It is up to date as of 10.x and growing!
2. Syntax highlighting and autocompletion support for all blade
directives
- including the custom if statements and related projects such as the much Livewire v3.0.
3. 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 be a long time until we see that...
4. 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
5. Support for indentation increase/decrease after pressing return key
6. Folding Support
7. Shell injection / Laravel Envoy
- You now get completion for Laravel envoy directives
- On top of that, the content of the tasks are correctly parsed as
shell
! 🤯
8. 🚧 Commenting 🚧
- There is a conflict internally in Nova, when using injected languages
- This causes
HTML
commenting instead of blade - Here are the 3 workarounds
- I have tried creating a shortcut for commenting the "text before cursor" and "selected text", but they were buggy, because of white spaces, and the VIM mode
1. Typing {
2. typing "comment"
3. using CMD+\
shortcut
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
DisclaimerThis project is not approved, sponsored, or affiliated with Laravel, Laravel or its related projects
Changelog
v1.9.0
New Stuff ✨:
- Bumped
tree-sitter-blade
tov0.11.0
- Support for Inertia
@inertia
and@inertiahead
- Support for Ziggy
@routes
v1.8.0
New Stuff ✨:
- Bumped
tree-sitter-blade
tov0.10.0
- Support for the brand new Laravel
@use
directive - Support for
@js
v1.7.0
New Stuff ✨:
- Bumps
tree-sitter-blade
to v0.9.2 - Shell injection for laravel Envoy
- New directives
- Envoy
@servers
@import
@task
@story
@setup
- Hooks
@before
@after
@error
@success
@finished
- Notifications
@before
@slack
@discord
@telegram
@microsoftTeams
Bug Fix 🐞:
- parsing bug #20
v1.6.1
Bug Fix 🐞:
- Emmet extension should now work as expected with Blade files! #19 🙈
v1.6.0
New Stuff ✨:
- Temporary replacement support for commenting in Blade, as there is a conflict internally in Nova, when using injected languages
- There are three ways you can comments in blade files.
1. Typing {
2. typing "comment"
3. using CMD+\
shortcut
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! - 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.
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
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)