mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
nvim: treesitter: fix blade/php highlight
This commit is contained in:
parent
0ac177ee21
commit
23a91b642f
5 changed files with 66 additions and 1 deletions
5
nvim/queries/blade/highlights.scm
Normal file
5
nvim/queries/blade/highlights.scm
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(directive) @keyword
|
||||
(directive_start) @keyword
|
||||
(directive_end) @keyword
|
||||
(comment) @comment
|
||||
(keyword) @keyword
|
||||
15
nvim/queries/blade/injections.scm
Normal file
15
nvim/queries/blade/injections.scm
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
((text) @injection.content
|
||||
(#not-has-ancestor? @injection.content "envoy")
|
||||
(#set! injection.combined)
|
||||
(#set! injection.language php))
|
||||
|
||||
; could be bash or zsh
|
||||
; or whatever tree-sitter grammar you have.
|
||||
((text) @injection.content
|
||||
(#has-ancestor? @injection.content "envoy")
|
||||
(#set! injection.combined)
|
||||
(#set! injection.language bash))
|
||||
|
||||
|
||||
((php_only) @injection.content (#set! injection.language php))
|
||||
((parameter) @injection.content (#set! injection.language php))
|
||||
23
nvim/queries/php/highlights.scm
Normal file
23
nvim/queries/php/highlights.scm
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
; inherits: php_only
|
||||
|
||||
; php tags should be tagged as preprocessor tokens
|
||||
(php_tag) @preproc
|
||||
|
||||
; Tag names in class definition as regular text.
|
||||
(class_declaration [
|
||||
name: (name) @text
|
||||
(base_clause (name) @text)
|
||||
(class_interface_clause (name) @text)
|
||||
])
|
||||
|
||||
; tag "use" traits as text
|
||||
(use_declaration (name) @text)
|
||||
|
||||
; tag namespace classes in "use" as text
|
||||
(namespace_use_declaration (namespace_use_clause [
|
||||
(qualified_name [
|
||||
(name) @text
|
||||
(namespace_name_as_prefix (namespace_name (name) @text))
|
||||
])
|
||||
(namespace_aliasing_clause (name) @text)
|
||||
]))
|
||||
Loading…
Add table
Add a link
Reference in a new issue