mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
44
runtime/queries/luau/injections.scm
Normal file
44
runtime/queries/luau/injections.scm
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
((function_call
|
||||
name: [
|
||||
(identifier) @_cdef_identifier
|
||||
(_
|
||||
_
|
||||
(identifier) @_cdef_identifier)
|
||||
]
|
||||
arguments: (arguments
|
||||
(string
|
||||
content: _ @injection.content)))
|
||||
(#eq? @_cdef_identifier "cdef")
|
||||
(#set! injection.language "c"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#lua-match? @injection.content "[-][-][-][%s]*@")
|
||||
(#offset! @injection.content 0 3 0 0)
|
||||
(#set! injection.language "luadoc"))
|
||||
|
||||
; string.match("123", "%d+")
|
||||
(function_call
|
||||
(dot_index_expression
|
||||
field: (identifier) @_method
|
||||
(#any-of? @_method "find" "format" "match" "gmatch" "gsub"))
|
||||
arguments: (arguments
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(string
|
||||
content: _ @injection.content))
|
||||
(#set! injection.language "luap"))
|
||||
|
||||
; ("123"):match("%d+")
|
||||
(function_call
|
||||
(method_index_expression
|
||||
method: (identifier) @_method
|
||||
(#any-of? @_method "find" "format" "match" "gmatch" "gsub"))
|
||||
arguments: (arguments
|
||||
.
|
||||
(string
|
||||
content: _ @injection.content))
|
||||
(#set! injection.language "luap"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue