mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-07-16 04:14:29 +02:00
add: blade treesitter config
This commit is contained in:
parent
b9949062dc
commit
fbc8a53840
19 changed files with 177 additions and 14 deletions
4
after/queries/blade/highlights.scm
Normal file
4
after/queries/blade/highlights.scm
Normal file
|
@ -0,0 +1,4 @@
|
|||
(directive) @tag
|
||||
(directive_start) @tag
|
||||
(directive_end) @tag
|
||||
(comment) @comment @spell
|
16
after/queries/blade/injections.scm
Normal file
16
after/queries/blade/injections.scm
Normal file
|
@ -0,0 +1,16 @@
|
|||
((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))
|
36
after/queries/html/injections.scm
Normal file
36
after/queries/html/injections.scm
Normal 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"))))
|
10
after/queries/php/indents.scm
Normal file
10
after/queries/php/indents.scm
Normal 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
|
9
after/queries/php/injections.scm
Normal file
9
after/queries/php/injections.scm
Normal file
|
@ -0,0 +1,9 @@
|
|||
;; extends
|
||||
|
||||
; ((text) @injection.content
|
||||
; (#set! injection.language "html")
|
||||
; (#set! injection.combined))
|
||||
|
||||
; ((php) @injection.content
|
||||
; (#set! injection.language "php_only")
|
||||
; (#set! injection.combined))
|
Loading…
Add table
Add a link
Reference in a new issue