From 5cf3434c694a94fccfca79588654e57053a68572 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 14 Dec 2024 19:51:37 -0800 Subject: [PATCH] feat(go): string regex highlights --- queries/go/highlights.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/queries/go/highlights.scm b/queries/go/highlights.scm index 62497b0c9..7675cb790 100644 --- a/queries/go/highlights.scm +++ b/queries/go/highlights.scm @@ -237,3 +237,18 @@ ; Spell ((interpreted_string_literal) @spell (#not-has-parent? @spell import_spec)) + +; Regex +(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 + (raw_string_literal_content) @string.regexp) + (interpreted_string_literal + (interpreted_string_literal_content) @string.regexp) + ]))