mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-26 00:19:46 +00:00
go: support highlight regexp (#11538)
Before: <img width="521" alt="image" src="https://github.com/zed-industries/zed/assets/45585937/7b87e552-0cf0-4168-933f-21d1ae84bf64"> After: <img width="499" alt="image" src="https://github.com/zed-industries/zed/assets/45585937/f1171375-8c22-4186-a5f1-1bdfa56cf01f"> Release Notes: - Added go regexp highlighting
This commit is contained in:
parent
1669ff80df
commit
9d681bda8d
1 changed files with 13 additions and 0 deletions
13
crates/languages/src/go/injections.scm
Normal file
13
crates/languages/src/go/injections.scm
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
; Refer to https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/go/injections.scm#L4C1-L16C41
|
||||||
|
(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)
|
||||||
|
] @content
|
||||||
|
(#set! "language" "regex")))
|
Loading…
Reference in a new issue