From 2fe41574a1695a6608d738f40ec51bc61fc7604a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 19 Dec 2018 16:19:53 +0300 Subject: fix tests --- crates/ra_hir/src/mock.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index 54260101c..9423e6571 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs @@ -2,12 +2,14 @@ use std::sync::Arc; use parking_lot::Mutex; use salsa::{self, Database}; -use ra_db::{LocationIntener, BaseDatabase, FilePosition, FileId, WORKSPACE, CrateGraph, SourceRoot}; +use ra_db::{LocationIntener, BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId}; use relative_path::RelativePathBuf; use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; use crate::{db, DefId, DefLoc}; +const WORKSPACE: SourceRootId = SourceRootId(0); + #[derive(Debug)] pub(crate) struct MockDatabase { events: Mutex>>>, @@ -106,11 +108,11 @@ impl Default for MockDatabase { runtime: salsa::Runtime::default(), id_maps: Default::default(), }; - db.query_mut(ra_db::SourceRootQuery) - .set(ra_db::WORKSPACE, Default::default()); db.query_mut(ra_db::CrateGraphQuery) .set((), Default::default()); - db.query_mut(ra_db::LibrariesQuery) + db.query_mut(ra_db::LocalRootsQuery) + .set((), Default::default()); + db.query_mut(ra_db::LibraryRootsQuery) .set((), Default::default()); db } @@ -163,7 +165,8 @@ salsa::database_storage! { fn file_relative_path() for ra_db::FileRelativePathQuery; fn file_source_root() for ra_db::FileSourceRootQuery; fn source_root() for ra_db::SourceRootQuery; - fn libraries() for ra_db::LibrariesQuery; + fn local_roots() for ra_db::LocalRootsQuery; + fn library_roots() for ra_db::LibraryRootsQuery; fn crate_graph() for ra_db::CrateGraphQuery; } impl ra_db::SyntaxDatabase { -- cgit v1.2.3