Skip to content

Commit 5d23d8b

Browse files
committed
Add runnables::related_tests
1 parent a8cf346 commit 5d23d8b

File tree

4 files changed

+346
-7
lines changed

4 files changed

+346
-7
lines changed

crates/cfg/src/cfg_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl fmt::Display for CfgAtom {
4949
}
5050
}
5151

52-
#[derive(Debug, Clone, PartialEq, Eq)]
52+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5353
pub enum CfgExpr {
5454
Invalid,
5555
Atom(CfgAtom),

crates/ide/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,15 @@ impl Analysis {
445445
self.with_db(|db| runnables::runnables(db, file_id))
446446
}
447447

448+
/// Returns the set of tests for the given file position.
449+
pub fn related_tests(
450+
&self,
451+
position: FilePosition,
452+
search_scope: Option<SearchScope>,
453+
) -> Cancelable<Vec<Runnable>> {
454+
self.with_db(|db| runnables::related_tests(db, position, search_scope))
455+
}
456+
448457
/// Computes syntax highlighting for the given file
449458
pub fn highlight(&self, file_id: FileId) -> Cancelable<Vec<HlRange>> {
450459
self.with_db(|db| syntax_highlighting::highlight(db, file_id, None, false))

0 commit comments

Comments
 (0)