Add Buffer::outline method

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2022-01-12 18:17:49 -08:00
co-authored by Nathan Sobo
parent 057dc62b90
commit 63a401ac5d
11 changed files with 224 additions and 4 deletions
+1
View File
@@ -43,6 +43,7 @@ gpui = { path = "../gpui" }
journal = { path = "../journal" }
language = { path = "../language" }
lsp = { path = "../lsp" }
outline = { path = "../outline" }
project = { path = "../project" }
project_panel = { path = "../project_panel" }
rpc = { path = "../rpc" }
+17
View File
@@ -0,0 +1,17 @@
(impl_item
"impl" @context
type: (_) @name) @item
(function_item
(visibility_modifier)? @context
"fn" @context
name: (identifier) @name) @item
(struct_item
(visibility_modifier)? @context
"struct" @context
name: (type_identifier) @name) @item
(field_declaration
(visibility_modifier)? @context
name: (field_identifier) @name) @item
+2
View File
@@ -24,6 +24,8 @@ fn rust() -> Language {
.unwrap()
.with_indents_query(load_query("rust/indents.scm").as_ref())
.unwrap()
.with_outline_query(load_query("rust/outline.scm").as_ref())
.unwrap()
}
fn markdown() -> Language {
+1
View File
@@ -59,6 +59,7 @@ fn main() {
go_to_line::init(cx);
file_finder::init(cx);
chat_panel::init(cx);
outline::init(cx);
project_panel::init(cx);
diagnostics::init(cx);
cx.spawn({