Novaβ„’

Extensions


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 the split_parser is merged into tree-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.

Disclaimer

This 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!
  • The php injection would have NOT been possible without the work done @CalebDW on the core tree-sitter-phpπŸ™ see tree-sitter-php split_parser pull request draft
    • To get this work, I cloned the split_parser draft, then php-only subsyntax was created in Nova
    • Then all the first party completions, queries were copied, and adjusted to support the new php-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 or blade
  • Added adjusted makeFile to tree-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)