Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
(identifier) @variable
(type_identifier) @type
(type_spec
name: (type_identifier) @type.definition)
((type_identifier) @type.builtin
(#any-of? @type.builtin
"any" "bool" "byte" "comparable" "complex64" "complex128" "error" "float32" "float64" "int"
"int8" "int16" "int32" "int64" "rune" "string" "uint" "uint8" "uint16" "uint32" "uint64"
"uintptr"))
(type_parameter_declaration
name: (identifier) @type)
(field_identifier) @property
(package_identifier) @namespace
(label_name) @label
(keyed_element
.
(literal_element
(identifier) @property))
(call_expression
function: (identifier) @function.call)
(call_expression
function: (selector_expression
field: (field_identifier) @function.method.call))
((call_expression
function: (identifier) @function.builtin)
(#any-of? @function.builtin
"append" "cap" "clear" "close" "complex" "copy" "delete" "imag" "len" "make" "max" "min" "new"
"panic" "print" "println" "real" "recover"))
(function_declaration
name: (identifier) @function)
(method_declaration
name: (field_identifier) @function.method)
(method_elem
name: (field_identifier) @function.method)
[
";"
"."
","
":"
] @punctuation.delimiter
[
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket
[
"--"
"-"
"-="
":="
"!"
"!="
"..."
"*"
"*"
"*="
"/"
"/="
"&"
"&&"
"&="
"%"
"%="
"^"
"^="
"+"
"++"
"+="
"<-"
"<"
"<<"
"<<="
"<="
"="
"=="
">"
">="
">>"
">>="
"|"
"|="
"||"
"~"
] @operator
[
"chan"
"const"
"func"
"import"
"interface"
"map"
"package"
"struct"
"type"
"var"
] @keyword
[
"break"
"case"
"continue"
"default"
"defer"
"else"
"fallthrough"
"for"
"go"
"goto"
"if"
"range"
"return"
"select"
"switch"
] @keyword.control
[
(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
; Go directives
((comment) @preproc
(#match? @preproc "^//go:"))
((comment) @preproc
(#match? @preproc "^// \\+build"))