fix: cleanup luap injection queries

This commit is contained in:
Riley Bruins 2023-12-23 13:01:41 -08:00 committed by Christian Clason
parent 92572c0dfd
commit cd4de5f7b1
2 changed files with 5 additions and 41 deletions

View file

@ -114,19 +114,7 @@
(function_call
(dot_index_expression
field: (identifier) @_method
(#any-of? @_method "find" "match"))
arguments: (arguments
. (_)
.
(string
content: (string_content) @injection.content
(#set! injection.language "luap")
(#set! injection.include-children))))
(function_call
(dot_index_expression
field: (identifier) @_method
(#any-of? @_method "gmatch" "gsub"))
(#any-of? @_method "find" "match" "gmatch" "gsub"))
arguments: (arguments
. (_)
.
@ -140,23 +128,13 @@
(function_call
(method_index_expression
method: (identifier) @_method
(#any-of? @_method "find" "match"))
(#any-of? @_method "find" "match" "gmatch" "gsub"))
arguments: (arguments
. (string
content: (string_content) @injection.content
(#set! injection.language "luap")
(#set! injection.include-children))))
(function_call
(method_index_expression
method: (identifier) @_method
(#any-of? @_method "gmatch" "gsub"))
arguments: (arguments
. (string
content: (string_content) @injection.content
(#set! injection.language "luap")
(#set! injection.include-children))))
(comment
content: (_) @injection.content
(#set! injection.language "comment"))

View file

@ -16,31 +16,17 @@
(function_call
(dot_index_expression
field: (identifier) @_method
(#any-of? @_method "find" "format" "match"))
arguments: (arguments (_) . (string content: _ @injection.content))
(#set! injection.language "luap"))
(function_call
(dot_index_expression
field: (identifier) @_method
(#any-of? @_method "gmatch" "gsub"))
arguments: (arguments (_) (string content: _ @injection.content))
(#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"))
(#any-of? @_method "find" "format" "match" "gmatch" "gsub"))
arguments: (arguments . (string content: _ @injection.content))
(#set! injection.language "luap"))
(function_call
(method_index_expression
method: (identifier) @_method
(#any-of? @_method "gmatch" "gsub"))
arguments: (arguments (string content: _ @injection.content))
(#set! injection.language "luap"))
((comment) @injection.content
(#set! injection.language "comment"))