updated vector store indexing to only use languages with an embedding.scm treesitter query
Co-authored-by: maxbrunsfeld <max@zed.dev>
This commit is contained in:
parent
0db0876289
commit
36907bb4dc
5 changed files with 98 additions and 7 deletions
|
@ -170,6 +170,7 @@ fn load_queries(name: &str) -> LanguageQueries {
|
|||
brackets: load_query(name, "/brackets"),
|
||||
indents: load_query(name, "/indents"),
|
||||
outline: load_query(name, "/outline"),
|
||||
embedding: load_query(name, "/embedding"),
|
||||
injections: load_query(name, "/injections"),
|
||||
overrides: load_query(name, "/overrides"),
|
||||
}
|
||||
|
|
36
crates/zed/src/languages/rust/embedding.scm
Normal file
36
crates/zed/src/languages/rust/embedding.scm
Normal file
|
@ -0,0 +1,36 @@
|
|||
(struct_item
|
||||
(visibility_modifier)? @context
|
||||
"struct" @context
|
||||
name: (_) @name) @item
|
||||
|
||||
(enum_item
|
||||
(visibility_modifier)? @context
|
||||
"enum" @context
|
||||
name: (_) @name) @item
|
||||
|
||||
(impl_item
|
||||
"impl" @context
|
||||
trait: (_)? @name
|
||||
"for"? @context
|
||||
type: (_) @name) @item
|
||||
|
||||
(trait_item
|
||||
(visibility_modifier)? @context
|
||||
"trait" @context
|
||||
name: (_) @name) @item
|
||||
|
||||
(function_item
|
||||
(visibility_modifier)? @context
|
||||
(function_modifiers)? @context
|
||||
"fn" @context
|
||||
name: (_) @name) @item
|
||||
|
||||
(function_signature_item
|
||||
(visibility_modifier)? @context
|
||||
(function_modifiers)? @context
|
||||
"fn" @context
|
||||
name: (_) @name) @item
|
||||
|
||||
(macro_definition
|
||||
. "macro_rules!" @context
|
||||
name: (_) @name) @item
|
Loading…
Add table
Add a link
Reference in a new issue