onecentlin / laravel-blade-snippets-vscode

Laravel blade snippets and syntax highlight support for Visual Studio Code
MIT License
137 stars 38 forks source link

Syntax Highlighting for Laravel 9 Slot Name Shortcut #148

Closed thecodeclimber closed 9 months ago

thecodeclimber commented 2 years ago

In Laravel 9 there is a new shorthand for named slots: https://laravel.com/docs/9.x/releases#slot-name-shortcut

However, there does not seem to be any syntax highlighting for this new feature -- as this screenshot indicates:

image

<x-modal.trigger> relates to a blade component within the modal component directory whereas <x-slot:trigger> relates to a named slot within the <x-modal> component.

It would be nice if we could have syntax highlighting for <x-slot:trigger> similar to what we have for <x-modal.trigger>. Even better would be to have a different color for :trigger then we have for x-slot to easily see which slot we are accessing.

zpoll92 commented 2 years ago

I have the same issue. Also, the formatting of texts is not functioning correctly inside those tags.

sclause2412 commented 1 year ago

According to https://laravel.com/docs/10.x/blade#slots the named slot closing tag can be simplified to </x-slot>. I tested it and both variants work with Laravel:

<x-slot:trigger>Open Modal</x-slot:trigger>
<x-slot:trigger>Open Modal</x-slot>

Therefore, both variants should be supported.

For the moment I will use the long version as the indentation is done correctly, while using the short version destroys the layout.