Release Notes: - Improved Go syntax highlighting. | Zed 0.174.6 | With this PR | | --- | --- | |  |  | - `package_identifier`: `namespace`, language-agnostic scope for modules, packages, namespaces - `method_elem`: `function.method` - `;` ,`.` ,`,` ,`:`: `punctuation.delimiter` ```go package my_package import ( pkg "fmt" ) type A interface { method_elem(foo int, bar float64) int } func main() { identifier := true const constant int = 3 for i := 0; i <= 3; i++ { pkg.Println(identifier) } } ``` --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com>
139 lines
1.5 KiB
Scheme
139 lines
1.5 KiB
Scheme
(identifier) @variable
|
|
|
|
(type_identifier) @type
|
|
(field_identifier) @variable.member
|
|
(package_identifier) @namespace
|
|
|
|
(keyed_element
|
|
.
|
|
(literal_element
|
|
(identifier) @variable.member))
|
|
|
|
(call_expression
|
|
function: (identifier) @function)
|
|
|
|
(call_expression
|
|
function: (selector_expression
|
|
field: (field_identifier) @function.method))
|
|
|
|
(function_declaration
|
|
name: (identifier) @function)
|
|
|
|
(method_declaration
|
|
name: (field_identifier) @function.method)
|
|
(method_elem
|
|
name: (field_identifier) @function.method)
|
|
|
|
[
|
|
";"
|
|
"."
|
|
","
|
|
":"
|
|
] @punctuation.delimiter
|
|
|
|
[
|
|
"("
|
|
")"
|
|
"{"
|
|
"}"
|
|
"["
|
|
"]"
|
|
] @punctuation.bracket
|
|
|
|
[
|
|
"--"
|
|
"-"
|
|
"-="
|
|
":="
|
|
"!"
|
|
"!="
|
|
"..."
|
|
"*"
|
|
"*"
|
|
"*="
|
|
"/"
|
|
"/="
|
|
"&"
|
|
"&&"
|
|
"&="
|
|
"%"
|
|
"%="
|
|
"^"
|
|
"^="
|
|
"+"
|
|
"++"
|
|
"+="
|
|
"<-"
|
|
"<"
|
|
"<<"
|
|
"<<="
|
|
"<="
|
|
"="
|
|
"=="
|
|
">"
|
|
">="
|
|
">>"
|
|
">>="
|
|
"|"
|
|
"|="
|
|
"||"
|
|
"~"
|
|
] @operator
|
|
|
|
[
|
|
"break"
|
|
"case"
|
|
"chan"
|
|
"const"
|
|
"continue"
|
|
"default"
|
|
"defer"
|
|
"else"
|
|
"fallthrough"
|
|
"for"
|
|
"func"
|
|
"go"
|
|
"goto"
|
|
"if"
|
|
"import"
|
|
"interface"
|
|
"map"
|
|
"package"
|
|
"range"
|
|
"return"
|
|
"select"
|
|
"struct"
|
|
"switch"
|
|
"type"
|
|
"var"
|
|
] @keyword
|
|
|
|
[
|
|
(interpreted_string_literal)
|
|
(raw_string_literal)
|
|
(rune_literal)
|
|
] @string
|
|
|
|
(escape_sequence) @string.escape
|
|
|
|
[
|
|
(int_literal)
|
|
(float_literal)
|
|
(imaginary_literal)
|
|
] @number
|
|
|
|
(const_spec
|
|
name: (identifier) @constant)
|
|
|
|
[
|
|
(true)
|
|
(false)
|
|
] @boolean
|
|
|
|
[
|
|
(nil)
|
|
(iota)
|
|
] @constant.builtin
|
|
|
|
(comment) @comment
|