diff options
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/runnables.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index 7c92b7625..d8cf66168 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs | |||
@@ -5,7 +5,10 @@ use cfg::CfgExpr; | |||
5 | use hir::{AsAssocItem, HasAttrs, HasSource, Semantics}; | 5 | use hir::{AsAssocItem, HasAttrs, HasSource, Semantics}; |
6 | use ide_assists::utils::test_related_attribute; | 6 | use ide_assists::utils::test_related_attribute; |
7 | use ide_db::{ | 7 | use ide_db::{ |
8 | base_db::FilePosition, defs::Definition, search::SearchScope, RootDatabase, SymbolKind, | 8 | base_db::{FilePosition, FileRange}, |
9 | defs::Definition, | ||
10 | search::SearchScope, | ||
11 | RootDatabase, SymbolKind, | ||
9 | }; | 12 | }; |
10 | use itertools::Itertools; | 13 | use itertools::Itertools; |
11 | use rustc_hash::FxHashSet; | 14 | use rustc_hash::FxHashSet; |
@@ -168,7 +171,7 @@ fn find_related_tests_in_module( | |||
168 | }; | 171 | }; |
169 | 172 | ||
170 | let file_id = mod_source.file_id.original_file(sema.db); | 173 | let file_id = mod_source.file_id.original_file(sema.db); |
171 | let mod_scope = SearchScope::file_part(file_id, range); | 174 | let mod_scope = SearchScope::file_range(FileRange { file_id, range }); |
172 | let fn_pos = FilePosition { file_id, offset: fn_name.syntax().text_range().start() }; | 175 | let fn_pos = FilePosition { file_id, offset: fn_name.syntax().text_range().start() }; |
173 | find_related_tests(sema, fn_pos, Some(mod_scope), tests) | 176 | find_related_tests(sema, fn_pos, Some(mod_scope), tests) |
174 | } | 177 | } |