aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/go/injections.scm
diff options
context:
space:
mode:
authorMatouš Dzivjak2024-02-03 23:27:40 +0000
committerGitHub2024-02-03 23:27:40 +0000
commitd54545281956bd92f52aad0ced008ae093df2b2c (patch)
tree7d3dd06b5b2d4c3c10a1b3c98976ed461b3c7d0f /runtime/queries/go/injections.scm
parent81ae768a4ea20543bc16246a46552a69204fd7c1 (diff)
feat(queries): regex injection for golang (#9510)
Diffstat (limited to 'runtime/queries/go/injections.scm')
-rw-r--r--runtime/queries/go/injections.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/queries/go/injections.scm b/runtime/queries/go/injections.scm
index 321c90ad..d7b03da3 100644
--- a/runtime/queries/go/injections.scm
+++ b/runtime/queries/go/injections.scm
@@ -1,2 +1,14 @@
((comment) @injection.content
(#set! injection.language "comment"))
+
+
+(call_expression
+ (selector_expression) @_function
+ (#any-of? @_function "regexp.Match" "regexp.MatchReader" "regexp.MatchString" "regexp.Compile" "regexp.CompilePOSIX" "regexp.MustCompile" "regexp.MustCompilePOSIX")
+ (argument_list
+ .
+ [
+ (raw_string_literal)
+ (interpreted_string_literal)
+ ] @injection.content
+ (#set! injection.language "regex")))