Skip to content

EmranMR/Laravel-Nova-Extension

Repository files navigation

alt text 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... 👀

Buy Me A Coffee

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

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 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 be a long time until we see that...

    php injection

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

completion

5. Support for indentation increase/decrease after pressing return key

6. Folding Support

folding

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! 🤯

php injection

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 {

comment

2. typing "comment"

comment

3. using CMD+\ shortcut

comment

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 alt text

Anything else please raise an issue on Laravel Suite repo

Disclaimer

This project is not approved, sponsored, or affiliated with Laravel, Laravel or its related projects

About

Tree-sitter based Laravel + blade support for Nova Editor by Panic

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published