aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-13 15:31:49 +0100
committerGitHub <[email protected]>2020-08-13 15:31:49 +0100
commite9926948ca267932ccc1341388bfd1b3fa88a001 (patch)
treecc4b797cb39a40b59e9e3d37178e8a1907f12358 /crates
parent902f74c2697cc2a50de9067845814a2a852fccfd (diff)
parent50f8c1ebf23f634b68529603a917e3feeda457fa (diff)
Merge #5747
5747: Rename crate r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/base_db/Cargo.toml (renamed from crates/ra_db/Cargo.toml)8
-rw-r--r--crates/base_db/src/cancellation.rs (renamed from crates/ra_db/src/cancellation.rs)0
-rw-r--r--crates/base_db/src/fixture.rs (renamed from crates/ra_db/src/fixture.rs)0
-rw-r--r--crates/base_db/src/input.rs (renamed from crates/ra_db/src/input.rs)0
-rw-r--r--crates/base_db/src/lib.rs (renamed from crates/ra_db/src/lib.rs)2
-rw-r--r--crates/hir_def/Cargo.toml (renamed from crates/ra_hir_def/Cargo.toml)13
-rw-r--r--crates/hir_def/src/adt.rs (renamed from crates/ra_hir_def/src/adt.rs)0
-rw-r--r--crates/hir_def/src/attr.rs (renamed from crates/ra_hir_def/src/attr.rs)0
-rw-r--r--crates/hir_def/src/body.rs (renamed from crates/ra_hir_def/src/body.rs)4
-rw-r--r--crates/hir_def/src/body/lower.rs (renamed from crates/ra_hir_def/src/body/lower.rs)0
-rw-r--r--crates/hir_def/src/body/scope.rs (renamed from crates/ra_hir_def/src/body/scope.rs)2
-rw-r--r--crates/hir_def/src/builtin_type.rs (renamed from crates/ra_hir_def/src/builtin_type.rs)0
-rw-r--r--crates/hir_def/src/child_by_source.rs (renamed from crates/ra_hir_def/src/child_by_source.rs)0
-rw-r--r--crates/hir_def/src/data.rs (renamed from crates/ra_hir_def/src/data.rs)0
-rw-r--r--crates/hir_def/src/db.rs (renamed from crates/ra_hir_def/src/db.rs)2
-rw-r--r--crates/hir_def/src/diagnostics.rs (renamed from crates/ra_hir_def/src/diagnostics.rs)0
-rw-r--r--crates/hir_def/src/docs.rs (renamed from crates/ra_hir_def/src/docs.rs)0
-rw-r--r--crates/hir_def/src/dyn_map.rs (renamed from crates/ra_hir_def/src/dyn_map.rs)0
-rw-r--r--crates/hir_def/src/expr.rs (renamed from crates/ra_hir_def/src/expr.rs)0
-rw-r--r--crates/hir_def/src/find_path.rs (renamed from crates/ra_hir_def/src/find_path.rs)2
-rw-r--r--crates/hir_def/src/generics.rs (renamed from crates/ra_hir_def/src/generics.rs)2
-rw-r--r--crates/hir_def/src/import_map.rs (renamed from crates/ra_hir_def/src/import_map.rs)4
-rw-r--r--crates/hir_def/src/item_scope.rs (renamed from crates/ra_hir_def/src/item_scope.rs)2
-rw-r--r--crates/hir_def/src/item_tree.rs (renamed from crates/ra_hir_def/src/item_tree.rs)0
-rw-r--r--crates/hir_def/src/item_tree/lower.rs (renamed from crates/ra_hir_def/src/item_tree/lower.rs)0
-rw-r--r--crates/hir_def/src/item_tree/tests.rs (renamed from crates/ra_hir_def/src/item_tree/tests.rs)10
-rw-r--r--crates/hir_def/src/keys.rs (renamed from crates/ra_hir_def/src/keys.rs)0
-rw-r--r--crates/hir_def/src/lang_item.rs (renamed from crates/ra_hir_def/src/lang_item.rs)0
-rw-r--r--crates/hir_def/src/lib.rs (renamed from crates/ra_hir_def/src/lib.rs)2
-rw-r--r--crates/hir_def/src/nameres.rs (renamed from crates/ra_hir_def/src/nameres.rs)2
-rw-r--r--crates/hir_def/src/nameres/collector.rs (renamed from crates/ra_hir_def/src/nameres/collector.rs)4
-rw-r--r--crates/hir_def/src/nameres/mod_resolution.rs (renamed from crates/ra_hir_def/src/nameres/mod_resolution.rs)2
-rw-r--r--crates/hir_def/src/nameres/path_resolution.rs (renamed from crates/ra_hir_def/src/nameres/path_resolution.rs)2
-rw-r--r--crates/hir_def/src/nameres/tests.rs (renamed from crates/ra_hir_def/src/nameres/tests.rs)2
-rw-r--r--crates/hir_def/src/nameres/tests/globs.rs (renamed from crates/ra_hir_def/src/nameres/tests/globs.rs)0
-rw-r--r--crates/hir_def/src/nameres/tests/incremental.rs (renamed from crates/ra_hir_def/src/nameres/tests/incremental.rs)2
-rw-r--r--crates/hir_def/src/nameres/tests/macros.rs (renamed from crates/ra_hir_def/src/nameres/tests/macros.rs)0
-rw-r--r--crates/hir_def/src/nameres/tests/mod_resolution.rs (renamed from crates/ra_hir_def/src/nameres/tests/mod_resolution.rs)0
-rw-r--r--crates/hir_def/src/nameres/tests/primitives.rs (renamed from crates/ra_hir_def/src/nameres/tests/primitives.rs)0
-rw-r--r--crates/hir_def/src/path.rs (renamed from crates/ra_hir_def/src/path.rs)2
-rw-r--r--crates/hir_def/src/path/lower.rs (renamed from crates/ra_hir_def/src/path/lower.rs)0
-rw-r--r--crates/hir_def/src/path/lower/lower_use.rs (renamed from crates/ra_hir_def/src/path/lower/lower_use.rs)0
-rw-r--r--crates/hir_def/src/per_ns.rs (renamed from crates/ra_hir_def/src/per_ns.rs)0
-rw-r--r--crates/hir_def/src/resolver.rs (renamed from crates/ra_hir_def/src/resolver.rs)2
-rw-r--r--crates/hir_def/src/src.rs (renamed from crates/ra_hir_def/src/src.rs)0
-rw-r--r--crates/hir_def/src/test_db.rs (renamed from crates/ra_hir_def/src/test_db.rs)6
-rw-r--r--crates/hir_def/src/trace.rs (renamed from crates/ra_hir_def/src/trace.rs)0
-rw-r--r--crates/hir_def/src/type_ref.rs (renamed from crates/ra_hir_def/src/type_ref.rs)0
-rw-r--r--crates/hir_def/src/visibility.rs (renamed from crates/ra_hir_def/src/visibility.rs)0
-rw-r--r--crates/hir_expand/Cargo.toml (renamed from crates/ra_hir_expand/Cargo.toml)10
-rw-r--r--crates/hir_expand/src/ast_id_map.rs (renamed from crates/ra_hir_expand/src/ast_id_map.rs)0
-rw-r--r--crates/hir_expand/src/builtin_derive.rs (renamed from crates/ra_hir_expand/src/builtin_derive.rs)2
-rw-r--r--crates/hir_expand/src/builtin_macro.rs (renamed from crates/ra_hir_expand/src/builtin_macro.rs)4
-rw-r--r--crates/hir_expand/src/db.rs (renamed from crates/ra_hir_expand/src/db.rs)2
-rw-r--r--crates/hir_expand/src/diagnostics.rs (renamed from crates/ra_hir_expand/src/diagnostics.rs)0
-rw-r--r--crates/hir_expand/src/eager.rs (renamed from crates/ra_hir_expand/src/eager.rs)2
-rw-r--r--crates/hir_expand/src/hygiene.rs (renamed from crates/ra_hir_expand/src/hygiene.rs)2
-rw-r--r--crates/hir_expand/src/lib.rs (renamed from crates/ra_hir_expand/src/lib.rs)4
-rw-r--r--crates/hir_expand/src/name.rs (renamed from crates/ra_hir_expand/src/name.rs)2
-rw-r--r--crates/hir_expand/src/proc_macro.rs (renamed from crates/ra_hir_expand/src/proc_macro.rs)2
-rw-r--r--crates/hir_expand/src/quote.rs (renamed from crates/ra_hir_expand/src/quote.rs)0
-rw-r--r--crates/hir_expand/src/test_db.rs (renamed from crates/ra_hir_expand/src/test_db.rs)6
-rw-r--r--crates/project_model/Cargo.toml2
-rw-r--r--crates/project_model/src/cargo_workspace.rs2
-rw-r--r--crates/project_model/src/lib.rs2
-rw-r--r--crates/project_model/src/project_json.rs2
-rw-r--r--crates/ra_assists/Cargo.toml2
-rw-r--r--crates/ra_assists/src/assist_context.rs2
-rw-r--r--crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs2
-rw-r--r--crates/ra_assists/src/handlers/fix_visibility.rs2
-rw-r--r--crates/ra_assists/src/handlers/generate_function.rs2
-rw-r--r--crates/ra_assists/src/lib.rs2
-rw-r--r--crates/ra_assists/src/tests.rs2
-rw-r--r--crates/ra_hir/Cargo.toml6
-rw-r--r--crates/ra_hir/src/code_model.rs4
-rw-r--r--crates/ra_hir/src/from_id.rs2
-rw-r--r--crates/ra_hir/src/semantics.rs2
-rw-r--r--crates/ra_hir/src/semantics/source_to_def.rs2
-rw-r--r--crates/ra_hir/src/source_analyzer.rs2
-rw-r--r--crates/ra_hir_ty/Cargo.toml6
-rw-r--r--crates/ra_hir_ty/src/autoderef.rs2
-rw-r--r--crates/ra_hir_ty/src/db.rs2
-rw-r--r--crates/ra_hir_ty/src/diagnostics.rs2
-rw-r--r--crates/ra_hir_ty/src/lib.rs2
-rw-r--r--crates/ra_hir_ty/src/lower.rs2
-rw-r--r--crates/ra_hir_ty/src/method_resolution.rs2
-rw-r--r--crates/ra_hir_ty/src/test_db.rs6
-rw-r--r--crates/ra_hir_ty/src/tests.rs2
-rw-r--r--crates/ra_hir_ty/src/tests/simple.rs4
-rw-r--r--crates/ra_hir_ty/src/traits.rs2
-rw-r--r--crates/ra_hir_ty/src/traits/chalk.rs2
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/interner.rs2
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/mapping.rs2
-rw-r--r--crates/ra_ide/Cargo.toml2
-rw-r--r--crates/ra_ide/src/call_hierarchy.rs2
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs2
-rw-r--r--crates/ra_ide/src/diagnostics.rs2
-rw-r--r--crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs2
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs2
-rw-r--r--crates/ra_ide/src/goto_definition.rs2
-rw-r--r--crates/ra_ide/src/goto_implementation.rs2
-rw-r--r--crates/ra_ide/src/goto_type_definition.rs2
-rw-r--r--crates/ra_ide/src/hover.rs4
-rw-r--r--crates/ra_ide/src/lib.rs10
-rw-r--r--crates/ra_ide/src/mock_analysis.rs2
-rw-r--r--crates/ra_ide/src/parent_module.rs4
-rw-r--r--crates/ra_ide/src/references/rename.rs2
-rw-r--r--crates/ra_ide/src/ssr.rs2
-rw-r--r--crates/ra_ide/src/status.rs8
-rw-r--r--crates/ra_ide/src/syntax_highlighting/html.rs2
-rw-r--r--crates/ra_ide/src/syntax_tree.rs2
-rw-r--r--crates/ra_ide/src/typing.rs2
-rw-r--r--crates/ra_ide/src/typing/on_enter.rs2
-rw-r--r--crates/ra_ide_db/Cargo.toml2
-rw-r--r--crates/ra_ide_db/src/change.rs18
-rw-r--r--crates/ra_ide_db/src/lib.rs14
-rw-r--r--crates/ra_ide_db/src/search.rs2
-rw-r--r--crates/ra_ide_db/src/source_change.rs2
-rw-r--r--crates/ra_ide_db/src/symbol_index.rs6
-rw-r--r--crates/ra_ssr/Cargo.toml2
-rw-r--r--crates/ra_ssr/src/lib.rs8
-rw-r--r--crates/ra_ssr/src/matching.rs2
-rw-r--r--crates/ra_ssr/src/resolving.rs2
-rw-r--r--crates/ra_ssr/src/search.rs4
-rw-r--r--crates/ra_ssr/src/tests.rs6
-rw-r--r--crates/rust-analyzer/Cargo.toml4
-rw-r--r--crates/rust-analyzer/src/cli/analysis_bench.rs2
-rw-r--r--crates/rust-analyzer/src/cli/analysis_stats.rs8
-rw-r--r--crates/rust-analyzer/src/cli/diagnostics.rs2
-rw-r--r--crates/rust-analyzer/src/cli/load_cargo.rs2
-rw-r--r--crates/rust-analyzer/src/cli/ssr.rs4
-rw-r--r--crates/rust-analyzer/src/diagnostics/to_proto.rs12
-rw-r--r--crates/rust-analyzer/src/from_proto.rs2
-rw-r--r--crates/rust-analyzer/src/global_state.rs2
-rw-r--r--crates/rust-analyzer/src/lsp_utils.rs2
-rw-r--r--crates/rust-analyzer/src/main_loop.rs2
-rw-r--r--crates/rust-analyzer/src/reload.rs2
-rw-r--r--crates/rust-analyzer/src/to_proto.rs2
-rw-r--r--crates/rust-analyzer/test_data/macro_compiler_error.txt4
139 files changed, 183 insertions, 184 deletions
diff --git a/crates/ra_db/Cargo.toml b/crates/base_db/Cargo.toml
index ad432f096..7347d7528 100644
--- a/crates/ra_db/Cargo.toml
+++ b/crates/base_db/Cargo.toml
@@ -1,9 +1,9 @@
1[package] 1[package]
2edition = "2018" 2name = "base_db"
3name = "ra_db" 3version = "0.0.0"
4version = "0.1.0"
5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0" 4license = "MIT OR Apache-2.0"
5authors = ["rust-analyzer developers"]
6edition = "2018"
7 7
8[lib] 8[lib]
9doctest = false 9doctest = false
diff --git a/crates/ra_db/src/cancellation.rs b/crates/base_db/src/cancellation.rs
index 7420a1976..7420a1976 100644
--- a/crates/ra_db/src/cancellation.rs
+++ b/crates/base_db/src/cancellation.rs
diff --git a/crates/ra_db/src/fixture.rs b/crates/base_db/src/fixture.rs
index 5ff8ead0e..5ff8ead0e 100644
--- a/crates/ra_db/src/fixture.rs
+++ b/crates/base_db/src/fixture.rs
diff --git a/crates/ra_db/src/input.rs b/crates/base_db/src/input.rs
index f3d65cdf0..f3d65cdf0 100644
--- a/crates/ra_db/src/input.rs
+++ b/crates/base_db/src/input.rs
diff --git a/crates/ra_db/src/lib.rs b/crates/base_db/src/lib.rs
index 73ac243d6..811057251 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/base_db/src/lib.rs
@@ -1,4 +1,4 @@
1//! ra_db defines basic database traits. The concrete DB is defined by ra_ide. 1//! base_db defines basic database traits. The concrete DB is defined by ra_ide.
2mod cancellation; 2mod cancellation;
3mod input; 3mod input;
4pub mod fixture; 4pub mod fixture;
diff --git a/crates/ra_hir_def/Cargo.toml b/crates/hir_def/Cargo.toml
index e7d3c4d5b..403bc2aff 100644
--- a/crates/ra_hir_def/Cargo.toml
+++ b/crates/hir_def/Cargo.toml
@@ -1,9 +1,9 @@
1[package] 1[package]
2edition = "2018" 2name = "hir_def"
3name = "ra_hir_def" 3version = "0.0.0"
4version = "0.1.0"
5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0" 4license = "MIT OR Apache-2.0"
5authors = ["rust-analyzer developers"]
6edition = "2018"
7 7
8[lib] 8[lib]
9doctest = false 9doctest = false
@@ -21,12 +21,11 @@ indexmap = "1.4.0"
21smallvec = "1.4.0" 21smallvec = "1.4.0"
22 22
23stdx = { path = "../stdx" } 23stdx = { path = "../stdx" }
24
25arena = { path = "../arena" } 24arena = { path = "../arena" }
26ra_db = { path = "../ra_db" } 25base_db = { path = "../base_db" }
27syntax = { path = "../syntax" } 26syntax = { path = "../syntax" }
28profile = { path = "../profile" } 27profile = { path = "../profile" }
29hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } 28hir_expand = { path = "../hir_expand" }
30test_utils = { path = "../test_utils" } 29test_utils = { path = "../test_utils" }
31mbe = { path = "../mbe" } 30mbe = { path = "../mbe" }
32cfg = { path = "../cfg" } 31cfg = { path = "../cfg" }
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/hir_def/src/adt.rs
index d69ff2fc7..d69ff2fc7 100644
--- a/crates/ra_hir_def/src/adt.rs
+++ b/crates/hir_def/src/adt.rs
diff --git a/crates/ra_hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index dea552a60..dea552a60 100644
--- a/crates/ra_hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
diff --git a/crates/ra_hir_def/src/body.rs b/crates/hir_def/src/body.rs
index fe659386a..9a9a605dd 100644
--- a/crates/ra_hir_def/src/body.rs
+++ b/crates/hir_def/src/body.rs
@@ -6,11 +6,11 @@ pub mod scope;
6use std::{mem, ops::Index, sync::Arc}; 6use std::{mem, ops::Index, sync::Arc};
7 7
8use arena::{map::ArenaMap, Arena}; 8use arena::{map::ArenaMap, Arena};
9use base_db::CrateId;
9use cfg::CfgOptions; 10use cfg::CfgOptions;
10use drop_bomb::DropBomb; 11use drop_bomb::DropBomb;
11use either::Either; 12use either::Either;
12use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; 13use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId};
13use ra_db::CrateId;
14use rustc_hash::FxHashMap; 14use rustc_hash::FxHashMap;
15use syntax::{ast, AstNode, AstPtr}; 15use syntax::{ast, AstNode, AstPtr};
16use test_utils::mark; 16use test_utils::mark;
@@ -320,7 +320,7 @@ impl BodySourceMap {
320 320
321#[cfg(test)] 321#[cfg(test)]
322mod tests { 322mod tests {
323 use ra_db::{fixture::WithFixture, SourceDatabase}; 323 use base_db::{fixture::WithFixture, SourceDatabase};
324 use test_utils::mark; 324 use test_utils::mark;
325 325
326 use crate::ModuleDefId; 326 use crate::ModuleDefId;
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs
index a26251cde..a26251cde 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/hir_def/src/body/lower.rs
diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs
index 079f14c29..9142bc05b 100644
--- a/crates/ra_hir_def/src/body/scope.rs
+++ b/crates/hir_def/src/body/scope.rs
@@ -169,8 +169,8 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope
169 169
170#[cfg(test)] 170#[cfg(test)]
171mod tests { 171mod tests {
172 use base_db::{fixture::WithFixture, FileId, SourceDatabase};
172 use hir_expand::{name::AsName, InFile}; 173 use hir_expand::{name::AsName, InFile};
173 use ra_db::{fixture::WithFixture, FileId, SourceDatabase};
174 use syntax::{algo::find_node_at_offset, ast, AstNode}; 174 use syntax::{algo::find_node_at_offset, ast, AstNode};
175 use test_utils::{assert_eq_text, extract_offset, mark}; 175 use test_utils::{assert_eq_text, extract_offset, mark};
176 176
diff --git a/crates/ra_hir_def/src/builtin_type.rs b/crates/hir_def/src/builtin_type.rs
index 0f872b5c0..0f872b5c0 100644
--- a/crates/ra_hir_def/src/builtin_type.rs
+++ b/crates/hir_def/src/builtin_type.rs
diff --git a/crates/ra_hir_def/src/child_by_source.rs b/crates/hir_def/src/child_by_source.rs
index dcb00a1d9..dcb00a1d9 100644
--- a/crates/ra_hir_def/src/child_by_source.rs
+++ b/crates/hir_def/src/child_by_source.rs
diff --git a/crates/ra_hir_def/src/data.rs b/crates/hir_def/src/data.rs
index 9a8eb4ede..9a8eb4ede 100644
--- a/crates/ra_hir_def/src/data.rs
+++ b/crates/hir_def/src/data.rs
diff --git a/crates/ra_hir_def/src/db.rs b/crates/hir_def/src/db.rs
index a925548b5..6d694de11 100644
--- a/crates/ra_hir_def/src/db.rs
+++ b/crates/hir_def/src/db.rs
@@ -1,8 +1,8 @@
1//! Defines database & queries for name resolution. 1//! Defines database & queries for name resolution.
2use std::sync::Arc; 2use std::sync::Arc;
3 3
4use base_db::{salsa, CrateId, SourceDatabase, Upcast};
4use hir_expand::{db::AstDatabase, HirFileId}; 5use hir_expand::{db::AstDatabase, HirFileId};
5use ra_db::{salsa, CrateId, SourceDatabase, Upcast};
6use syntax::SmolStr; 6use syntax::SmolStr;
7 7
8use crate::{ 8use crate::{
diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/hir_def/src/diagnostics.rs
index 2e38a978f..2e38a978f 100644
--- a/crates/ra_hir_def/src/diagnostics.rs
+++ b/crates/hir_def/src/diagnostics.rs
diff --git a/crates/ra_hir_def/src/docs.rs b/crates/hir_def/src/docs.rs
index e9a02b11b..e9a02b11b 100644
--- a/crates/ra_hir_def/src/docs.rs
+++ b/crates/hir_def/src/docs.rs
diff --git a/crates/ra_hir_def/src/dyn_map.rs b/crates/hir_def/src/dyn_map.rs
index 6f269d7b0..6f269d7b0 100644
--- a/crates/ra_hir_def/src/dyn_map.rs
+++ b/crates/hir_def/src/dyn_map.rs
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/hir_def/src/expr.rs
index c94b3a36f..c94b3a36f 100644
--- a/crates/ra_hir_def/src/expr.rs
+++ b/crates/hir_def/src/expr.rs
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/hir_def/src/find_path.rs
index 5099f417d..ac2c54ac5 100644
--- a/crates/ra_hir_def/src/find_path.rs
+++ b/crates/hir_def/src/find_path.rs
@@ -292,8 +292,8 @@ fn find_local_import_locations(
292 292
293#[cfg(test)] 293#[cfg(test)]
294mod tests { 294mod tests {
295 use base_db::fixture::WithFixture;
295 use hir_expand::hygiene::Hygiene; 296 use hir_expand::hygiene::Hygiene;
296 use ra_db::fixture::WithFixture;
297 use syntax::ast::AstNode; 297 use syntax::ast::AstNode;
298 use test_utils::mark; 298 use test_utils::mark;
299 299
diff --git a/crates/ra_hir_def/src/generics.rs b/crates/hir_def/src/generics.rs
index 4476f0316..835fe3fbd 100644
--- a/crates/ra_hir_def/src/generics.rs
+++ b/crates/hir_def/src/generics.rs
@@ -5,12 +5,12 @@
5use std::sync::Arc; 5use std::sync::Arc;
6 6
7use arena::{map::ArenaMap, Arena}; 7use arena::{map::ArenaMap, Arena};
8use base_db::FileId;
8use either::Either; 9use either::Either;
9use hir_expand::{ 10use hir_expand::{
10 name::{name, AsName, Name}, 11 name::{name, AsName, Name},
11 InFile, 12 InFile,
12}; 13};
13use ra_db::FileId;
14use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; 14use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner};
15 15
16use crate::{ 16use crate::{
diff --git a/crates/ra_hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs
index 431ff30ab..d32a0bdaf 100644
--- a/crates/ra_hir_def/src/import_map.rs
+++ b/crates/hir_def/src/import_map.rs
@@ -2,9 +2,9 @@
2 2
3use std::{cmp::Ordering, fmt, hash::BuildHasherDefault, sync::Arc}; 3use std::{cmp::Ordering, fmt, hash::BuildHasherDefault, sync::Arc};
4 4
5use base_db::CrateId;
5use fst::{self, Streamer}; 6use fst::{self, Streamer};
6use indexmap::{map::Entry, IndexMap}; 7use indexmap::{map::Entry, IndexMap};
7use ra_db::CrateId;
8use rustc_hash::{FxHashMap, FxHasher}; 8use rustc_hash::{FxHashMap, FxHasher};
9use smallvec::SmallVec; 9use smallvec::SmallVec;
10use syntax::SmolStr; 10use syntax::SmolStr;
@@ -327,8 +327,8 @@ pub fn search_dependencies<'a>(
327 327
328#[cfg(test)] 328#[cfg(test)]
329mod tests { 329mod tests {
330 use base_db::{fixture::WithFixture, SourceDatabase, Upcast};
330 use expect::{expect, Expect}; 331 use expect::{expect, Expect};
331 use ra_db::{fixture::WithFixture, SourceDatabase, Upcast};
332 332
333 use crate::{test_db::TestDB, AssocContainerId, Lookup}; 333 use crate::{test_db::TestDB, AssocContainerId, Lookup};
334 334
diff --git a/crates/ra_hir_def/src/item_scope.rs b/crates/hir_def/src/item_scope.rs
index 8fee4b15e..f1e9dfd5b 100644
--- a/crates/ra_hir_def/src/item_scope.rs
+++ b/crates/hir_def/src/item_scope.rs
@@ -3,9 +3,9 @@
3 3
4use std::collections::hash_map::Entry; 4use std::collections::hash_map::Entry;
5 5
6use base_db::CrateId;
6use hir_expand::name::Name; 7use hir_expand::name::Name;
7use once_cell::sync::Lazy; 8use once_cell::sync::Lazy;
8use ra_db::CrateId;
9use rustc_hash::{FxHashMap, FxHashSet}; 9use rustc_hash::{FxHashMap, FxHashSet};
10use test_utils::mark; 10use test_utils::mark;
11 11
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index e14722cae..e14722cae 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index 391ab5d39..391ab5d39 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs
index 6c843e339..9c5bf72bd 100644
--- a/crates/ra_hir_def/src/item_tree/tests.rs
+++ b/crates/hir_def/src/item_tree/tests.rs
@@ -1,6 +1,6 @@
1use base_db::fixture::WithFixture;
1use expect::{expect, Expect}; 2use expect::{expect, Expect};
2use hir_expand::{db::AstDatabase, HirFileId, InFile}; 3use hir_expand::{db::AstDatabase, HirFileId, InFile};
3use ra_db::fixture::WithFixture;
4use rustc_hash::FxHashSet; 4use rustc_hash::FxHashSet;
5use std::sync::Arc; 5use std::sync::Arc;
6use stdx::format_to; 6use stdx::format_to;
@@ -246,13 +246,13 @@ fn smoke() {
246 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] 246 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }]
247 Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(3), kind: Unit } 247 Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(3), kind: Unit }
248 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] 248 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }]
249 Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<ra_hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(4), kind: Tuple } 249 Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(4), kind: Tuple }
250 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] 250 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }]
251 Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(5), kind: Record } 251 Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(5), kind: Record }
252 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] 252 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }]
253 Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<syntax::ast::generated::nodes::Enum>(6) } 253 Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<syntax::ast::generated::nodes::Enum>(6) }
254 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] 254 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }]
255 Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(3..4)), ast_id: FileAstId::<syntax::ast::generated::nodes::Union>(7) } 255 Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::<hir_def::item_tree::Field>(3..4)), ast_id: FileAstId::<syntax::ast::generated::nodes::Union>(7) }
256 "##]], 256 "##]],
257 ); 257 );
258} 258}
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/hir_def/src/keys.rs
index 40a5d92b5..40a5d92b5 100644
--- a/crates/ra_hir_def/src/keys.rs
+++ b/crates/hir_def/src/keys.rs
diff --git a/crates/ra_hir_def/src/lang_item.rs b/crates/hir_def/src/lang_item.rs
index 063eadccb..063eadccb 100644
--- a/crates/ra_hir_def/src/lang_item.rs
+++ b/crates/hir_def/src/lang_item.rs
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/hir_def/src/lib.rs
index 806ac731f..f24a1dd77 100644
--- a/crates/ra_hir_def/src/lib.rs
+++ b/crates/hir_def/src/lib.rs
@@ -53,11 +53,11 @@ mod test_db;
53use std::hash::{Hash, Hasher}; 53use std::hash::{Hash, Hasher};
54 54
55use arena::Idx; 55use arena::Idx;
56use base_db::{impl_intern_key, salsa, CrateId};
56use hir_expand::{ 57use hir_expand::{
57 ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile, 58 ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile,
58 MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, 59 MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
59}; 60};
60use ra_db::{impl_intern_key, salsa, CrateId};
61use syntax::ast; 61use syntax::ast;
62 62
63use crate::builtin_type::BuiltinType; 63use crate::builtin_type::BuiltinType;
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs
index d26c837cc..bf302172d 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/hir_def/src/nameres.rs
@@ -57,8 +57,8 @@ mod tests;
57use std::sync::Arc; 57use std::sync::Arc;
58 58
59use arena::Arena; 59use arena::Arena;
60use base_db::{CrateId, Edition, FileId};
60use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; 61use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile};
61use ra_db::{CrateId, Edition, FileId};
62use rustc_hash::FxHashMap; 62use rustc_hash::FxHashMap;
63use stdx::format_to; 63use stdx::format_to;
64use syntax::ast; 64use syntax::ast;
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs
index 6a5891936..3e99c8773 100644
--- a/crates/ra_hir_def/src/nameres/collector.rs
+++ b/crates/hir_def/src/nameres/collector.rs
@@ -3,6 +3,7 @@
3//! `DefCollector::collect` contains the fixed-point iteration loop which 3//! `DefCollector::collect` contains the fixed-point iteration loop which
4//! resolves imports and expands macros. 4//! resolves imports and expands macros.
5 5
6use base_db::{CrateId, FileId, ProcMacroId};
6use cfg::CfgOptions; 7use cfg::CfgOptions;
7use hir_expand::{ 8use hir_expand::{
8 ast_id_map::FileAstId, 9 ast_id_map::FileAstId,
@@ -12,7 +13,6 @@ use hir_expand::{
12 proc_macro::ProcMacroExpander, 13 proc_macro::ProcMacroExpander,
13 HirFileId, MacroCallId, MacroDefId, MacroDefKind, 14 HirFileId, MacroCallId, MacroDefId, MacroDefKind,
14}; 15};
15use ra_db::{CrateId, FileId, ProcMacroId};
16use rustc_hash::FxHashMap; 16use rustc_hash::FxHashMap;
17use syntax::ast; 17use syntax::ast;
18use test_utils::mark; 18use test_utils::mark;
@@ -1209,7 +1209,7 @@ fn is_macro_rules(path: &ModPath) -> bool {
1209mod tests { 1209mod tests {
1210 use crate::{db::DefDatabase, test_db::TestDB}; 1210 use crate::{db::DefDatabase, test_db::TestDB};
1211 use arena::Arena; 1211 use arena::Arena;
1212 use ra_db::{fixture::WithFixture, SourceDatabase}; 1212 use base_db::{fixture::WithFixture, SourceDatabase};
1213 1213
1214 use super::*; 1214 use super::*;
1215 1215
diff --git a/crates/ra_hir_def/src/nameres/mod_resolution.rs b/crates/hir_def/src/nameres/mod_resolution.rs
index 316245d6b..e8389b484 100644
--- a/crates/ra_hir_def/src/nameres/mod_resolution.rs
+++ b/crates/hir_def/src/nameres/mod_resolution.rs
@@ -1,6 +1,6 @@
1//! This module resolves `mod foo;` declaration to file. 1//! This module resolves `mod foo;` declaration to file.
2use base_db::FileId;
2use hir_expand::name::Name; 3use hir_expand::name::Name;
3use ra_db::FileId;
4use syntax::SmolStr; 4use syntax::SmolStr;
5 5
6use crate::{db::DefDatabase, HirFileId}; 6use crate::{db::DefDatabase, HirFileId};
diff --git a/crates/ra_hir_def/src/nameres/path_resolution.rs b/crates/hir_def/src/nameres/path_resolution.rs
index dbfa7fccb..88e10574e 100644
--- a/crates/ra_hir_def/src/nameres/path_resolution.rs
+++ b/crates/hir_def/src/nameres/path_resolution.rs
@@ -12,8 +12,8 @@
12 12
13use std::iter::successors; 13use std::iter::successors;
14 14
15use base_db::Edition;
15use hir_expand::name::Name; 16use hir_expand::name::Name;
16use ra_db::Edition;
17use test_utils::mark; 17use test_utils::mark;
18 18
19use crate::{ 19use crate::{
diff --git a/crates/ra_hir_def/src/nameres/tests.rs b/crates/hir_def/src/nameres/tests.rs
index 839b1de57..b105d56b2 100644
--- a/crates/ra_hir_def/src/nameres/tests.rs
+++ b/crates/hir_def/src/nameres/tests.rs
@@ -6,8 +6,8 @@ mod primitives;
6 6
7use std::sync::Arc; 7use std::sync::Arc;
8 8
9use base_db::{fixture::WithFixture, SourceDatabase};
9use expect::{expect, Expect}; 10use expect::{expect, Expect};
10use ra_db::{fixture::WithFixture, SourceDatabase};
11use test_utils::mark; 11use test_utils::mark;
12 12
13use crate::{db::DefDatabase, nameres::*, test_db::TestDB}; 13use crate::{db::DefDatabase, nameres::*, test_db::TestDB};
diff --git a/crates/ra_hir_def/src/nameres/tests/globs.rs b/crates/hir_def/src/nameres/tests/globs.rs
index 2ae836e3c..2ae836e3c 100644
--- a/crates/ra_hir_def/src/nameres/tests/globs.rs
+++ b/crates/hir_def/src/nameres/tests/globs.rs
diff --git a/crates/ra_hir_def/src/nameres/tests/incremental.rs b/crates/hir_def/src/nameres/tests/incremental.rs
index 0c288a108..cfbc62cc4 100644
--- a/crates/ra_hir_def/src/nameres/tests/incremental.rs
+++ b/crates/hir_def/src/nameres/tests/incremental.rs
@@ -1,6 +1,6 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use ra_db::SourceDatabaseExt; 3use base_db::SourceDatabaseExt;
4 4
5use super::*; 5use super::*;
6 6
diff --git a/crates/ra_hir_def/src/nameres/tests/macros.rs b/crates/hir_def/src/nameres/tests/macros.rs
index e0fb8bdef..e0fb8bdef 100644
--- a/crates/ra_hir_def/src/nameres/tests/macros.rs
+++ b/crates/hir_def/src/nameres/tests/macros.rs
diff --git a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs b/crates/hir_def/src/nameres/tests/mod_resolution.rs
index 1f619787e..1f619787e 100644
--- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
+++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs
diff --git a/crates/ra_hir_def/src/nameres/tests/primitives.rs b/crates/hir_def/src/nameres/tests/primitives.rs
index 215e8952d..215e8952d 100644
--- a/crates/ra_hir_def/src/nameres/tests/primitives.rs
+++ b/crates/hir_def/src/nameres/tests/primitives.rs
diff --git a/crates/ra_hir_def/src/path.rs b/crates/hir_def/src/path.rs
index 88be07c8a..74d26f08b 100644
--- a/crates/ra_hir_def/src/path.rs
+++ b/crates/hir_def/src/path.rs
@@ -8,11 +8,11 @@ use std::{
8}; 8};
9 9
10use crate::body::LowerCtx; 10use crate::body::LowerCtx;
11use base_db::CrateId;
11use hir_expand::{ 12use hir_expand::{
12 hygiene::Hygiene, 13 hygiene::Hygiene,
13 name::{AsName, Name}, 14 name::{AsName, Name},
14}; 15};
15use ra_db::CrateId;
16use syntax::ast; 16use syntax::ast;
17 17
18use crate::{ 18use crate::{
diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/hir_def/src/path/lower.rs
index 07b9723ce..07b9723ce 100644
--- a/crates/ra_hir_def/src/path/lower.rs
+++ b/crates/hir_def/src/path/lower.rs
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/hir_def/src/path/lower/lower_use.rs
index 53cecb05f..53cecb05f 100644
--- a/crates/ra_hir_def/src/path/lower/lower_use.rs
+++ b/crates/hir_def/src/path/lower/lower_use.rs
diff --git a/crates/ra_hir_def/src/per_ns.rs b/crates/hir_def/src/per_ns.rs
index 74665c588..74665c588 100644
--- a/crates/ra_hir_def/src/per_ns.rs
+++ b/crates/hir_def/src/per_ns.rs
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs
index 0bf51eb7b..f8cc5e075 100644
--- a/crates/ra_hir_def/src/resolver.rs
+++ b/crates/hir_def/src/resolver.rs
@@ -1,11 +1,11 @@
1//! Name resolution façade. 1//! Name resolution façade.
2use std::sync::Arc; 2use std::sync::Arc;
3 3
4use base_db::CrateId;
4use hir_expand::{ 5use hir_expand::{
5 name::{name, Name}, 6 name::{name, Name},
6 MacroDefId, 7 MacroDefId,
7}; 8};
8use ra_db::CrateId;
9use rustc_hash::FxHashSet; 9use rustc_hash::FxHashSet;
10 10
11use crate::{ 11use crate::{
diff --git a/crates/ra_hir_def/src/src.rs b/crates/hir_def/src/src.rs
index 7a79b0314..7a79b0314 100644
--- a/crates/ra_hir_def/src/src.rs
+++ b/crates/hir_def/src/src.rs
diff --git a/crates/ra_hir_def/src/test_db.rs b/crates/hir_def/src/test_db.rs
index 339f819b8..42a762936 100644
--- a/crates/ra_hir_def/src/test_db.rs
+++ b/crates/hir_def/src/test_db.rs
@@ -5,15 +5,15 @@ use std::{
5 sync::{Arc, Mutex}, 5 sync::{Arc, Mutex},
6}; 6};
7 7
8use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, Upcast};
8use hir_expand::db::AstDatabase; 9use hir_expand::db::AstDatabase;
9use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, Upcast};
10use rustc_hash::FxHashSet; 10use rustc_hash::FxHashSet;
11 11
12use crate::db::DefDatabase; 12use crate::db::DefDatabase;
13 13
14#[salsa::database( 14#[salsa::database(
15 ra_db::SourceDatabaseExtStorage, 15 base_db::SourceDatabaseExtStorage,
16 ra_db::SourceDatabaseStorage, 16 base_db::SourceDatabaseStorage,
17 hir_expand::db::AstDatabaseStorage, 17 hir_expand::db::AstDatabaseStorage,
18 crate::db::InternDatabaseStorage, 18 crate::db::InternDatabaseStorage,
19 crate::db::DefDatabaseStorage 19 crate::db::DefDatabaseStorage
diff --git a/crates/ra_hir_def/src/trace.rs b/crates/hir_def/src/trace.rs
index fd64e7018..fd64e7018 100644
--- a/crates/ra_hir_def/src/trace.rs
+++ b/crates/hir_def/src/trace.rs
diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/hir_def/src/type_ref.rs
index 1a78c1444..1a78c1444 100644
--- a/crates/ra_hir_def/src/type_ref.rs
+++ b/crates/hir_def/src/type_ref.rs
diff --git a/crates/ra_hir_def/src/visibility.rs b/crates/hir_def/src/visibility.rs
index e6e0853a3..e6e0853a3 100644
--- a/crates/ra_hir_def/src/visibility.rs
+++ b/crates/hir_def/src/visibility.rs
diff --git a/crates/ra_hir_expand/Cargo.toml b/crates/hir_expand/Cargo.toml
index cbb0ac29b..1c4699291 100644
--- a/crates/ra_hir_expand/Cargo.toml
+++ b/crates/hir_expand/Cargo.toml
@@ -1,9 +1,9 @@
1[package] 1[package]
2edition = "2018" 2name = "hir_expand"
3name = "ra_hir_expand" 3version = "0.0.0"
4version = "0.1.0"
5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0" 4license = "MIT OR Apache-2.0"
5authors = ["rust-analyzer developers"]
6edition = "2018"
7 7
8[lib] 8[lib]
9doctest = false 9doctest = false
@@ -14,7 +14,7 @@ either = "1.5.3"
14rustc-hash = "1.0.0" 14rustc-hash = "1.0.0"
15 15
16arena = { path = "../arena" } 16arena = { path = "../arena" }
17ra_db = { path = "../ra_db" } 17base_db = { path = "../base_db" }
18syntax = { path = "../syntax" } 18syntax = { path = "../syntax" }
19parser = { path = "../parser" } 19parser = { path = "../parser" }
20profile = { path = "../profile" } 20profile = { path = "../profile" }
diff --git a/crates/ra_hir_expand/src/ast_id_map.rs b/crates/hir_expand/src/ast_id_map.rs
index f63629b30..f63629b30 100644
--- a/crates/ra_hir_expand/src/ast_id_map.rs
+++ b/crates/hir_expand/src/ast_id_map.rs
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/hir_expand/src/builtin_derive.rs
index 2d2f8bcb8..988a60d56 100644
--- a/crates/ra_hir_expand/src/builtin_derive.rs
+++ b/crates/hir_expand/src/builtin_derive.rs
@@ -253,8 +253,8 @@ fn partial_ord_expand(
253 253
254#[cfg(test)] 254#[cfg(test)]
255mod tests { 255mod tests {
256 use base_db::{fixture::WithFixture, CrateId, SourceDatabase};
256 use name::{known, Name}; 257 use name::{known, Name};
257 use ra_db::{fixture::WithFixture, CrateId, SourceDatabase};
258 258
259 use crate::{test_db::TestDB, AstId, MacroCallId, MacroCallKind, MacroCallLoc}; 259 use crate::{test_db::TestDB, AstId, MacroCallId, MacroCallKind, MacroCallLoc};
260 260
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index ae4c84382..86918b626 100644
--- a/crates/ra_hir_expand/src/builtin_macro.rs
+++ b/crates/hir_expand/src/builtin_macro.rs
@@ -4,10 +4,10 @@ use crate::{
4 MacroDefId, MacroDefKind, TextSize, 4 MacroDefId, MacroDefKind, TextSize,
5}; 5};
6 6
7use base_db::FileId;
7use either::Either; 8use either::Either;
8use mbe::parse_to_token_tree; 9use mbe::parse_to_token_tree;
9use parser::FragmentKind; 10use parser::FragmentKind;
10use ra_db::FileId;
11use syntax::ast::{self, AstToken, HasStringValue}; 11use syntax::ast::{self, AstToken, HasStringValue};
12 12
13macro_rules! register_builtin { 13macro_rules! register_builtin {
@@ -426,7 +426,7 @@ mod tests {
426 name::AsName, test_db::TestDB, AstNode, EagerCallLoc, MacroCallId, MacroCallKind, 426 name::AsName, test_db::TestDB, AstNode, EagerCallLoc, MacroCallId, MacroCallKind,
427 MacroCallLoc, 427 MacroCallLoc,
428 }; 428 };
429 use ra_db::{fixture::WithFixture, SourceDatabase}; 429 use base_db::{fixture::WithFixture, SourceDatabase};
430 use std::sync::Arc; 430 use std::sync::Arc;
431 use syntax::ast::NameOwner; 431 use syntax::ast::NameOwner;
432 432
diff --git a/crates/ra_hir_expand/src/db.rs b/crates/hir_expand/src/db.rs
index c275f6b01..dcc038bcd 100644
--- a/crates/ra_hir_expand/src/db.rs
+++ b/crates/hir_expand/src/db.rs
@@ -2,9 +2,9 @@
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use base_db::{salsa, SourceDatabase};
5use mbe::{ExpandResult, MacroRules}; 6use mbe::{ExpandResult, MacroRules};
6use parser::FragmentKind; 7use parser::FragmentKind;
7use ra_db::{salsa, SourceDatabase};
8use syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode}; 8use syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode};
9 9
10use crate::{ 10use crate::{
diff --git a/crates/ra_hir_expand/src/diagnostics.rs b/crates/hir_expand/src/diagnostics.rs
index 59d35debe..59d35debe 100644
--- a/crates/ra_hir_expand/src/diagnostics.rs
+++ b/crates/hir_expand/src/diagnostics.rs
diff --git a/crates/ra_hir_expand/src/eager.rs b/crates/hir_expand/src/eager.rs
index bd3409f97..10c45646f 100644
--- a/crates/ra_hir_expand/src/eager.rs
+++ b/crates/hir_expand/src/eager.rs
@@ -25,8 +25,8 @@ use crate::{
25 EagerCallLoc, EagerMacroId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, 25 EagerCallLoc, EagerMacroId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
26}; 26};
27 27
28use base_db::CrateId;
28use parser::FragmentKind; 29use parser::FragmentKind;
29use ra_db::CrateId;
30use std::sync::Arc; 30use std::sync::Arc;
31use syntax::{algo::SyntaxRewriter, SyntaxNode}; 31use syntax::{algo::SyntaxRewriter, SyntaxNode};
32 32
diff --git a/crates/ra_hir_expand/src/hygiene.rs b/crates/hir_expand/src/hygiene.rs
index 23b5eac27..845e9cbc1 100644
--- a/crates/ra_hir_expand/src/hygiene.rs
+++ b/crates/hir_expand/src/hygiene.rs
@@ -2,8 +2,8 @@
2//! 2//!
3//! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at 3//! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at
4//! this moment, this is horribly incomplete and handles only `$crate`. 4//! this moment, this is horribly incomplete and handles only `$crate`.
5use base_db::CrateId;
5use either::Either; 6use either::Either;
6use ra_db::CrateId;
7use syntax::ast; 7use syntax::ast;
8 8
9use crate::{ 9use crate::{
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs
index af0cc445f..2be15e841 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/hir_expand/src/lib.rs
@@ -1,4 +1,4 @@
1//! `ra_hir_expand` deals with macro expansion. 1//! `hir_expand` deals with macro expansion.
2//! 2//!
3//! Specifically, it implements a concept of `MacroFile` -- a file whose syntax 3//! Specifically, it implements a concept of `MacroFile` -- a file whose syntax
4//! tree originates not from the text of some `FileId`, but from some macro 4//! tree originates not from the text of some `FileId`, but from some macro
@@ -18,7 +18,7 @@ pub mod eager;
18use std::hash::Hash; 18use std::hash::Hash;
19use std::sync::Arc; 19use std::sync::Arc;
20 20
21use ra_db::{impl_intern_key, salsa, CrateId, FileId}; 21use base_db::{impl_intern_key, salsa, CrateId, FileId};
22use syntax::{ 22use syntax::{
23 algo, 23 algo,
24 ast::{self, AstNode}, 24 ast::{self, AstNode},
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
index 4dcaff088..49841c7a1 100644
--- a/crates/ra_hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -115,7 +115,7 @@ impl AsName for ast::FieldKind {
115 } 115 }
116} 116}
117 117
118impl AsName for ra_db::Dependency { 118impl AsName for base_db::Dependency {
119 fn as_name(&self) -> Name { 119 fn as_name(&self) -> Name {
120 Name::new_text(SmolStr::new(&*self.name)) 120 Name::new_text(SmolStr::new(&*self.name))
121 } 121 }
diff --git a/crates/ra_hir_expand/src/proc_macro.rs b/crates/hir_expand/src/proc_macro.rs
index 2c0ec41d2..80255ea32 100644
--- a/crates/ra_hir_expand/src/proc_macro.rs
+++ b/crates/hir_expand/src/proc_macro.rs
@@ -1,7 +1,7 @@
1//! Proc Macro Expander stub 1//! Proc Macro Expander stub
2 2
3use crate::{db::AstDatabase, LazyMacroId}; 3use crate::{db::AstDatabase, LazyMacroId};
4use ra_db::{CrateId, ProcMacroId}; 4use base_db::{CrateId, ProcMacroId};
5use tt::buffer::{Cursor, TokenBuffer}; 5use tt::buffer::{Cursor, TokenBuffer};
6 6
7#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] 7#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/hir_expand/src/quote.rs
index 219bc2097..219bc2097 100644
--- a/crates/ra_hir_expand/src/quote.rs
+++ b/crates/hir_expand/src/quote.rs
diff --git a/crates/ra_hir_expand/src/test_db.rs b/crates/hir_expand/src/test_db.rs
index 332fa556f..86a5d867e 100644
--- a/crates/ra_hir_expand/src/test_db.rs
+++ b/crates/hir_expand/src/test_db.rs
@@ -5,12 +5,12 @@ use std::{
5 sync::{Arc, Mutex}, 5 sync::{Arc, Mutex},
6}; 6};
7 7
8use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate}; 8use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate};
9use rustc_hash::FxHashSet; 9use rustc_hash::FxHashSet;
10 10
11#[salsa::database( 11#[salsa::database(
12 ra_db::SourceDatabaseExtStorage, 12 base_db::SourceDatabaseExtStorage,
13 ra_db::SourceDatabaseStorage, 13 base_db::SourceDatabaseStorage,
14 crate::db::AstDatabaseStorage 14 crate::db::AstDatabaseStorage
15)] 15)]
16#[derive(Default)] 16#[derive(Default)]
diff --git a/crates/project_model/Cargo.toml b/crates/project_model/Cargo.toml
index 1c84c7d20..386f72f41 100644
--- a/crates/project_model/Cargo.toml
+++ b/crates/project_model/Cargo.toml
@@ -18,7 +18,7 @@ anyhow = "1.0.26"
18 18
19arena = { path = "../arena" } 19arena = { path = "../arena" }
20cfg = { path = "../cfg" } 20cfg = { path = "../cfg" }
21ra_db = { path = "../ra_db" } 21base_db = { path = "../base_db" }
22toolchain = { path = "../toolchain" } 22toolchain = { path = "../toolchain" }
23proc_macro_api = { path = "../proc_macro_api" } 23proc_macro_api = { path = "../proc_macro_api" }
24paths = { path = "../paths" } 24paths = { path = "../paths" }
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs
index abf8dca96..e5c2d2b25 100644
--- a/crates/project_model/src/cargo_workspace.rs
+++ b/crates/project_model/src/cargo_workspace.rs
@@ -9,9 +9,9 @@ use std::{
9 9
10use anyhow::{Context, Result}; 10use anyhow::{Context, Result};
11use arena::{Arena, Idx}; 11use arena::{Arena, Idx};
12use base_db::Edition;
12use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; 13use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
13use paths::{AbsPath, AbsPathBuf}; 14use paths::{AbsPath, AbsPathBuf};
14use ra_db::Edition;
15use rustc_hash::FxHashMap; 15use rustc_hash::FxHashMap;
16 16
17use crate::cfg_flag::CfgFlag; 17use crate::cfg_flag::CfgFlag;
diff --git a/crates/project_model/src/lib.rs b/crates/project_model/src/lib.rs
index 234f908c9..1f5a94d7f 100644
--- a/crates/project_model/src/lib.rs
+++ b/crates/project_model/src/lib.rs
@@ -12,9 +12,9 @@ use std::{
12}; 12};
13 13
14use anyhow::{bail, Context, Result}; 14use anyhow::{bail, Context, Result};
15use base_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId};
15use cfg::CfgOptions; 16use cfg::CfgOptions;
16use paths::{AbsPath, AbsPathBuf}; 17use paths::{AbsPath, AbsPathBuf};
17use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId};
18use rustc_hash::{FxHashMap, FxHashSet}; 18use rustc_hash::{FxHashMap, FxHashSet};
19 19
20use crate::cfg_flag::CfgFlag; 20use crate::cfg_flag::CfgFlag;
diff --git a/crates/project_model/src/project_json.rs b/crates/project_model/src/project_json.rs
index e3f3163f6..060ea5b7d 100644
--- a/crates/project_model/src/project_json.rs
+++ b/crates/project_model/src/project_json.rs
@@ -2,8 +2,8 @@
2 2
3use std::path::PathBuf; 3use std::path::PathBuf;
4 4
5use base_db::{CrateId, CrateName, Dependency, Edition};
5use paths::{AbsPath, AbsPathBuf}; 6use paths::{AbsPath, AbsPathBuf};
6use ra_db::{CrateId, CrateName, Dependency, Edition};
7use rustc_hash::FxHashMap; 7use rustc_hash::FxHashMap;
8use serde::{de, Deserialize}; 8use serde::{de, Deserialize};
9 9
diff --git a/crates/ra_assists/Cargo.toml b/crates/ra_assists/Cargo.toml
index 83e44c124..ebac09be6 100644
--- a/crates/ra_assists/Cargo.toml
+++ b/crates/ra_assists/Cargo.toml
@@ -18,7 +18,7 @@ stdx = { path = "../stdx" }
18syntax = { path = "../syntax" } 18syntax = { path = "../syntax" }
19text_edit = { path = "../text_edit" } 19text_edit = { path = "../text_edit" }
20profile = { path = "../profile" } 20profile = { path = "../profile" }
21ra_db = { path = "../ra_db" } 21base_db = { path = "../base_db" }
22ra_ide_db = { path = "../ra_ide_db" } 22ra_ide_db = { path = "../ra_ide_db" }
23hir = { path = "../ra_hir", package = "ra_hir" } 23hir = { path = "../ra_hir", package = "ra_hir" }
24test_utils = { path = "../test_utils" } 24test_utils = { path = "../test_utils" }
diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs
index 368d48a71..2fdce037f 100644
--- a/crates/ra_assists/src/assist_context.rs
+++ b/crates/ra_assists/src/assist_context.rs
@@ -3,8 +3,8 @@
3use std::mem; 3use std::mem;
4 4
5use algo::find_covering_element; 5use algo::find_covering_element;
6use base_db::{FileId, FileRange};
6use hir::Semantics; 7use hir::Semantics;
7use ra_db::{FileId, FileRange};
8use ra_ide_db::{ 8use ra_ide_db::{
9 source_change::{SourceChange, SourceFileEdit}, 9 source_change::{SourceChange, SourceFileEdit},
10 RootDatabase, 10 RootDatabase,
diff --git a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs
index 497f887cd..52fbc540e 100644
--- a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs
+++ b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs
@@ -1,5 +1,5 @@
1use base_db::FileId;
1use hir::{EnumVariant, Module, ModuleDef, Name}; 2use hir::{EnumVariant, Module, ModuleDef, Name};
2use ra_db::FileId;
3use ra_ide_db::{defs::Definition, search::Reference, RootDatabase}; 3use ra_ide_db::{defs::Definition, search::Reference, RootDatabase};
4use rustc_hash::FxHashSet; 4use rustc_hash::FxHashSet;
5use syntax::{ 5use syntax::{
diff --git a/crates/ra_assists/src/handlers/fix_visibility.rs b/crates/ra_assists/src/handlers/fix_visibility.rs
index b6cc1a320..7cd76ea06 100644
--- a/crates/ra_assists/src/handlers/fix_visibility.rs
+++ b/crates/ra_assists/src/handlers/fix_visibility.rs
@@ -1,5 +1,5 @@
1use base_db::FileId;
1use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution}; 2use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution};
2use ra_db::FileId;
3use syntax::{ast, AstNode, TextRange, TextSize}; 3use syntax::{ast, AstNode, TextRange, TextSize};
4 4
5use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists}; 5use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists};
diff --git a/crates/ra_assists/src/handlers/generate_function.rs b/crates/ra_assists/src/handlers/generate_function.rs
index b5df44101..b38d64058 100644
--- a/crates/ra_assists/src/handlers/generate_function.rs
+++ b/crates/ra_assists/src/handlers/generate_function.rs
@@ -1,5 +1,5 @@
1use base_db::FileId;
1use hir::HirDisplay; 2use hir::HirDisplay;
2use ra_db::FileId;
3use rustc_hash::{FxHashMap, FxHashSet}; 3use rustc_hash::{FxHashMap, FxHashSet};
4use syntax::{ 4use syntax::{
5 ast::{ 5 ast::{
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs
index e2ef561fe..5d062b88b 100644
--- a/crates/ra_assists/src/lib.rs
+++ b/crates/ra_assists/src/lib.rs
@@ -17,8 +17,8 @@ mod tests;
17pub mod utils; 17pub mod utils;
18pub mod ast_transform; 18pub mod ast_transform;
19 19
20use base_db::FileRange;
20use hir::Semantics; 21use hir::Semantics;
21use ra_db::FileRange;
22use ra_ide_db::{source_change::SourceChange, RootDatabase}; 22use ra_ide_db::{source_change::SourceChange, RootDatabase};
23use syntax::TextRange; 23use syntax::TextRange;
24 24
diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs
index 1ae7aaa09..75d973688 100644
--- a/crates/ra_assists/src/tests.rs
+++ b/crates/ra_assists/src/tests.rs
@@ -1,7 +1,7 @@
1mod generated; 1mod generated;
2 2
3use base_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt};
3use hir::Semantics; 4use hir::Semantics;
4use ra_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt};
5use ra_ide_db::RootDatabase; 5use ra_ide_db::RootDatabase;
6use syntax::TextRange; 6use syntax::TextRange;
7use test_utils::{assert_eq_text, extract_offset, extract_range}; 7use test_utils::{assert_eq_text, extract_offset, extract_range};
diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml
index ee5622a7d..edca5dc6f 100644
--- a/crates/ra_hir/Cargo.toml
+++ b/crates/ra_hir/Cargo.toml
@@ -18,8 +18,8 @@ itertools = "0.9.0"
18 18
19stdx = { path = "../stdx" } 19stdx = { path = "../stdx" }
20syntax = { path = "../syntax" } 20syntax = { path = "../syntax" }
21ra_db = { path = "../ra_db" } 21base_db = { path = "../base_db" }
22profile = { path = "../profile" } 22profile = { path = "../profile" }
23hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } 23hir_expand = { path = "../hir_expand" }
24hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } 24hir_def = { path = "../hir_def" }
25hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } 25hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" }
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 98724c146..8ffb9e99b 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -2,6 +2,7 @@
2use std::{iter, sync::Arc}; 2use std::{iter, sync::Arc};
3 3
4use arrayvec::ArrayVec; 4use arrayvec::ArrayVec;
5use base_db::{CrateId, Edition, FileId};
5use either::Either; 6use either::Either;
6use hir_def::{ 7use hir_def::{
7 adt::ReprKind, 8 adt::ReprKind,
@@ -30,7 +31,6 @@ use hir_ty::{
30 method_resolution, ApplicationTy, CallableDefId, Canonical, FnSig, GenericPredicate, 31 method_resolution, ApplicationTy, CallableDefId, Canonical, FnSig, GenericPredicate,
31 InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor, 32 InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor,
32}; 33};
33use ra_db::{CrateId, Edition, FileId};
34use rustc_hash::FxHashSet; 34use rustc_hash::FxHashSet;
35use stdx::impl_from; 35use stdx::impl_from;
36use syntax::{ 36use syntax::{
@@ -815,7 +815,7 @@ pub struct MacroDef {
815impl MacroDef { 815impl MacroDef {
816 /// FIXME: right now, this just returns the root module of the crate that 816 /// FIXME: right now, this just returns the root module of the crate that
817 /// defines this macro. The reasons for this is that macros are expanded 817 /// defines this macro. The reasons for this is that macros are expanded
818 /// early, in `ra_hir_expand`, where modules simply do not exist yet. 818 /// early, in `hir_expand`, where modules simply do not exist yet.
819 pub fn module(self, db: &dyn HirDatabase) -> Option<Module> { 819 pub fn module(self, db: &dyn HirDatabase) -> Option<Module> {
820 let krate = self.id.krate?; 820 let krate = self.id.krate?;
821 let module_id = db.crate_def_map(krate).root; 821 let module_id = db.crate_def_map(krate).root;
diff --git a/crates/ra_hir/src/from_id.rs b/crates/ra_hir/src/from_id.rs
index 679ae8121..a53ac1e08 100644
--- a/crates/ra_hir/src/from_id.rs
+++ b/crates/ra_hir/src/from_id.rs
@@ -29,7 +29,7 @@ macro_rules! from_id {
29} 29}
30 30
31from_id![ 31from_id![
32 (ra_db::CrateId, crate::Crate), 32 (base_db::CrateId, crate::Crate),
33 (hir_def::ModuleId, crate::Module), 33 (hir_def::ModuleId, crate::Module),
34 (hir_def::StructId, crate::Struct), 34 (hir_def::StructId, crate::Struct),
35 (hir_def::UnionId, crate::Union), 35 (hir_def::UnionId, crate::Union),
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs
index 2e0ef4408..1467d825d 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/ra_hir/src/semantics.rs
@@ -4,6 +4,7 @@ mod source_to_def;
4 4
5use std::{cell::RefCell, fmt, iter::successors}; 5use std::{cell::RefCell, fmt, iter::successors};
6 6
7use base_db::{FileId, FileRange};
7use hir_def::{ 8use hir_def::{
8 resolver::{self, HasResolver, Resolver}, 9 resolver::{self, HasResolver, Resolver},
9 AsMacroCall, FunctionId, TraitId, VariantId, 10 AsMacroCall, FunctionId, TraitId, VariantId,
@@ -11,7 +12,6 @@ use hir_def::{
11use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo}; 12use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo};
12use hir_ty::associated_type_shorthand_candidates; 13use hir_ty::associated_type_shorthand_candidates;
13use itertools::Itertools; 14use itertools::Itertools;
14use ra_db::{FileId, FileRange};
15use rustc_hash::{FxHashMap, FxHashSet}; 15use rustc_hash::{FxHashMap, FxHashSet};
16use syntax::{ 16use syntax::{
17 algo::{find_node_at_offset, skip_trivia_token}, 17 algo::{find_node_at_offset, skip_trivia_token},
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs
index ab2fd0957..5918b9541 100644
--- a/crates/ra_hir/src/semantics/source_to_def.rs
+++ b/crates/ra_hir/src/semantics/source_to_def.rs
@@ -1,5 +1,6 @@
1//! Maps *syntax* of various definitions to their semantic ids. 1//! Maps *syntax* of various definitions to their semantic ids.
2 2
3use base_db::FileId;
3use hir_def::{ 4use hir_def::{
4 child_by_source::ChildBySource, 5 child_by_source::ChildBySource,
5 dyn_map::DynMap, 6 dyn_map::DynMap,
@@ -9,7 +10,6 @@ use hir_def::{
9 ModuleId, StaticId, StructId, TraitId, TypeAliasId, TypeParamId, UnionId, VariantId, 10 ModuleId, StaticId, StructId, TraitId, TypeAliasId, TypeParamId, UnionId, VariantId,
10}; 11};
11use hir_expand::{name::AsName, AstId, MacroDefKind}; 12use hir_expand::{name::AsName, AstId, MacroDefKind};
12use ra_db::FileId;
13use rustc_hash::FxHashMap; 13use rustc_hash::FxHashMap;
14use stdx::impl_from; 14use stdx::impl_from;
15use syntax::{ 15use syntax::{
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs
index 6b2de3a06..8750584f9 100644
--- a/crates/ra_hir/src/source_analyzer.rs
+++ b/crates/ra_hir/src/source_analyzer.rs
@@ -31,7 +31,7 @@ use crate::{
31 MacroDef, ModPath, ModuleDef, Path, PathKind, Static, Struct, Trait, Type, TypeAlias, 31 MacroDef, ModPath, ModuleDef, Path, PathKind, Static, Struct, Trait, Type, TypeAlias,
32 TypeParam, 32 TypeParam,
33}; 33};
34use ra_db::CrateId; 34use base_db::CrateId;
35 35
36/// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of 36/// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of
37/// original source files. It should not be used inside the HIR itself. 37/// original source files. It should not be used inside the HIR itself.
diff --git a/crates/ra_hir_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml
index 6156e4a85..d430b08ca 100644
--- a/crates/ra_hir_ty/Cargo.toml
+++ b/crates/ra_hir_ty/Cargo.toml
@@ -18,10 +18,10 @@ rustc-hash = "1.1.0"
18 18
19stdx = { path = "../stdx" } 19stdx = { path = "../stdx" }
20 20
21hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } 21hir_def = { path = "../hir_def" }
22hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } 22hir_expand = { path = "../hir_expand" }
23arena = { path = "../arena" } 23arena = { path = "../arena" }
24ra_db = { path = "../ra_db" } 24base_db = { path = "../base_db" }
25profile = { path = "../profile" } 25profile = { path = "../profile" }
26syntax = { path = "../syntax" } 26syntax = { path = "../syntax" }
27test_utils = { path = "../test_utils" } 27test_utils = { path = "../test_utils" }
diff --git a/crates/ra_hir_ty/src/autoderef.rs b/crates/ra_hir_ty/src/autoderef.rs
index c727012c6..ece68183e 100644
--- a/crates/ra_hir_ty/src/autoderef.rs
+++ b/crates/ra_hir_ty/src/autoderef.rs
@@ -5,10 +5,10 @@
5 5
6use std::iter::successors; 6use std::iter::successors;
7 7
8use base_db::CrateId;
8use hir_def::lang_item::LangItemTarget; 9use hir_def::lang_item::LangItemTarget;
9use hir_expand::name::name; 10use hir_expand::name::name;
10use log::{info, warn}; 11use log::{info, warn};
11use ra_db::CrateId;
12 12
13use crate::{ 13use crate::{
14 db::HirDatabase, 14 db::HirDatabase,
diff --git a/crates/ra_hir_ty/src/db.rs b/crates/ra_hir_ty/src/db.rs
index 7a28673b1..25cf9eb7f 100644
--- a/crates/ra_hir_ty/src/db.rs
+++ b/crates/ra_hir_ty/src/db.rs
@@ -3,11 +3,11 @@
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use arena::map::ArenaMap; 5use arena::map::ArenaMap;
6use base_db::{impl_intern_key, salsa, CrateId, Upcast};
6use hir_def::{ 7use hir_def::{
7 db::DefDatabase, expr::ExprId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId, 8 db::DefDatabase, expr::ExprId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId,
8 TypeParamId, VariantId, 9 TypeParamId, VariantId,
9}; 10};
10use ra_db::{impl_intern_key, salsa, CrateId, Upcast};
11 11
12use crate::{ 12use crate::{
13 method_resolution::{InherentImpls, TraitImpls}, 13 method_resolution::{InherentImpls, TraitImpls},
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs
index bf35d2d0e..ae0cf8d09 100644
--- a/crates/ra_hir_ty/src/diagnostics.rs
+++ b/crates/ra_hir_ty/src/diagnostics.rs
@@ -208,12 +208,12 @@ impl Diagnostic for MismatchedArgCount {
208 208
209#[cfg(test)] 209#[cfg(test)]
210mod tests { 210mod tests {
211 use base_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt};
211 use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId}; 212 use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId};
212 use hir_expand::{ 213 use hir_expand::{
213 db::AstDatabase, 214 db::AstDatabase,
214 diagnostics::{Diagnostic, DiagnosticSinkBuilder}, 215 diagnostics::{Diagnostic, DiagnosticSinkBuilder},
215 }; 216 };
216 use ra_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt};
217 use rustc_hash::FxHashMap; 217 use rustc_hash::FxHashMap;
218 use syntax::{TextRange, TextSize}; 218 use syntax::{TextRange, TextSize};
219 219
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs
index 7698cb0d4..1e748476a 100644
--- a/crates/ra_hir_ty/src/lib.rs
+++ b/crates/ra_hir_ty/src/lib.rs
@@ -26,6 +26,7 @@ mod test_db;
26 26
27use std::{iter, mem, ops::Deref, sync::Arc}; 27use std::{iter, mem, ops::Deref, sync::Arc};
28 28
29use base_db::{salsa, CrateId};
29use hir_def::{ 30use hir_def::{
30 expr::ExprId, 31 expr::ExprId,
31 type_ref::{Mutability, Rawness}, 32 type_ref::{Mutability, Rawness},
@@ -33,7 +34,6 @@ use hir_def::{
33 TypeParamId, 34 TypeParamId,
34}; 35};
35use itertools::Itertools; 36use itertools::Itertools;
36use ra_db::{salsa, CrateId};
37 37
38use crate::{ 38use crate::{
39 db::HirDatabase, 39 db::HirDatabase,
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs
index 7b805fe7a..cd574e983 100644
--- a/crates/ra_hir_ty/src/lower.rs
+++ b/crates/ra_hir_ty/src/lower.rs
@@ -8,6 +8,7 @@
8use std::{iter, sync::Arc}; 8use std::{iter, sync::Arc};
9 9
10use arena::map::ArenaMap; 10use arena::map::ArenaMap;
11use base_db::CrateId;
11use hir_def::{ 12use hir_def::{
12 adt::StructKind, 13 adt::StructKind,
13 builtin_type::BuiltinType, 14 builtin_type::BuiltinType,
@@ -20,7 +21,6 @@ use hir_def::{
20 UnionId, VariantId, 21 UnionId, VariantId,
21}; 22};
22use hir_expand::name::Name; 23use hir_expand::name::Name;
23use ra_db::CrateId;
24use smallvec::SmallVec; 24use smallvec::SmallVec;
25use stdx::impl_from; 25use stdx::impl_from;
26use test_utils::mark; 26use test_utils::mark;
diff --git a/crates/ra_hir_ty/src/method_resolution.rs b/crates/ra_hir_ty/src/method_resolution.rs
index 3b3bee6a7..ec59145c7 100644
--- a/crates/ra_hir_ty/src/method_resolution.rs
+++ b/crates/ra_hir_ty/src/method_resolution.rs
@@ -5,6 +5,7 @@
5use std::{iter, sync::Arc}; 5use std::{iter, sync::Arc};
6 6
7use arrayvec::ArrayVec; 7use arrayvec::ArrayVec;
8use base_db::CrateId;
8use hir_def::{ 9use hir_def::{
9 builtin_type::{IntBitness, Signedness}, 10 builtin_type::{IntBitness, Signedness},
10 lang_item::LangItemTarget, 11 lang_item::LangItemTarget,
@@ -12,7 +13,6 @@ use hir_def::{
12 AssocContainerId, AssocItemId, FunctionId, HasModule, ImplId, Lookup, TraitId, 13 AssocContainerId, AssocItemId, FunctionId, HasModule, ImplId, Lookup, TraitId,
13}; 14};
14use hir_expand::name::Name; 15use hir_expand::name::Name;
15use ra_db::CrateId;
16use rustc_hash::{FxHashMap, FxHashSet}; 16use rustc_hash::{FxHashMap, FxHashSet};
17 17
18use super::Substs; 18use super::Substs;
diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs
index 0e2a69eec..15b8435e9 100644
--- a/crates/ra_hir_ty/src/test_db.rs
+++ b/crates/ra_hir_ty/src/test_db.rs
@@ -5,16 +5,16 @@ use std::{
5 sync::{Arc, Mutex}, 5 sync::{Arc, Mutex},
6}; 6};
7 7
8use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast};
8use hir_def::{db::DefDatabase, ModuleId}; 9use hir_def::{db::DefDatabase, ModuleId};
9use hir_expand::db::AstDatabase; 10use hir_expand::db::AstDatabase;
10use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast};
11use rustc_hash::{FxHashMap, FxHashSet}; 11use rustc_hash::{FxHashMap, FxHashSet};
12use syntax::TextRange; 12use syntax::TextRange;
13use test_utils::extract_annotations; 13use test_utils::extract_annotations;
14 14
15#[salsa::database( 15#[salsa::database(
16 ra_db::SourceDatabaseExtStorage, 16 base_db::SourceDatabaseExtStorage,
17 ra_db::SourceDatabaseStorage, 17 base_db::SourceDatabaseStorage,
18 hir_expand::db::AstDatabaseStorage, 18 hir_expand::db::AstDatabaseStorage,
19 hir_def::db::InternDatabaseStorage, 19 hir_def::db::InternDatabaseStorage,
20 hir_def::db::DefDatabaseStorage, 20 hir_def::db::DefDatabaseStorage,
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs
index 5f6f8869a..f6b172c3a 100644
--- a/crates/ra_hir_ty/src/tests.rs
+++ b/crates/ra_hir_ty/src/tests.rs
@@ -10,6 +10,7 @@ mod display_source_code;
10 10
11use std::sync::Arc; 11use std::sync::Arc;
12 12
13use base_db::{fixture::WithFixture, FileRange, SourceDatabase, SourceDatabaseExt};
13use expect::Expect; 14use expect::Expect;
14use hir_def::{ 15use hir_def::{
15 body::{BodySourceMap, SyntheticSyntax}, 16 body::{BodySourceMap, SyntheticSyntax},
@@ -21,7 +22,6 @@ use hir_def::{
21 AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId, 22 AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId,
22}; 23};
23use hir_expand::{db::AstDatabase, InFile}; 24use hir_expand::{db::AstDatabase, InFile};
24use ra_db::{fixture::WithFixture, FileRange, SourceDatabase, SourceDatabaseExt};
25use stdx::format_to; 25use stdx::format_to;
26use syntax::{ 26use syntax::{
27 algo, 27 algo,
diff --git a/crates/ra_hir_ty/src/tests/simple.rs b/crates/ra_hir_ty/src/tests/simple.rs
index 5a7cf9455..59eb59d5f 100644
--- a/crates/ra_hir_ty/src/tests/simple.rs
+++ b/crates/ra_hir_ty/src/tests/simple.rs
@@ -1776,8 +1776,8 @@ fn main() {
1776 ); 1776 );
1777} 1777}
1778 1778
1779// This test is actually testing the shadowing behavior within ra_hir_def. It 1779// This test is actually testing the shadowing behavior within hir_def. It
1780// lives here because the testing infrastructure in ra_hir_def isn't currently 1780// lives here because the testing infrastructure in hir_def isn't currently
1781// capable of asserting the necessary conditions. 1781// capable of asserting the necessary conditions.
1782#[test] 1782#[test]
1783fn should_be_shadowing_imports() { 1783fn should_be_shadowing_imports() {
diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs
index 2576a9dfc..255323717 100644
--- a/crates/ra_hir_ty/src/traits.rs
+++ b/crates/ra_hir_ty/src/traits.rs
@@ -1,10 +1,10 @@
1//! Trait solving using Chalk. 1//! Trait solving using Chalk.
2use std::sync::Arc; 2use std::sync::Arc;
3 3
4use base_db::CrateId;
4use chalk_ir::cast::Cast; 5use chalk_ir::cast::Cast;
5use chalk_solve::Solver; 6use chalk_solve::Solver;
6use hir_def::{lang_item::LangItemTarget, TraitId}; 7use hir_def::{lang_item::LangItemTarget, TraitId};
7use ra_db::CrateId;
8 8
9use crate::{db::HirDatabase, DebruijnIndex, Substs}; 9use crate::{db::HirDatabase, DebruijnIndex, Substs};
10 10
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs
index 3b6af5c9a..b33653417 100644
--- a/crates/ra_hir_ty/src/traits/chalk.rs
+++ b/crates/ra_hir_ty/src/traits/chalk.rs
@@ -6,11 +6,11 @@ use log::debug;
6use chalk_ir::{fold::shift::Shift, CanonicalVarKinds, GenericArg, TypeName}; 6use chalk_ir::{fold::shift::Shift, CanonicalVarKinds, GenericArg, TypeName};
7use chalk_solve::rust_ir::{self, OpaqueTyDatumBound, WellKnownTrait}; 7use chalk_solve::rust_ir::{self, OpaqueTyDatumBound, WellKnownTrait};
8 8
9use base_db::{salsa::InternKey, CrateId};
9use hir_def::{ 10use hir_def::{
10 lang_item::{lang_attr, LangItemTarget}, 11 lang_item::{lang_attr, LangItemTarget},
11 AssocContainerId, AssocItemId, HasModule, Lookup, TypeAliasId, 12 AssocContainerId, AssocItemId, HasModule, Lookup, TypeAliasId,
12}; 13};
13use ra_db::{salsa::InternKey, CrateId};
14 14
15use super::ChalkContext; 15use super::ChalkContext;
16use crate::{ 16use crate::{
diff --git a/crates/ra_hir_ty/src/traits/chalk/interner.rs b/crates/ra_hir_ty/src/traits/chalk/interner.rs
index 8d4c51a8f..fc0f9c201 100644
--- a/crates/ra_hir_ty/src/traits/chalk/interner.rs
+++ b/crates/ra_hir_ty/src/traits/chalk/interner.rs
@@ -2,9 +2,9 @@
2//! representation of the various objects Chalk deals with (types, goals etc.). 2//! representation of the various objects Chalk deals with (types, goals etc.).
3 3
4use super::tls; 4use super::tls;
5use base_db::salsa::InternId;
5use chalk_ir::{GenericArg, Goal, GoalData}; 6use chalk_ir::{GenericArg, Goal, GoalData};
6use hir_def::TypeAliasId; 7use hir_def::TypeAliasId;
7use ra_db::salsa::InternId;
8use std::{fmt, sync::Arc}; 8use std::{fmt, sync::Arc};
9 9
10#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] 10#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
diff --git a/crates/ra_hir_ty/src/traits/chalk/mapping.rs b/crates/ra_hir_ty/src/traits/chalk/mapping.rs
index b3e92993d..fe62f3fa7 100644
--- a/crates/ra_hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/ra_hir_ty/src/traits/chalk/mapping.rs
@@ -9,8 +9,8 @@ use chalk_ir::{
9}; 9};
10use chalk_solve::rust_ir; 10use chalk_solve::rust_ir;
11 11
12use base_db::salsa::InternKey;
12use hir_def::{type_ref::Mutability, AssocContainerId, GenericDefId, Lookup, TypeAliasId}; 13use hir_def::{type_ref::Mutability, AssocContainerId, GenericDefId, Lookup, TypeAliasId};
13use ra_db::salsa::InternKey;
14 14
15use crate::{ 15use crate::{
16 db::HirDatabase, 16 db::HirDatabase,
diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml
index 938398a41..1af51f3ae 100644
--- a/crates/ra_ide/Cargo.toml
+++ b/crates/ra_ide/Cargo.toml
@@ -23,7 +23,7 @@ stdx = { path = "../stdx" }
23 23
24syntax = { path = "../syntax" } 24syntax = { path = "../syntax" }
25text_edit = { path = "../text_edit" } 25text_edit = { path = "../text_edit" }
26ra_db = { path = "../ra_db" } 26base_db = { path = "../base_db" }
27ra_ide_db = { path = "../ra_ide_db" } 27ra_ide_db = { path = "../ra_ide_db" }
28cfg = { path = "../cfg" } 28cfg = { path = "../cfg" }
29profile = { path = "../profile" } 29profile = { path = "../profile" }
diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ra_ide/src/call_hierarchy.rs
index 116e6bf83..3578b8d3c 100644
--- a/crates/ra_ide/src/call_hierarchy.rs
+++ b/crates/ra_ide/src/call_hierarchy.rs
@@ -137,7 +137,7 @@ impl CallLocations {
137 137
138#[cfg(test)] 138#[cfg(test)]
139mod tests { 139mod tests {
140 use ra_db::FilePosition; 140 use base_db::FilePosition;
141 141
142 use crate::mock_analysis::analysis_and_position; 142 use crate::mock_analysis::analysis_and_position;
143 143
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index b5efb6cd6..0e0a201d0 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -1,7 +1,7 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use base_db::SourceDatabase;
3use hir::{Semantics, SemanticsScope, Type}; 4use hir::{Semantics, SemanticsScope, Type};
4use ra_db::SourceDatabase;
5use ra_ide_db::RootDatabase; 5use ra_ide_db::RootDatabase;
6use syntax::{ 6use syntax::{
7 algo::{find_covering_element, find_node_at_offset}, 7 algo::{find_covering_element, find_node_at_offset},
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs
index 18def6115..4e59e3a48 100644
--- a/crates/ra_ide/src/diagnostics.rs
+++ b/crates/ra_ide/src/diagnostics.rs
@@ -6,9 +6,9 @@
6 6
7use std::cell::RefCell; 7use std::cell::RefCell;
8 8
9use base_db::SourceDatabase;
9use hir::{diagnostics::DiagnosticSinkBuilder, Semantics}; 10use hir::{diagnostics::DiagnosticSinkBuilder, Semantics};
10use itertools::Itertools; 11use itertools::Itertools;
11use ra_db::SourceDatabase;
12use ra_ide_db::RootDatabase; 12use ra_ide_db::RootDatabase;
13use syntax::{ 13use syntax::{
14 ast::{self, AstNode}, 14 ast::{self, AstNode},
diff --git a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs b/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
index efcd631b3..7e126d7a6 100644
--- a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
+++ b/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
@@ -2,12 +2,12 @@
2//! The same module also has all curret custom fixes for the diagnostics implemented. 2//! The same module also has all curret custom fixes for the diagnostics implemented.
3use crate::Fix; 3use crate::Fix;
4use ast::{edit::IndentLevel, make}; 4use ast::{edit::IndentLevel, make};
5use base_db::FileId;
5use hir::{ 6use hir::{
6 db::AstDatabase, 7 db::AstDatabase,
7 diagnostics::{Diagnostic, MissingFields, MissingOkInTailExpr, NoSuchField, UnresolvedModule}, 8 diagnostics::{Diagnostic, MissingFields, MissingOkInTailExpr, NoSuchField, UnresolvedModule},
8 HasSource, HirDisplay, Semantics, VariantDef, 9 HasSource, HirDisplay, Semantics, VariantDef,
9}; 10};
10use ra_db::FileId;
11use ra_ide_db::{ 11use ra_ide_db::{
12 source_change::{FileSystemEdit, SourceFileEdit}, 12 source_change::{FileSystemEdit, SourceFileEdit},
13 RootDatabase, 13 RootDatabase,
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs
index 683088a74..09ec3f65e 100644
--- a/crates/ra_ide/src/display/navigation_target.rs
+++ b/crates/ra_ide/src/display/navigation_target.rs
@@ -1,8 +1,8 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use base_db::{FileId, SourceDatabase};
3use either::Either; 4use either::Either;
4use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource}; 5use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource};
5use ra_db::{FileId, SourceDatabase};
6use ra_ide_db::{defs::Definition, RootDatabase}; 6use ra_ide_db::{defs::Definition, RootDatabase};
7use syntax::{ 7use syntax::{
8 ast::{self, DocCommentsOwner, NameOwner}, 8 ast::{self, DocCommentsOwner, NameOwner},
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs
index 77f374ea2..b93d116bf 100644
--- a/crates/ra_ide/src/goto_definition.rs
+++ b/crates/ra_ide/src/goto_definition.rs
@@ -100,7 +100,7 @@ pub(crate) fn reference_definition(
100 100
101#[cfg(test)] 101#[cfg(test)]
102mod tests { 102mod tests {
103 use ra_db::FileRange; 103 use base_db::FileRange;
104 use syntax::{TextRange, TextSize}; 104 use syntax::{TextRange, TextSize};
105 105
106 use crate::mock_analysis::MockAnalysis; 106 use crate::mock_analysis::MockAnalysis;
diff --git a/crates/ra_ide/src/goto_implementation.rs b/crates/ra_ide/src/goto_implementation.rs
index 91a8c1dd1..6dc2ccfd0 100644
--- a/crates/ra_ide/src/goto_implementation.rs
+++ b/crates/ra_ide/src/goto_implementation.rs
@@ -74,7 +74,7 @@ fn impls_for_trait(
74 74
75#[cfg(test)] 75#[cfg(test)]
76mod tests { 76mod tests {
77 use ra_db::FileRange; 77 use base_db::FileRange;
78 78
79 use crate::mock_analysis::MockAnalysis; 79 use crate::mock_analysis::MockAnalysis;
80 80
diff --git a/crates/ra_ide/src/goto_type_definition.rs b/crates/ra_ide/src/goto_type_definition.rs
index 3ec2ee59d..8017ca58c 100644
--- a/crates/ra_ide/src/goto_type_definition.rs
+++ b/crates/ra_ide/src/goto_type_definition.rs
@@ -54,7 +54,7 @@ fn pick_best(tokens: TokenAtOffset<SyntaxToken>) -> Option<SyntaxToken> {
54 54
55#[cfg(test)] 55#[cfg(test)]
56mod tests { 56mod tests {
57 use ra_db::FileRange; 57 use base_db::FileRange;
58 58
59 use crate::mock_analysis::MockAnalysis; 59 use crate::mock_analysis::MockAnalysis;
60 60
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index 37e68ff7a..a74087f87 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -1,9 +1,9 @@
1use base_db::SourceDatabase;
1use hir::{ 2use hir::{
2 Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay, 3 Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay,
3 Module, ModuleDef, ModuleSource, Semantics, 4 Module, ModuleDef, ModuleSource, Semantics,
4}; 5};
5use itertools::Itertools; 6use itertools::Itertools;
6use ra_db::SourceDatabase;
7use ra_ide_db::{ 7use ra_ide_db::{
8 defs::{classify_name, classify_name_ref, Definition}, 8 defs::{classify_name, classify_name_ref, Definition},
9 RootDatabase, 9 RootDatabase,
@@ -352,8 +352,8 @@ fn pick_best(tokens: TokenAtOffset<SyntaxToken>) -> Option<SyntaxToken> {
352 352
353#[cfg(test)] 353#[cfg(test)]
354mod tests { 354mod tests {
355 use base_db::FileLoader;
355 use expect::{expect, Expect}; 356 use expect::{expect, Expect};
356 use ra_db::FileLoader;
357 357
358 use crate::mock_analysis::analysis_and_position; 358 use crate::mock_analysis::analysis_and_position;
359 359
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 1fdf17800..789fbdaf2 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -47,11 +47,11 @@ mod typing;
47 47
48use std::sync::Arc; 48use std::sync::Arc;
49 49
50use cfg::CfgOptions; 50use base_db::{
51use ra_db::{
52 salsa::{self, ParallelDatabase}, 51 salsa::{self, ParallelDatabase},
53 CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, 52 CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath,
54}; 53};
54use cfg::CfgOptions;
55use ra_ide_db::{ 55use ra_ide_db::{
56 symbol_index::{self, FileSymbol}, 56 symbol_index::{self, FileSymbol},
57 LineIndexDatabase, 57 LineIndexDatabase,
@@ -81,12 +81,12 @@ pub use crate::{
81 }, 81 },
82}; 82};
83 83
84pub use hir::{Documentation, Semantics}; 84pub use base_db::{
85pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
86pub use ra_db::{
87 Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot, 85 Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot,
88 SourceRootId, 86 SourceRootId,
89}; 87};
88pub use hir::{Documentation, Semantics};
89pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
90pub use ra_ide_db::{ 90pub use ra_ide_db::{
91 change::AnalysisChange, 91 change::AnalysisChange,
92 line_index::{LineCol, LineIndex}, 92 line_index::{LineCol, LineIndex},
diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs
index a4691f028..363e6d27e 100644
--- a/crates/ra_ide/src/mock_analysis.rs
+++ b/crates/ra_ide/src/mock_analysis.rs
@@ -1,8 +1,8 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2use std::sync::Arc; 2use std::sync::Arc;
3 3
4use base_db::{CrateName, FileSet, SourceRoot, VfsPath};
4use cfg::CfgOptions; 5use cfg::CfgOptions;
5use ra_db::{CrateName, FileSet, SourceRoot, VfsPath};
6use test_utils::{ 6use test_utils::{
7 extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER, 7 extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER,
8}; 8};
diff --git a/crates/ra_ide/src/parent_module.rs b/crates/ra_ide/src/parent_module.rs
index b78388e6b..8439e1d5d 100644
--- a/crates/ra_ide/src/parent_module.rs
+++ b/crates/ra_ide/src/parent_module.rs
@@ -1,5 +1,5 @@
1use base_db::{CrateId, FileId, FilePosition};
1use hir::Semantics; 2use hir::Semantics;
2use ra_db::{CrateId, FileId, FilePosition};
3use ra_ide_db::RootDatabase; 3use ra_ide_db::RootDatabase;
4use syntax::{ 4use syntax::{
5 algo::find_node_at_offset, 5 algo::find_node_at_offset,
@@ -63,8 +63,8 @@ pub(crate) fn crate_for(db: &RootDatabase, file_id: FileId) -> Vec<CrateId> {
63 63
64#[cfg(test)] 64#[cfg(test)]
65mod tests { 65mod tests {
66 use base_db::Env;
66 use cfg::CfgOptions; 67 use cfg::CfgOptions;
67 use ra_db::Env;
68 use test_utils::mark; 68 use test_utils::mark;
69 69
70 use crate::{ 70 use crate::{
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs
index a075618e7..5697b9d87 100644
--- a/crates/ra_ide/src/references/rename.rs
+++ b/crates/ra_ide/src/references/rename.rs
@@ -1,7 +1,7 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use base_db::SourceDatabaseExt;
3use hir::{Module, ModuleDef, ModuleSource, Semantics}; 4use hir::{Module, ModuleDef, ModuleSource, Semantics};
4use ra_db::SourceDatabaseExt;
5use ra_ide_db::{ 5use ra_ide_db::{
6 defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass}, 6 defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass},
7 RootDatabase, 7 RootDatabase,
diff --git a/crates/ra_ide/src/ssr.rs b/crates/ra_ide/src/ssr.rs
index 8be862fd6..97b82b70e 100644
--- a/crates/ra_ide/src/ssr.rs
+++ b/crates/ra_ide/src/ssr.rs
@@ -1,4 +1,4 @@
1use ra_db::{FilePosition, FileRange}; 1use base_db::{FilePosition, FileRange};
2use ra_ide_db::RootDatabase; 2use ra_ide_db::RootDatabase;
3 3
4use crate::SourceFileEdit; 4use crate::SourceFileEdit;
diff --git a/crates/ra_ide/src/status.rs b/crates/ra_ide/src/status.rs
index 797ead1ad..869c74acc 100644
--- a/crates/ra_ide/src/status.rs
+++ b/crates/ra_ide/src/status.rs
@@ -1,11 +1,11 @@
1use std::{fmt, iter::FromIterator, sync::Arc}; 1use std::{fmt, iter::FromIterator, sync::Arc};
2 2
3use hir::MacroFile; 3use base_db::{
4use profile::{memory_usage, Bytes};
5use ra_db::{
6 salsa::debug::{DebugQueryTable, TableEntry}, 4 salsa::debug::{DebugQueryTable, TableEntry},
7 FileTextQuery, SourceRootId, 5 FileTextQuery, SourceRootId,
8}; 6};
7use hir::MacroFile;
8use profile::{memory_usage, Bytes};
9use ra_ide_db::{ 9use ra_ide_db::{
10 symbol_index::{LibrarySymbolsQuery, SymbolIndex}, 10 symbol_index::{LibrarySymbolsQuery, SymbolIndex},
11 RootDatabase, 11 RootDatabase,
@@ -16,7 +16,7 @@ use syntax::{ast, Parse, SyntaxNode};
16use crate::FileId; 16use crate::FileId;
17 17
18fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 18fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
19 ra_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>() 19 base_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>()
20} 20}
21fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 21fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
22 hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>() 22 hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>()
diff --git a/crates/ra_ide/src/syntax_highlighting/html.rs b/crates/ra_ide/src/syntax_highlighting/html.rs
index 418122648..249368ff8 100644
--- a/crates/ra_ide/src/syntax_highlighting/html.rs
+++ b/crates/ra_ide/src/syntax_highlighting/html.rs
@@ -1,7 +1,7 @@
1//! Renders a bit of code as HTML. 1//! Renders a bit of code as HTML.
2 2
3use base_db::SourceDatabase;
3use oorandom::Rand32; 4use oorandom::Rand32;
4use ra_db::SourceDatabase;
5use syntax::{AstNode, TextRange, TextSize}; 5use syntax::{AstNode, TextRange, TextSize};
6 6
7use crate::{syntax_highlighting::highlight, FileId, RootDatabase}; 7use crate::{syntax_highlighting::highlight, FileId, RootDatabase};
diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs
index d05ff2214..17daf06b6 100644
--- a/crates/ra_ide/src/syntax_tree.rs
+++ b/crates/ra_ide/src/syntax_tree.rs
@@ -1,4 +1,4 @@
1use ra_db::{FileId, SourceDatabase}; 1use base_db::{FileId, SourceDatabase};
2use ra_ide_db::RootDatabase; 2use ra_ide_db::RootDatabase;
3use syntax::{ 3use syntax::{
4 algo, AstNode, NodeOrToken, SourceFile, 4 algo, AstNode, NodeOrToken, SourceFile,
diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs
index 7897c57b7..75f2a6b60 100644
--- a/crates/ra_ide/src/typing.rs
+++ b/crates/ra_ide/src/typing.rs
@@ -15,7 +15,7 @@
15 15
16mod on_enter; 16mod on_enter;
17 17
18use ra_db::{FilePosition, SourceDatabase}; 18use base_db::{FilePosition, SourceDatabase};
19use ra_ide_db::{source_change::SourceFileEdit, RootDatabase}; 19use ra_ide_db::{source_change::SourceFileEdit, RootDatabase};
20use syntax::{ 20use syntax::{
21 algo::find_node_at_offset, 21 algo::find_node_at_offset,
diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ra_ide/src/typing/on_enter.rs
index 9cd153f94..193930659 100644
--- a/crates/ra_ide/src/typing/on_enter.rs
+++ b/crates/ra_ide/src/typing/on_enter.rs
@@ -1,7 +1,7 @@
1//! Handles the `Enter` key press. At the momently, this only continues 1//! Handles the `Enter` key press. At the momently, this only continues
2//! comments, but should handle indent some time in the future as well. 2//! comments, but should handle indent some time in the future as well.
3 3
4use ra_db::{FilePosition, SourceDatabase}; 4use base_db::{FilePosition, SourceDatabase};
5use ra_ide_db::RootDatabase; 5use ra_ide_db::RootDatabase;
6use syntax::{ 6use syntax::{
7 ast::{self, AstToken}, 7 ast::{self, AstToken},
diff --git a/crates/ra_ide_db/Cargo.toml b/crates/ra_ide_db/Cargo.toml
index 9ed13a13d..0cda7090d 100644
--- a/crates/ra_ide_db/Cargo.toml
+++ b/crates/ra_ide_db/Cargo.toml
@@ -23,7 +23,7 @@ stdx = { path = "../stdx" }
23 23
24syntax = { path = "../syntax" } 24syntax = { path = "../syntax" }
25text_edit = { path = "../text_edit" } 25text_edit = { path = "../text_edit" }
26ra_db = { path = "../ra_db" } 26base_db = { path = "../base_db" }
27profile = { path = "../profile" } 27profile = { path = "../profile" }
28test_utils = { path = "../test_utils" } 28test_utils = { path = "../test_utils" }
29 29
diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs
index 7a4e04ca9..8b4fd7ab8 100644
--- a/crates/ra_ide_db/src/change.rs
+++ b/crates/ra_ide_db/src/change.rs
@@ -3,11 +3,11 @@
3 3
4use std::{fmt, sync::Arc, time}; 4use std::{fmt, sync::Arc, time};
5 5
6use profile::{memory_usage, Bytes}; 6use base_db::{
7use ra_db::{
8 salsa::{Database, Durability, SweepStrategy}, 7 salsa::{Database, Durability, SweepStrategy},
9 CrateGraph, FileId, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId, 8 CrateGraph, FileId, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId,
10}; 9};
10use profile::{memory_usage, Bytes};
11use rustc_hash::FxHashSet; 11use rustc_hash::FxHashSet;
12 12
13use crate::{symbol_index::SymbolsDatabase, RootDatabase}; 13use crate::{symbol_index::SymbolsDatabase, RootDatabase};
@@ -146,7 +146,7 @@ impl RootDatabase {
146 146
147 let sweep = SweepStrategy::default().discard_values().sweep_all_revisions(); 147 let sweep = SweepStrategy::default().discard_values().sweep_all_revisions();
148 148
149 ra_db::ParseQuery.in_db(self).sweep(sweep); 149 base_db::ParseQuery.in_db(self).sweep(sweep);
150 hir::db::ParseMacroQuery.in_db(self).sweep(sweep); 150 hir::db::ParseMacroQuery.in_db(self).sweep(sweep);
151 151
152 // Macros do take significant space, but less then the syntax trees 152 // Macros do take significant space, but less then the syntax trees
@@ -201,14 +201,14 @@ impl RootDatabase {
201 } 201 }
202 sweep_each_query![ 202 sweep_each_query![
203 // SourceDatabase 203 // SourceDatabase
204 ra_db::ParseQuery 204 base_db::ParseQuery
205 ra_db::CrateGraphQuery 205 base_db::CrateGraphQuery
206 206
207 // SourceDatabaseExt 207 // SourceDatabaseExt
208 ra_db::FileTextQuery 208 base_db::FileTextQuery
209 ra_db::FileSourceRootQuery 209 base_db::FileSourceRootQuery
210 ra_db::SourceRootQuery 210 base_db::SourceRootQuery
211 ra_db::SourceRootCratesQuery 211 base_db::SourceRootCratesQuery
212 212
213 // AstDatabase 213 // AstDatabase
214 hir::db::AstIdMapQuery 214 hir::db::AstIdMapQuery
diff --git a/crates/ra_ide_db/src/lib.rs b/crates/ra_ide_db/src/lib.rs
index 6900cac73..fd474cd0f 100644
--- a/crates/ra_ide_db/src/lib.rs
+++ b/crates/ra_ide_db/src/lib.rs
@@ -13,19 +13,19 @@ mod wasm_shims;
13 13
14use std::{fmt, sync::Arc}; 14use std::{fmt, sync::Arc};
15 15
16use hir::db::{AstDatabase, DefDatabase, HirDatabase}; 16use base_db::{
17use ra_db::{
18 salsa::{self, Durability}, 17 salsa::{self, Durability},
19 Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, 18 Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase,
20 Upcast, 19 Upcast,
21}; 20};
21use hir::db::{AstDatabase, DefDatabase, HirDatabase};
22use rustc_hash::FxHashSet; 22use rustc_hash::FxHashSet;
23 23
24use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase}; 24use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
25 25
26#[salsa::database( 26#[salsa::database(
27 ra_db::SourceDatabaseStorage, 27 base_db::SourceDatabaseStorage,
28 ra_db::SourceDatabaseExtStorage, 28 base_db::SourceDatabaseExtStorage,
29 LineIndexDatabaseStorage, 29 LineIndexDatabaseStorage,
30 symbol_index::SymbolsDatabaseStorage, 30 symbol_index::SymbolsDatabaseStorage,
31 hir::db::InternDatabaseStorage, 31 hir::db::InternDatabaseStorage,
@@ -111,8 +111,8 @@ impl RootDatabase {
111 } 111 }
112 112
113 pub fn update_lru_capacity(&mut self, lru_capacity: Option<usize>) { 113 pub fn update_lru_capacity(&mut self, lru_capacity: Option<usize>) {
114 let lru_capacity = lru_capacity.unwrap_or(ra_db::DEFAULT_LRU_CAP); 114 let lru_capacity = lru_capacity.unwrap_or(base_db::DEFAULT_LRU_CAP);
115 ra_db::ParseQuery.in_db_mut(self).set_lru_capacity(lru_capacity); 115 base_db::ParseQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
116 hir::db::ParseMacroQuery.in_db_mut(self).set_lru_capacity(lru_capacity); 116 hir::db::ParseMacroQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
117 hir::db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(lru_capacity); 117 hir::db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
118 } 118 }
@@ -129,7 +129,7 @@ impl salsa::ParallelDatabase for RootDatabase {
129} 129}
130 130
131#[salsa::query_group(LineIndexDatabaseStorage)] 131#[salsa::query_group(LineIndexDatabaseStorage)]
132pub trait LineIndexDatabase: ra_db::SourceDatabase + CheckCanceled { 132pub trait LineIndexDatabase: base_db::SourceDatabase + CheckCanceled {
133 fn line_index(&self, file_id: FileId) -> Arc<LineIndex>; 133 fn line_index(&self, file_id: FileId) -> Arc<LineIndex>;
134} 134}
135 135
diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs
index 7827cc71c..b9360bf12 100644
--- a/crates/ra_ide_db/src/search.rs
+++ b/crates/ra_ide_db/src/search.rs
@@ -6,9 +6,9 @@
6 6
7use std::{convert::TryInto, mem}; 7use std::{convert::TryInto, mem};
8 8
9use base_db::{FileId, FileRange, SourceDatabaseExt};
9use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; 10use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility};
10use once_cell::unsync::Lazy; 11use once_cell::unsync::Lazy;
11use ra_db::{FileId, FileRange, SourceDatabaseExt};
12use rustc_hash::FxHashMap; 12use rustc_hash::FxHashMap;
13use syntax::{ast, match_ast, AstNode, TextRange, TextSize}; 13use syntax::{ast, match_ast, AstNode, TextRange, TextSize};
14 14
diff --git a/crates/ra_ide_db/src/source_change.rs b/crates/ra_ide_db/src/source_change.rs
index ae21132dd..f1590ec66 100644
--- a/crates/ra_ide_db/src/source_change.rs
+++ b/crates/ra_ide_db/src/source_change.rs
@@ -3,7 +3,7 @@
3//! 3//!
4//! It can be viewed as a dual for `AnalysisChange`. 4//! It can be viewed as a dual for `AnalysisChange`.
5 5
6use ra_db::FileId; 6use base_db::FileId;
7use text_edit::TextEdit; 7use text_edit::TextEdit;
8 8
9#[derive(Default, Debug, Clone)] 9#[derive(Default, Debug, Clone)]
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs
index 896092b46..654df898e 100644
--- a/crates/ra_ide_db/src/symbol_index.rs
+++ b/crates/ra_ide_db/src/symbol_index.rs
@@ -28,12 +28,12 @@ use std::{
28 sync::Arc, 28 sync::Arc,
29}; 29};
30 30
31use fst::{self, Streamer}; 31use base_db::{
32use hir::db::DefDatabase;
33use ra_db::{
34 salsa::{self, ParallelDatabase}, 32 salsa::{self, ParallelDatabase},
35 CrateId, FileId, SourceDatabaseExt, SourceRootId, 33 CrateId, FileId, SourceDatabaseExt, SourceRootId,
36}; 34};
35use fst::{self, Streamer};
36use hir::db::DefDatabase;
37use rayon::prelude::*; 37use rayon::prelude::*;
38use rustc_hash::{FxHashMap, FxHashSet}; 38use rustc_hash::{FxHashMap, FxHashSet};
39use syntax::{ 39use syntax::{
diff --git a/crates/ra_ssr/Cargo.toml b/crates/ra_ssr/Cargo.toml
index 958baa2df..f290939cf 100644
--- a/crates/ra_ssr/Cargo.toml
+++ b/crates/ra_ssr/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
13[dependencies] 13[dependencies]
14text_edit = { path = "../text_edit" } 14text_edit = { path = "../text_edit" }
15syntax = { path = "../syntax" } 15syntax = { path = "../syntax" }
16ra_db = { path = "../ra_db" } 16base_db = { path = "../base_db" }
17ra_ide_db = { path = "../ra_ide_db" } 17ra_ide_db = { path = "../ra_ide_db" }
18hir = { path = "../ra_hir", package = "ra_hir" } 18hir = { path = "../ra_hir", package = "ra_hir" }
19rustc-hash = "1.1.0" 19rustc-hash = "1.1.0"
diff --git a/crates/ra_ssr/src/lib.rs b/crates/ra_ssr/src/lib.rs
index fb53212a3..6725582e4 100644
--- a/crates/ra_ssr/src/lib.rs
+++ b/crates/ra_ssr/src/lib.rs
@@ -18,8 +18,8 @@ use crate::errors::bail;
18pub use crate::errors::SsrError; 18pub use crate::errors::SsrError;
19pub use crate::matching::Match; 19pub use crate::matching::Match;
20use crate::matching::MatchFailureReason; 20use crate::matching::MatchFailureReason;
21use base_db::{FileId, FilePosition, FileRange};
21use hir::Semantics; 22use hir::Semantics;
22use ra_db::{FileId, FilePosition, FileRange};
23use ra_ide_db::source_change::SourceFileEdit; 23use ra_ide_db::source_change::SourceFileEdit;
24use resolving::ResolvedRule; 24use resolving::ResolvedRule;
25use rustc_hash::FxHashMap; 25use rustc_hash::FxHashMap;
@@ -71,7 +71,7 @@ impl<'db> MatchFinder<'db> {
71 71
72 /// Constructs an instance using the start of the first file in `db` as the lookup context. 72 /// Constructs an instance using the start of the first file in `db` as the lookup context.
73 pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> { 73 pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
74 use ra_db::SourceDatabaseExt; 74 use base_db::SourceDatabaseExt;
75 use ra_ide_db::symbol_index::SymbolsDatabase; 75 use ra_ide_db::symbol_index::SymbolsDatabase;
76 if let Some(first_file_id) = db 76 if let Some(first_file_id) = db
77 .local_roots() 77 .local_roots()
@@ -105,7 +105,7 @@ impl<'db> MatchFinder<'db> {
105 105
106 /// Finds matches for all added rules and returns edits for all found matches. 106 /// Finds matches for all added rules and returns edits for all found matches.
107 pub fn edits(&self) -> Vec<SourceFileEdit> { 107 pub fn edits(&self) -> Vec<SourceFileEdit> {
108 use ra_db::SourceDatabaseExt; 108 use base_db::SourceDatabaseExt;
109 let mut matches_by_file = FxHashMap::default(); 109 let mut matches_by_file = FxHashMap::default();
110 for m in self.matches().matches { 110 for m in self.matches().matches {
111 matches_by_file 111 matches_by_file
@@ -150,7 +150,7 @@ impl<'db> MatchFinder<'db> {
150 /// them, while recording reasons why they don't match. This API is useful for command 150 /// them, while recording reasons why they don't match. This API is useful for command
151 /// line-based debugging where providing a range is difficult. 151 /// line-based debugging where providing a range is difficult.
152 pub fn debug_where_text_equal(&self, file_id: FileId, snippet: &str) -> Vec<MatchDebugInfo> { 152 pub fn debug_where_text_equal(&self, file_id: FileId, snippet: &str) -> Vec<MatchDebugInfo> {
153 use ra_db::SourceDatabaseExt; 153 use base_db::SourceDatabaseExt;
154 let file = self.sema.parse(file_id); 154 let file = self.sema.parse(file_id);
155 let mut res = Vec::new(); 155 let mut res = Vec::new();
156 let file_text = self.sema.db.file_text(file_id); 156 let file_text = self.sema.db.file_text(file_id);
diff --git a/crates/ra_ssr/src/matching.rs b/crates/ra_ssr/src/matching.rs
index 6e0b92352..e81a87c47 100644
--- a/crates/ra_ssr/src/matching.rs
+++ b/crates/ra_ssr/src/matching.rs
@@ -6,8 +6,8 @@ use crate::{
6 resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo}, 6 resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo},
7 SsrMatches, 7 SsrMatches,
8}; 8};
9use base_db::FileRange;
9use hir::Semantics; 10use hir::Semantics;
10use ra_db::FileRange;
11use rustc_hash::FxHashMap; 11use rustc_hash::FxHashMap;
12use std::{cell::Cell, iter::Peekable}; 12use std::{cell::Cell, iter::Peekable};
13use syntax::ast::{AstNode, AstToken}; 13use syntax::ast::{AstNode, AstToken};
diff --git a/crates/ra_ssr/src/resolving.rs b/crates/ra_ssr/src/resolving.rs
index bfc20705b..dac09bae8 100644
--- a/crates/ra_ssr/src/resolving.rs
+++ b/crates/ra_ssr/src/resolving.rs
@@ -2,8 +2,8 @@
2 2
3use crate::errors::error; 3use crate::errors::error;
4use crate::{parsing, SsrError}; 4use crate::{parsing, SsrError};
5use base_db::FilePosition;
5use parsing::Placeholder; 6use parsing::Placeholder;
6use ra_db::FilePosition;
7use rustc_hash::FxHashMap; 7use rustc_hash::FxHashMap;
8use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken}; 8use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken};
9use test_utils::mark; 9use test_utils::mark;
diff --git a/crates/ra_ssr/src/search.rs b/crates/ra_ssr/src/search.rs
index e44e14959..434953fb4 100644
--- a/crates/ra_ssr/src/search.rs
+++ b/crates/ra_ssr/src/search.rs
@@ -5,7 +5,7 @@ use crate::{
5 resolving::{ResolvedPath, ResolvedPattern, ResolvedRule}, 5 resolving::{ResolvedPath, ResolvedPattern, ResolvedRule},
6 Match, MatchFinder, 6 Match, MatchFinder,
7}; 7};
8use ra_db::{FileId, FileRange}; 8use base_db::{FileId, FileRange};
9use ra_ide_db::{ 9use ra_ide_db::{
10 defs::Definition, 10 defs::Definition,
11 search::{Reference, SearchScope}, 11 search::{Reference, SearchScope},
@@ -145,7 +145,7 @@ impl<'db> MatchFinder<'db> {
145 fn search_files_do(&self, mut callback: impl FnMut(FileId)) { 145 fn search_files_do(&self, mut callback: impl FnMut(FileId)) {
146 if self.restrict_ranges.is_empty() { 146 if self.restrict_ranges.is_empty() {
147 // Unrestricted search. 147 // Unrestricted search.
148 use ra_db::SourceDatabaseExt; 148 use base_db::SourceDatabaseExt;
149 use ra_ide_db::symbol_index::SymbolsDatabase; 149 use ra_ide_db::symbol_index::SymbolsDatabase;
150 for &root in self.sema.db.local_roots().iter() { 150 for &root in self.sema.db.local_roots().iter() {
151 let sr = self.sema.db.source_root(root); 151 let sr = self.sema.db.source_root(root);
diff --git a/crates/ra_ssr/src/tests.rs b/crates/ra_ssr/src/tests.rs
index 4bc09c1e4..54c3da9db 100644
--- a/crates/ra_ssr/src/tests.rs
+++ b/crates/ra_ssr/src/tests.rs
@@ -1,6 +1,6 @@
1use crate::{MatchFinder, SsrRule}; 1use crate::{MatchFinder, SsrRule};
2use base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt};
2use expect::{expect, Expect}; 3use expect::{expect, Expect};
3use ra_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt};
4use rustc_hash::FxHashSet; 4use rustc_hash::FxHashSet;
5use std::sync::Arc; 5use std::sync::Arc;
6use test_utils::{mark, RangeOrOffset}; 6use test_utils::{mark, RangeOrOffset};
@@ -62,7 +62,7 @@ fn parser_undefined_placeholder_in_replacement() {
62/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be 62/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be
63/// the start of the file. If there's a second cursor marker, then we'll return a single range. 63/// the start of the file. If there's a second cursor marker, then we'll return a single range.
64pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) { 64pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
65 use ra_db::fixture::WithFixture; 65 use base_db::fixture::WithFixture;
66 use ra_ide_db::symbol_index::SymbolsDatabase; 66 use ra_ide_db::symbol_index::SymbolsDatabase;
67 let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) { 67 let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) {
68 ra_ide_db::RootDatabase::with_range_or_offset(code) 68 ra_ide_db::RootDatabase::with_range_or_offset(code)
@@ -83,7 +83,7 @@ pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition,
83 } 83 }
84 } 84 }
85 let mut local_roots = FxHashSet::default(); 85 let mut local_roots = FxHashSet::default();
86 local_roots.insert(ra_db::fixture::WORKSPACE); 86 local_roots.insert(base_db::fixture::WORKSPACE);
87 db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH); 87 db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH);
88 (db, position, selections) 88 (db, position, selections)
89} 89}
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index c6102bf27..0dee719de 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -46,11 +46,11 @@ cfg = { path = "../cfg" }
46toolchain = { path = "../toolchain" } 46toolchain = { path = "../toolchain" }
47 47
48# This should only be used in CLI 48# This should only be used in CLI
49ra_db = { path = "../ra_db" } 49base_db = { path = "../base_db" }
50ra_ide_db = { path = "../ra_ide_db" } 50ra_ide_db = { path = "../ra_ide_db" }
51ra_ssr = { path = "../ra_ssr" } 51ra_ssr = { path = "../ra_ssr" }
52hir = { path = "../ra_hir", package = "ra_hir" } 52hir = { path = "../ra_hir", package = "ra_hir" }
53hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } 53hir_def = { path = "../hir_def" }
54hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } 54hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" }
55proc_macro_srv = { path = "../proc_macro_srv" } 55proc_macro_srv = { path = "../proc_macro_srv" }
56 56
diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs
index bc5f77e1a..b20a1675e 100644
--- a/crates/rust-analyzer/src/cli/analysis_bench.rs
+++ b/crates/rust-analyzer/src/cli/analysis_bench.rs
@@ -3,7 +3,7 @@
3use std::{env, path::PathBuf, str::FromStr, sync::Arc, time::Instant}; 3use std::{env, path::PathBuf, str::FromStr, sync::Arc, time::Instant};
4 4
5use anyhow::{bail, format_err, Result}; 5use anyhow::{bail, format_err, Result};
6use ra_db::{ 6use base_db::{
7 salsa::{Database, Durability}, 7 salsa::{Database, Durability},
8 FileId, 8 FileId,
9}; 9};
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs
index cfc1b2244..fb2b2b000 100644
--- a/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -6,6 +6,10 @@ use std::{
6 time::{SystemTime, UNIX_EPOCH}, 6 time::{SystemTime, UNIX_EPOCH},
7}; 7};
8 8
9use base_db::{
10 salsa::{self, ParallelDatabase},
11 SourceDatabaseExt,
12};
9use hir::{ 13use hir::{
10 db::{AstDatabase, DefDatabase, HirDatabase}, 14 db::{AstDatabase, DefDatabase, HirDatabase},
11 original_range, AssocItem, Crate, HasSource, HirDisplay, ModuleDef, 15 original_range, AssocItem, Crate, HasSource, HirDisplay, ModuleDef,
@@ -14,10 +18,6 @@ use hir_def::FunctionId;
14use hir_ty::{Ty, TypeWalk}; 18use hir_ty::{Ty, TypeWalk};
15use itertools::Itertools; 19use itertools::Itertools;
16use oorandom::Rand32; 20use oorandom::Rand32;
17use ra_db::{
18 salsa::{self, ParallelDatabase},
19 SourceDatabaseExt,
20};
21use rayon::prelude::*; 21use rayon::prelude::*;
22use rustc_hash::FxHashSet; 22use rustc_hash::FxHashSet;
23use stdx::format_to; 23use stdx::format_to;
diff --git a/crates/rust-analyzer/src/cli/diagnostics.rs b/crates/rust-analyzer/src/cli/diagnostics.rs
index f17fc5dfe..56403cabe 100644
--- a/crates/rust-analyzer/src/cli/diagnostics.rs
+++ b/crates/rust-analyzer/src/cli/diagnostics.rs
@@ -6,8 +6,8 @@ use std::path::Path;
6use anyhow::anyhow; 6use anyhow::anyhow;
7use rustc_hash::FxHashSet; 7use rustc_hash::FxHashSet;
8 8
9use base_db::SourceDatabaseExt;
9use hir::Crate; 10use hir::Crate;
10use ra_db::SourceDatabaseExt;
11use ra_ide::Severity; 11use ra_ide::Severity;
12 12
13use crate::cli::{load_cargo::load_cargo, Result}; 13use crate::cli::{load_cargo::load_cargo, Result};
diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs
index f6cb144c6..542734803 100644
--- a/crates/rust-analyzer/src/cli/load_cargo.rs
+++ b/crates/rust-analyzer/src/cli/load_cargo.rs
@@ -3,9 +3,9 @@
3use std::{path::Path, sync::Arc}; 3use std::{path::Path, sync::Arc};
4 4
5use anyhow::Result; 5use anyhow::Result;
6use base_db::CrateGraph;
6use crossbeam_channel::{unbounded, Receiver}; 7use crossbeam_channel::{unbounded, Receiver};
7use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; 8use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace};
8use ra_db::CrateGraph;
9use ra_ide::{AnalysisChange, AnalysisHost}; 9use ra_ide::{AnalysisChange, AnalysisHost};
10use vfs::{loader::Handle, AbsPath, AbsPathBuf}; 10use vfs::{loader::Handle, AbsPath, AbsPathBuf};
11 11
diff --git a/crates/rust-analyzer/src/cli/ssr.rs b/crates/rust-analyzer/src/cli/ssr.rs
index 194bec008..08788fb41 100644
--- a/crates/rust-analyzer/src/cli/ssr.rs
+++ b/crates/rust-analyzer/src/cli/ssr.rs
@@ -4,7 +4,7 @@ use crate::cli::{load_cargo::load_cargo, Result};
4use ra_ssr::{MatchFinder, SsrPattern, SsrRule}; 4use ra_ssr::{MatchFinder, SsrPattern, SsrRule};
5 5
6pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> { 6pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> {
7 use ra_db::SourceDatabaseExt; 7 use base_db::SourceDatabaseExt;
8 let (host, vfs) = load_cargo(&std::env::current_dir()?, true, true)?; 8 let (host, vfs) = load_cargo(&std::env::current_dir()?, true, true)?;
9 let db = host.raw_database(); 9 let db = host.raw_database();
10 let mut match_finder = MatchFinder::at_first_file(db)?; 10 let mut match_finder = MatchFinder::at_first_file(db)?;
@@ -26,7 +26,7 @@ pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> {
26/// `debug_snippet`. This is intended for debugging and probably isn't in it's current form useful 26/// `debug_snippet`. This is intended for debugging and probably isn't in it's current form useful
27/// for much else. 27/// for much else.
28pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> { 28pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> {
29 use ra_db::SourceDatabaseExt; 29 use base_db::SourceDatabaseExt;
30 use ra_ide_db::symbol_index::SymbolsDatabase; 30 use ra_ide_db::symbol_index::SymbolsDatabase;
31 let (host, _vfs) = load_cargo(&std::env::current_dir()?, true, true)?; 31 let (host, _vfs) = load_cargo(&std::env::current_dir()?, true, true)?;
32 let db = host.raw_database(); 32 let db = host.raw_database();
diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs
index 97f331352..6d5408156 100644
--- a/crates/rust-analyzer/src/diagnostics/to_proto.rs
+++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs
@@ -1116,7 +1116,7 @@ mod tests {
1116 fn macro_compiler_error() { 1116 fn macro_compiler_error() {
1117 check( 1117 check(
1118 r##"{ 1118 r##"{
1119 "rendered": "error: Please register your known path in the path module\n --> crates/ra_hir_def/src/path.rs:265:9\n |\n265 | compile_error!(\"Please register your known path in the path module\")\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n | \n ::: crates/ra_hir_def/src/data.rs:80:16\n |\n80 | let path = path![std::future::Future];\n | -------------------------- in this macro invocation\n\n", 1119 "rendered": "error: Please register your known path in the path module\n --> crates/hir_def/src/path.rs:265:9\n |\n265 | compile_error!(\"Please register your known path in the path module\")\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n | \n ::: crates/hir_def/src/data.rs:80:16\n |\n80 | let path = path![std::future::Future];\n | -------------------------- in this macro invocation\n\n",
1120 "children": [], 1120 "children": [],
1121 "code": null, 1121 "code": null,
1122 "level": "error", 1122 "level": "error",
@@ -1134,7 +1134,7 @@ mod tests {
1134 "column_end": 2, 1134 "column_end": 2,
1135 "column_start": 1, 1135 "column_start": 1,
1136 "expansion": null, 1136 "expansion": null,
1137 "file_name": "crates/ra_hir_def/src/path.rs", 1137 "file_name": "crates/hir_def/src/path.rs",
1138 "is_primary": false, 1138 "is_primary": false,
1139 "label": null, 1139 "label": null,
1140 "line_end": 267, 1140 "line_end": 267,
@@ -1227,7 +1227,7 @@ mod tests {
1227 "column_end": 2, 1227 "column_end": 2,
1228 "column_start": 1, 1228 "column_start": 1,
1229 "expansion": null, 1229 "expansion": null,
1230 "file_name": "crates/ra_hir_def/src/path.rs", 1230 "file_name": "crates/hir_def/src/path.rs",
1231 "is_primary": false, 1231 "is_primary": false,
1232 "label": null, 1232 "label": null,
1233 "line_end": 277, 1233 "line_end": 277,
@@ -1284,7 +1284,7 @@ mod tests {
1284 "column_end": 42, 1284 "column_end": 42,
1285 "column_start": 16, 1285 "column_start": 16,
1286 "expansion": null, 1286 "expansion": null,
1287 "file_name": "crates/ra_hir_def/src/data.rs", 1287 "file_name": "crates/hir_def/src/data.rs",
1288 "is_primary": false, 1288 "is_primary": false,
1289 "label": null, 1289 "label": null,
1290 "line_end": 80, 1290 "line_end": 80,
@@ -1300,7 +1300,7 @@ mod tests {
1300 ] 1300 ]
1301 } 1301 }
1302 }, 1302 },
1303 "file_name": "crates/ra_hir_def/src/path.rs", 1303 "file_name": "crates/hir_def/src/path.rs",
1304 "is_primary": false, 1304 "is_primary": false,
1305 "label": null, 1305 "label": null,
1306 "line_end": 272, 1306 "line_end": 272,
@@ -1316,7 +1316,7 @@ mod tests {
1316 ] 1316 ]
1317 } 1317 }
1318 }, 1318 },
1319 "file_name": "crates/ra_hir_def/src/path.rs", 1319 "file_name": "crates/hir_def/src/path.rs",
1320 "is_primary": true, 1320 "is_primary": true,
1321 "label": null, 1321 "label": null,
1322 "line_end": 265, 1322 "line_end": 265,
diff --git a/crates/rust-analyzer/src/from_proto.rs b/crates/rust-analyzer/src/from_proto.rs
index ad88ffdd7..945a353dd 100644
--- a/crates/rust-analyzer/src/from_proto.rs
+++ b/crates/rust-analyzer/src/from_proto.rs
@@ -1,7 +1,7 @@
1//! Conversion lsp_types types to rust-analyzer specific ones. 1//! Conversion lsp_types types to rust-analyzer specific ones.
2use std::convert::TryFrom; 2use std::convert::TryFrom;
3 3
4use ra_db::{FileId, FilePosition, FileRange}; 4use base_db::{FileId, FilePosition, FileRange};
5use ra_ide::{AssistKind, LineCol, LineIndex}; 5use ra_ide::{AssistKind, LineCol, LineIndex};
6use syntax::{TextRange, TextSize}; 6use syntax::{TextRange, TextSize};
7use vfs::AbsPathBuf; 7use vfs::AbsPathBuf;
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs
index 2e8b708d0..f04a0a59f 100644
--- a/crates/rust-analyzer/src/global_state.rs
+++ b/crates/rust-analyzer/src/global_state.rs
@@ -5,12 +5,12 @@
5 5
6use std::{sync::Arc, time::Instant}; 6use std::{sync::Arc, time::Instant};
7 7
8use base_db::{CrateId, VfsPath};
8use crossbeam_channel::{unbounded, Receiver, Sender}; 9use crossbeam_channel::{unbounded, Receiver, Sender};
9use flycheck::FlycheckHandle; 10use flycheck::FlycheckHandle;
10use lsp_types::{SemanticTokens, Url}; 11use lsp_types::{SemanticTokens, Url};
11use parking_lot::{Mutex, RwLock}; 12use parking_lot::{Mutex, RwLock};
12use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; 13use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target};
13use ra_db::{CrateId, VfsPath};
14use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; 14use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId};
15use rustc_hash::FxHashMap; 15use rustc_hash::FxHashMap;
16 16
diff --git a/crates/rust-analyzer/src/lsp_utils.rs b/crates/rust-analyzer/src/lsp_utils.rs
index 0bc3ff115..17d1550cd 100644
--- a/crates/rust-analyzer/src/lsp_utils.rs
+++ b/crates/rust-analyzer/src/lsp_utils.rs
@@ -1,8 +1,8 @@
1//! Utilities for LSP-related boilerplate code. 1//! Utilities for LSP-related boilerplate code.
2use std::{error::Error, ops::Range}; 2use std::{error::Error, ops::Range};
3 3
4use base_db::Canceled;
4use lsp_server::Notification; 5use lsp_server::Notification;
5use ra_db::Canceled;
6use ra_ide::LineIndex; 6use ra_ide::LineIndex;
7 7
8use crate::{from_proto, global_state::GlobalState}; 8use crate::{from_proto, global_state::GlobalState};
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 9a779cb14..5726820f9 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -5,10 +5,10 @@ use std::{
5 time::{Duration, Instant}, 5 time::{Duration, Instant},
6}; 6};
7 7
8use base_db::VfsPath;
8use crossbeam_channel::{select, Receiver}; 9use crossbeam_channel::{select, Receiver};
9use lsp_server::{Connection, Notification, Request, Response}; 10use lsp_server::{Connection, Notification, Request, Response};
10use lsp_types::notification::Notification as _; 11use lsp_types::notification::Notification as _;
11use ra_db::VfsPath;
12use ra_ide::{Canceled, FileId}; 12use ra_ide::{Canceled, FileId};
13 13
14use crate::{ 14use crate::{
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs
index 640417dc6..fd133e312 100644
--- a/crates/rust-analyzer/src/reload.rs
+++ b/crates/rust-analyzer/src/reload.rs
@@ -1,9 +1,9 @@
1//! Project loading & configuration updates 1//! Project loading & configuration updates
2use std::{mem, sync::Arc}; 2use std::{mem, sync::Arc};
3 3
4use base_db::{CrateGraph, SourceRoot, VfsPath};
4use flycheck::FlycheckHandle; 5use flycheck::FlycheckHandle;
5use project_model::{ProcMacroClient, ProjectWorkspace}; 6use project_model::{ProcMacroClient, ProjectWorkspace};
6use ra_db::{CrateGraph, SourceRoot, VfsPath};
7use ra_ide::AnalysisChange; 7use ra_ide::AnalysisChange;
8use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind}; 8use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind};
9 9
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 278819a5c..93a4b1f27 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -4,8 +4,8 @@ use std::{
4 sync::atomic::{AtomicU32, Ordering}, 4 sync::atomic::{AtomicU32, Ordering},
5}; 5};
6 6
7use base_db::{FileId, FileRange};
7use itertools::Itertools; 8use itertools::Itertools;
8use ra_db::{FileId, FileRange};
9use ra_ide::{ 9use ra_ide::{
10 Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, Documentation, 10 Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, Documentation,
11 FileSystemEdit, Fold, FoldKind, Highlight, HighlightModifier, HighlightTag, HighlightedRange, 11 FileSystemEdit, Fold, FoldKind, Highlight, HighlightModifier, HighlightTag, HighlightedRange,
diff --git a/crates/rust-analyzer/test_data/macro_compiler_error.txt b/crates/rust-analyzer/test_data/macro_compiler_error.txt
index f695db73c..89dae7d5a 100644
--- a/crates/rust-analyzer/test_data/macro_compiler_error.txt
+++ b/crates/rust-analyzer/test_data/macro_compiler_error.txt
@@ -1,6 +1,6 @@
1[ 1[
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: "file:///test/crates/ra_hir_def/src/data.rs", 3 url: "file:///test/crates/hir_def/src/data.rs",
4 diagnostic: Diagnostic { 4 diagnostic: Diagnostic {
5 range: Range { 5 range: Range {
6 start: Position { 6 start: Position {
@@ -24,7 +24,7 @@
24 [ 24 [
25 DiagnosticRelatedInformation { 25 DiagnosticRelatedInformation {
26 location: Location { 26 location: Location {
27 uri: "file:///test/crates/ra_hir_def/src/path.rs", 27 uri: "file:///test/crates/hir_def/src/path.rs",
28 range: Range { 28 range: Range {
29 start: Position { 29 start: Position {
30 line: 264, 30 line: 264,