internal: Move out WithFixture into dev-dep only crate

This commit is contained in:
Lukas Wirth 2023-12-18 14:53:11 +01:00
parent ec6162308e
commit f49a2fed3f
59 changed files with 189 additions and 119 deletions

View file

@ -65,8 +65,8 @@ fn parser_undefined_placeholder_in_replacement() {
/// `code` may optionally contain a cursor marker `$0`. If it doesn't, then the position will be
/// the start of the file. If there's a second cursor marker, then we'll return a single range.
pub(crate) fn single_file(code: &str) -> (ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
use hir::WithFixture;
use ide_db::symbol_index::SymbolsDatabase;
use test_fixture::{WithFixture, WORKSPACE};
let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) {
ide_db::RootDatabase::with_range_or_offset(code)
} else {
@ -86,7 +86,7 @@ pub(crate) fn single_file(code: &str) -> (ide_db::RootDatabase, FilePosition, Ve
}
}
let mut local_roots = FxHashSet::default();
local_roots.insert(ide_db::fixture::WORKSPACE);
local_roots.insert(WORKSPACE);
db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH);
(db, position, selections)
}