feat(go): string regex highlights

This commit is contained in:
Riley Bruins 2024-12-14 19:51:37 -08:00 committed by Christian Clason
parent 89ecadd2b1
commit 5cf3434c69

View file

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