mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add test explorer
This commit is contained in:
parent
916914418a
commit
44be2432f5
19 changed files with 1083 additions and 172 deletions
|
@ -50,6 +50,7 @@ mod static_index;
|
|||
mod status;
|
||||
mod syntax_highlighting;
|
||||
mod syntax_tree;
|
||||
mod test_explorer;
|
||||
mod typing;
|
||||
mod view_crate_graph;
|
||||
mod view_hir;
|
||||
|
@ -108,6 +109,7 @@ pub use crate::{
|
|||
tags::{Highlight, HlMod, HlMods, HlOperator, HlPunct, HlTag},
|
||||
HighlightConfig, HlRange,
|
||||
},
|
||||
test_explorer::{TestItem, TestItemKind},
|
||||
};
|
||||
pub use hir::Semantics;
|
||||
pub use ide_assists::{
|
||||
|
@ -340,6 +342,18 @@ impl Analysis {
|
|||
self.with_db(|db| view_item_tree::view_item_tree(db, file_id))
|
||||
}
|
||||
|
||||
pub fn discover_test_roots(&self) -> Cancellable<Vec<TestItem>> {
|
||||
self.with_db(test_explorer::discover_test_roots)
|
||||
}
|
||||
|
||||
pub fn discover_tests_in_crate_by_test_id(&self, crate_id: &str) -> Cancellable<Vec<TestItem>> {
|
||||
self.with_db(|db| test_explorer::discover_tests_in_crate_by_test_id(db, crate_id))
|
||||
}
|
||||
|
||||
pub fn discover_tests_in_crate(&self, crate_id: CrateId) -> Cancellable<Vec<TestItem>> {
|
||||
self.with_db(|db| test_explorer::discover_tests_in_crate(db, crate_id))
|
||||
}
|
||||
|
||||
/// Renders the crate graph to GraphViz "dot" syntax.
|
||||
pub fn view_crate_graph(&self, full: bool) -> Cancellable<Result<String, String>> {
|
||||
self.with_db(|db| view_crate_graph::view_crate_graph(db, full))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue