mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(lua): add luap injections
This commit is contained in:
parent
c9d7918901
commit
25f99a270a
1 changed files with 26 additions and 0 deletions
|
|
@ -19,4 +19,30 @@
|
|||
;; highlight string as query if starts with `;; query`
|
||||
((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query"))
|
||||
|
||||
; string.match("123", "%d+")
|
||||
(function_call
|
||||
(dot_index_expression
|
||||
field: (identifier) @_method
|
||||
(#any-of? @_method "find" "match"))
|
||||
arguments: (arguments (_) . (string content: _ @luap)))
|
||||
|
||||
(function_call
|
||||
(dot_index_expression
|
||||
field: (identifier) @_method
|
||||
(#eq? @_method "gmatch" "gsub"))
|
||||
arguments: (arguments (_) (string content: _ @luap)))
|
||||
|
||||
; ("123"):match("%d+")
|
||||
(function_call
|
||||
(method_index_expression
|
||||
method: (identifier) @_method
|
||||
(#any-of? @_method "find" "match"))
|
||||
arguments: (arguments . (string content: _ @luap)))
|
||||
|
||||
(function_call
|
||||
(method_index_expression
|
||||
method: (identifier) @_method
|
||||
(#any-of? @_method "gmatch" "gsub"))
|
||||
arguments: (arguments (string content: _ @luap)))
|
||||
|
||||
(comment) @comment
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue