aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-12-14 19:51:37 -0800
committerChristian Clason <ch.clason+github@icloud.com>2024-12-15 12:02:42 +0100
commit5cf3434c694a94fccfca79588654e57053a68572 (patch)
tree183be2a13a9bd0de16eabff0e6bba38229769f4b /queries
parentfix(go): properly apply injections in strings (diff)
downloadnvim-treesitter-5cf3434c694a94fccfca79588654e57053a68572.tar
nvim-treesitter-5cf3434c694a94fccfca79588654e57053a68572.tar.gz
nvim-treesitter-5cf3434c694a94fccfca79588654e57053a68572.tar.bz2
nvim-treesitter-5cf3434c694a94fccfca79588654e57053a68572.tar.lz
nvim-treesitter-5cf3434c694a94fccfca79588654e57053a68572.tar.xz
nvim-treesitter-5cf3434c694a94fccfca79588654e57053a68572.tar.zst
nvim-treesitter-5cf3434c694a94fccfca79588654e57053a68572.zip
feat(go): string regex highlights
Diffstat (limited to 'queries')
-rw-r--r--queries/go/highlights.scm15
1 files changed, 15 insertions, 0 deletions
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)
+ ]))