fixup! feat(nvim): Laravel support in nvim

This commit is contained in:
punkfairie 2024-03-09 18:44:59 -08:00
parent 1c2fad489a
commit 9aa0560b27
Signed by: punkfairie
GPG key ID: A86AF57F837E320F
6 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,36 @@
;; extends
; AlpineJS attributes
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^x%-%l")
(#not-any-of? @_attr "x-teleport" "x-ref" "x-transition")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "javascript"))
; Blade escaped JS attributes
; <x-foo ::bar="baz" />
(element
(_
(tag_name) @_tag
(#lua-match? @_tag "^x%-%l")
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^::%l")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "javascript"))))
; Blade PHP attributes
; <x-foo :bar="$baz" />
(element
(_
(tag_name) @_tag
(#lua-match? @_tag "^x%-%l")
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^:%l")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "php_only"))))

View file

@ -0,0 +1,10 @@
;; extends
[
; prevent double indent for `return new class ...`
(return_statement
(object_creation_expression))
; prevent double indent for `return function() { ... }`
(return_statement
(anonymous_function_creation_expression))
] @indent.dedent

View file

@ -0,0 +1,8 @@
((directive_start) @start
(directive_end) @end.after
(#set! role block))
((bracket_start) @start
(bracket_end) @end
(#set! role block))

View file

@ -0,0 +1,4 @@
(directive) @tag
(directive_start) @tag
(directive_end) @tag
(comment) @comment @spell

View file

@ -0,0 +1,15 @@
((text) @injection.content
(#not-has-ancestor? @injection.content "envoy")
(#set! injection.combined)
(#set! injection.language php))
((text) @injection.content
(#has-ancestor? @injection.content "envoy")
(#set! injection.combined)
(#set! injection.language bash))
((php_only) @injection.content
(#set! injection.combined)
(#set! injection.language php_only))
((parameter) @injection.content
(#set! injection.language php_only))

2
.gitignore vendored
View file

@ -78,3 +78,5 @@ hackin/
.config/Thunar/
.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
.config/composer/vendor/
go/pkg
.config/systemd/