Add support for detecting tests in source files, and implement it for Rust (#11195)

Continuing work from #10873 

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Piotr Osiewicz
2024-05-05 16:32:48 +02:00
committed by GitHub
co-authored by Mikayla
parent 14c7782ce6
commit 5a71d8c7f1
29 changed files with 1147 additions and 605 deletions
+1
View File
@@ -389,6 +389,7 @@ impl ContextProvider for RustContextProvider {
"--".into(),
"--nocapture".into(),
],
tags: vec!["rust-test".to_owned()],
..TaskTemplate::default()
},
TaskTemplate {
+7
View File
@@ -0,0 +1,7 @@
(
(attribute_item (attribute) @_attribute
(#match? @_attribute ".*test.*"))
.
(function_item
name: (_) @run)
) @rust-test