on master help sign in
syntax: Improve go highlights
ade1a45Blaž Hrastnik
runtime/queries/go/highlights.scm+35−4
@@ -17,9 +17,18 @@
17
17
18; Identifiers
18; Identifiers
19
19
20+((identifier) @constant (match? @constant "^[A-Z][A-Z\\d_]+$"))
21+(const_spec
22+ name: (identifier) @constant)
23+
20(type_identifier) @type
24(type_identifier) @type
21(field_identifier) @property
25(field_identifier) @property
22(identifier) @variable
26(identifier) @variable
27+(package_identifier) @variable
28+
29+(parameter_declaration (identifier) @variable.parameter)
30+(variadic_parameter_declaration (identifier) @variable.parameter)
31+
23
32
24; Operators
33; Operators
25
34
@@ -79,10 +88,8 @@
79 "go"
88 "go"
80 "goto"
89 "goto"
81 "if"
90 "if"
82− "import"
83 "interface"
91 "interface"
84 "map"
92 "map"
85− "package"
86 "range"
93 "range"
87 "return"
94 "return"
88 "select"
95 "select"
@@ -92,6 +99,29 @@
92 "var"
99 "var"
93] @keyword
100] @keyword
94
101
102+[
103+ "import"
104+ "package"
105+] @keyword.control.import
106+
107+; Delimiters
108+
109+[
110+ ":"
111+ "."
112+ ","
113+ ";"
114+] @punctuation.delimiter
115+
116+[
117+ "("
118+ ")"
119+ "["
120+ "]"
121+ "{"
122+ "}"
123+] @punctuation.bracket
124+
95; Literals
125; Literals
96
126
97[
127[
@@ -111,7 +141,8 @@
111[
141[
112 (true)
142 (true)
113 (false)
143 (false)
114− (nil)
144+] @constant.builtin.boolean
145+
115−] @constant.builtin
146+(nil) @constant.builtin
116
147
117(comment) @comment
148(comment) @comment