Improve Go syntax highlighting (#25327)
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>
This commit is contained in:
parent
a97a2ebf35
commit
7deceb62dc
1 changed files with 10 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
(type_identifier) @type
|
||||
(field_identifier) @variable.member
|
||||
(package_identifier) @namespace
|
||||
|
||||
(keyed_element
|
||||
.
|
||||
|
@ -20,6 +21,15 @@
|
|||
|
||||
(method_declaration
|
||||
name: (field_identifier) @function.method)
|
||||
(method_elem
|
||||
name: (field_identifier) @function.method)
|
||||
|
||||
[
|
||||
";"
|
||||
"."
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue