From a079c3b3523532f79ed90d502d61c1013df71e4e Mon Sep 17 00:00:00 2001 From: chbk Date: Fri, 21 Feb 2025 13:29:01 +0100 Subject: [PATCH 1/2] Improve Go syntax highlighting --- crates/languages/src/go/highlights.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/languages/src/go/highlights.scm b/crates/languages/src/go/highlights.scm index 609c49c13f53cf..0070313873b811 100644 --- a/crates/languages/src/go/highlights.scm +++ b/crates/languages/src/go/highlights.scm @@ -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 [ "(" @@ -113,11 +123,14 @@ ] @number (const_spec - name: (identifier) @constant) + name: (identifier) @constant.variable) [ (true) (false) +] @boolean + +[ (nil) (iota) ] @constant.builtin From abe5846992ad251bb9d798260cfacde492f37dfd Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 21 Feb 2025 10:59:48 -0500 Subject: [PATCH 2/2] Remove `@constant.variable` --- crates/languages/src/go/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/languages/src/go/highlights.scm b/crates/languages/src/go/highlights.scm index 0070313873b811..5aa23fca90b7e0 100644 --- a/crates/languages/src/go/highlights.scm +++ b/crates/languages/src/go/highlights.scm @@ -123,7 +123,7 @@ ] @number (const_spec - name: (identifier) @constant.variable) + name: (identifier) @constant) [ (true)