From 10cd978e932bac789910353b27cad3e440ada5c2 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Fri, 2 Feb 2024 11:24:04 +0100 Subject: [PATCH] go: improve outline queries to get rid of whitespace (#7273) This changes the Go `outline.scm` queries a bit so that we don't have these stray whitespaces floating around. I'm sure there's more improvements possible, but for now I think this makes it look less wrong. Release Notes: - Improved outline and breadcrumbs for Go code. ## Before ![before](https://github.com/zed-industries/zed/assets/1185253/d2b93c41-639b-4819-b87e-d8456960c5a7) ## After ![after](https://github.com/zed-industries/zed/assets/1185253/1ff6efb1-75a4-487b-8947-f070073887d4) --- crates/zed/src/languages/go/outline.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/zed/src/languages/go/outline.scm b/crates/zed/src/languages/go/outline.scm index 2ff7ef25a0a9c9623f329369bfeccd2e8c1f2fd5..8823b7beb80129c7f7f5094b297bb378992a1c8b 100644 --- a/crates/zed/src/languages/go/outline.scm +++ b/crates/zed/src/languages/go/outline.scm @@ -7,20 +7,21 @@ "func" @context name: (identifier) @name parameters: (parameter_list - "(" @context - ")" @context)) @item + "(" + ")")) @item (method_declaration "func" @context receiver: (parameter_list "(" @context (parameter_declaration + name: (_) @name type: (_) @context) ")" @context) name: (field_identifier) @name parameters: (parameter_list - "(" @context - ")" @context)) @item + "(" + ")")) @item (const_declaration "const" @context @@ -40,4 +41,4 @@ ")" @context)) @item (field_declaration - name: (_) @name) @item \ No newline at end of file + name: (_) @name) @item