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) + ]))