Add Buffer::outline method
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
057dc62b90
commit
63a401ac5d
@@ -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" }
|
||||
|
||||
@@ -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
|
||||
@@ -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 {
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user