Leverage embeddings query to collapse syntax nodes if not selected (#3067)

Reverts zed-industries/zed#3049
This commit is contained in:
Kyle Caverly
2023-10-03 12:02:47 +03:00
committed by GitHub
6 changed files with 481 additions and 107 deletions
@@ -305,6 +305,11 @@ async fn test_code_context_retrieval_rust() {
todo!();
}
}
#[derive(Clone)]
struct D {
name: String
}
"
.unindent();
@@ -361,6 +366,15 @@ async fn test_code_context_retrieval_rust() {
.unindent(),
text.find("fn function_2").unwrap(),
),
(
"
#[derive(Clone)]
struct D {
name: String
}"
.unindent(),
text.find("struct D").unwrap(),
),
],
);
}
@@ -1422,6 +1436,9 @@ fn rust_lang() -> Arc<Language> {
name: (_) @name)
] @item
)
(attribute_item) @collapse
(use_declaration) @collapse
"#,
)
.unwrap(),