Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

outline: Fix uninitiated var declaration not showing in outline (#46499)

Haojian Wu336bc3c26aea
diff --git a/crates/languages/src/cpp/outline.scm b/crates/languages/src/cpp/outline.scm
index 1f20bf693c2..f9697eba303 100644
--- a/crates/languages/src/cpp/outline.scm
+++ b/crates/languages/src/cpp/outline.scm
@@ -51,10 +51,13 @@
(type_qualifier)
]* @context
type: (_) @context
- declarator: (init_declarator
- ; The declaration may define multiple variables, using @item on the
- ; declarator so that they get distinct ranges.
- declarator: (_) @item @name))
+ declarator: [
+ ; The declaration may define multiple variables, using @item on the
+ ; declarator so that they get distinct ranges.
+ (init_declarator
+ declarator: (_) @item @name)
+ (identifier) @item @name
+ ] @item)
(function_definition
(type_qualifier)? @context