From ecb4a1f54a803c620eb7d541d0b3628c8beaf45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Sat, 3 Feb 2024 10:12:52 +0000 Subject: [PATCH] feat(queries): regex injection for golang --- runtime/queries/go/injections.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/queries/go/injections.scm b/runtime/queries/go/injections.scm index 321c90add371..d7b03da35630 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")))