aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock50
-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/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.toml2
-rw-r--r--crates/ra_hir/src/code_model.rs2
-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_def/Cargo.toml2
-rw-r--r--crates/ra_hir_def/src/body.rs4
-rw-r--r--crates/ra_hir_def/src/body/scope.rs2
-rw-r--r--crates/ra_hir_def/src/db.rs2
-rw-r--r--crates/ra_hir_def/src/find_path.rs2
-rw-r--r--crates/ra_hir_def/src/generics.rs2
-rw-r--r--crates/ra_hir_def/src/import_map.rs4
-rw-r--r--crates/ra_hir_def/src/item_scope.rs2
-rw-r--r--crates/ra_hir_def/src/item_tree/tests.rs2
-rw-r--r--crates/ra_hir_def/src/lib.rs2
-rw-r--r--crates/ra_hir_def/src/nameres.rs2
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs4
-rw-r--r--crates/ra_hir_def/src/nameres/mod_resolution.rs2
-rw-r--r--crates/ra_hir_def/src/nameres/path_resolution.rs2
-rw-r--r--crates/ra_hir_def/src/nameres/tests.rs2
-rw-r--r--crates/ra_hir_def/src/nameres/tests/incremental.rs2
-rw-r--r--crates/ra_hir_def/src/path.rs2
-rw-r--r--crates/ra_hir_def/src/resolver.rs2
-rw-r--r--crates/ra_hir_def/src/test_db.rs6
-rw-r--r--crates/ra_hir_expand/Cargo.toml2
-rw-r--r--crates/ra_hir_expand/src/builtin_derive.rs2
-rw-r--r--crates/ra_hir_expand/src/builtin_macro.rs4
-rw-r--r--crates/ra_hir_expand/src/db.rs2
-rw-r--r--crates/ra_hir_expand/src/eager.rs2
-rw-r--r--crates/ra_hir_expand/src/hygiene.rs2
-rw-r--r--crates/ra_hir_expand/src/lib.rs2
-rw-r--r--crates/ra_hir_expand/src/name.rs2
-rw-r--r--crates/ra_hir_expand/src/proc_macro.rs2
-rw-r--r--crates/ra_hir_expand/src/test_db.rs6
-rw-r--r--crates/ra_hir_ty/Cargo.toml2
-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/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.toml2
-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/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--docs/dev/architecture.md6
-rw-r--r--docs/dev/guide.md4
111 files changed, 183 insertions, 183 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9878dd88f..a99dd6e04 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -84,6 +84,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
84checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 84checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
85 85
86[[package]] 86[[package]]
87name = "base_db"
88version = "0.0.0"
89dependencies = [
90 "cfg",
91 "profile",
92 "rustc-hash",
93 "salsa",
94 "stdx",
95 "syntax",
96 "test_utils",
97 "tt",
98 "vfs",
99]
100
101[[package]]
87name = "bitflags" 102name = "bitflags"
88version = "1.2.1" 103version = "1.2.1"
89source = "registry+https://github.com/rust-lang/crates.io-index" 104source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -956,12 +971,12 @@ version = "0.0.0"
956dependencies = [ 971dependencies = [
957 "anyhow", 972 "anyhow",
958 "arena", 973 "arena",
974 "base_db",
959 "cargo_metadata", 975 "cargo_metadata",
960 "cfg", 976 "cfg",
961 "log", 977 "log",
962 "paths", 978 "paths",
963 "proc_macro_api", 979 "proc_macro_api",
964 "ra_db",
965 "rustc-hash", 980 "rustc-hash",
966 "serde", 981 "serde",
967 "serde_json", 982 "serde_json",
@@ -982,10 +997,10 @@ dependencies = [
982name = "ra_assists" 997name = "ra_assists"
983version = "0.1.0" 998version = "0.1.0"
984dependencies = [ 999dependencies = [
1000 "base_db",
985 "either", 1001 "either",
986 "itertools", 1002 "itertools",
987 "profile", 1003 "profile",
988 "ra_db",
989 "ra_hir", 1004 "ra_hir",
990 "ra_ide_db", 1005 "ra_ide_db",
991 "rustc-hash", 1006 "rustc-hash",
@@ -996,30 +1011,15 @@ dependencies = [
996] 1011]
997 1012
998[[package]] 1013[[package]]
999name = "ra_db"
1000version = "0.1.0"
1001dependencies = [
1002 "cfg",
1003 "profile",
1004 "rustc-hash",
1005 "salsa",
1006 "stdx",
1007 "syntax",
1008 "test_utils",
1009 "tt",
1010 "vfs",
1011]
1012
1013[[package]]
1014name = "ra_hir" 1014name = "ra_hir"
1015version = "0.1.0" 1015version = "0.1.0"
1016dependencies = [ 1016dependencies = [
1017 "arrayvec", 1017 "arrayvec",
1018 "base_db",
1018 "either", 1019 "either",
1019 "itertools", 1020 "itertools",
1020 "log", 1021 "log",
1021 "profile", 1022 "profile",
1022 "ra_db",
1023 "ra_hir_def", 1023 "ra_hir_def",
1024 "ra_hir_expand", 1024 "ra_hir_expand",
1025 "ra_hir_ty", 1025 "ra_hir_ty",
@@ -1034,6 +1034,7 @@ version = "0.1.0"
1034dependencies = [ 1034dependencies = [
1035 "anymap", 1035 "anymap",
1036 "arena", 1036 "arena",
1037 "base_db",
1037 "cfg", 1038 "cfg",
1038 "drop_bomb", 1039 "drop_bomb",
1039 "either", 1040 "either",
@@ -1045,7 +1046,6 @@ dependencies = [
1045 "mbe", 1046 "mbe",
1046 "once_cell", 1047 "once_cell",
1047 "profile", 1048 "profile",
1048 "ra_db",
1049 "ra_hir_expand", 1049 "ra_hir_expand",
1050 "rustc-hash", 1050 "rustc-hash",
1051 "smallvec", 1051 "smallvec",
@@ -1060,12 +1060,12 @@ name = "ra_hir_expand"
1060version = "0.1.0" 1060version = "0.1.0"
1061dependencies = [ 1061dependencies = [
1062 "arena", 1062 "arena",
1063 "base_db",
1063 "either", 1064 "either",
1064 "log", 1065 "log",
1065 "mbe", 1066 "mbe",
1066 "parser", 1067 "parser",
1067 "profile", 1068 "profile",
1068 "ra_db",
1069 "rustc-hash", 1069 "rustc-hash",
1070 "syntax", 1070 "syntax",
1071 "test_utils", 1071 "test_utils",
@@ -1078,6 +1078,7 @@ version = "0.1.0"
1078dependencies = [ 1078dependencies = [
1079 "arena", 1079 "arena",
1080 "arrayvec", 1080 "arrayvec",
1081 "base_db",
1081 "chalk-ir", 1082 "chalk-ir",
1082 "chalk-recursive", 1083 "chalk-recursive",
1083 "chalk-solve", 1084 "chalk-solve",
@@ -1086,7 +1087,6 @@ dependencies = [
1086 "itertools", 1087 "itertools",
1087 "log", 1088 "log",
1088 "profile", 1089 "profile",
1089 "ra_db",
1090 "ra_hir_def", 1090 "ra_hir_def",
1091 "ra_hir_expand", 1091 "ra_hir_expand",
1092 "rustc-hash", 1092 "rustc-hash",
@@ -1104,6 +1104,7 @@ dependencies = [
1104name = "ra_ide" 1104name = "ra_ide"
1105version = "0.1.0" 1105version = "0.1.0"
1106dependencies = [ 1106dependencies = [
1107 "base_db",
1107 "cfg", 1108 "cfg",
1108 "either", 1109 "either",
1109 "expect", 1110 "expect",
@@ -1113,7 +1114,6 @@ dependencies = [
1113 "oorandom", 1114 "oorandom",
1114 "profile", 1115 "profile",
1115 "ra_assists", 1116 "ra_assists",
1116 "ra_db",
1117 "ra_hir", 1117 "ra_hir",
1118 "ra_ide_db", 1118 "ra_ide_db",
1119 "ra_ssr", 1119 "ra_ssr",
@@ -1128,12 +1128,12 @@ dependencies = [
1128name = "ra_ide_db" 1128name = "ra_ide_db"
1129version = "0.1.0" 1129version = "0.1.0"
1130dependencies = [ 1130dependencies = [
1131 "base_db",
1131 "either", 1132 "either",
1132 "fst", 1133 "fst",
1133 "log", 1134 "log",
1134 "once_cell", 1135 "once_cell",
1135 "profile", 1136 "profile",
1136 "ra_db",
1137 "ra_hir", 1137 "ra_hir",
1138 "rayon", 1138 "rayon",
1139 "rustc-hash", 1139 "rustc-hash",
@@ -1147,8 +1147,8 @@ dependencies = [
1147name = "ra_ssr" 1147name = "ra_ssr"
1148version = "0.1.0" 1148version = "0.1.0"
1149dependencies = [ 1149dependencies = [
1150 "base_db",
1150 "expect", 1151 "expect",
1151 "ra_db",
1152 "ra_hir", 1152 "ra_hir",
1153 "ra_ide_db", 1153 "ra_ide_db",
1154 "rustc-hash", 1154 "rustc-hash",
@@ -1230,6 +1230,7 @@ name = "rust-analyzer"
1230version = "0.1.0" 1230version = "0.1.0"
1231dependencies = [ 1231dependencies = [
1232 "anyhow", 1232 "anyhow",
1233 "base_db",
1233 "cfg", 1234 "cfg",
1234 "crossbeam-channel", 1235 "crossbeam-channel",
1235 "env_logger", 1236 "env_logger",
@@ -1248,7 +1249,6 @@ dependencies = [
1248 "proc_macro_srv", 1249 "proc_macro_srv",
1249 "profile", 1250 "profile",
1250 "project_model", 1251 "project_model",
1251 "ra_db",
1252 "ra_hir", 1252 "ra_hir",
1253 "ra_hir_def", 1253 "ra_hir_def",
1254 "ra_hir_ty", 1254 "ra_hir_ty",
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/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..5ccdb74fd 100644
--- a/crates/ra_hir/Cargo.toml
+++ b/crates/ra_hir/Cargo.toml
@@ -18,7 +18,7 @@ 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 = "../ra_hir_expand", package = "ra_hir_expand" }
24hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } 24hir_def = { path = "../ra_hir_def", package = "ra_hir_def" }
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 98724c146..d4d6b1759 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::{
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_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml
index e7d3c4d5b..2b187bc4a 100644
--- a/crates/ra_hir_def/Cargo.toml
+++ b/crates/ra_hir_def/Cargo.toml
@@ -23,7 +23,7 @@ smallvec = "1.4.0"
23stdx = { path = "../stdx" } 23stdx = { path = "../stdx" }
24 24
25arena = { path = "../arena" } 25arena = { path = "../arena" }
26ra_db = { path = "../ra_db" } 26base_db = { path = "../base_db" }
27syntax = { path = "../syntax" } 27syntax = { path = "../syntax" }
28profile = { path = "../profile" } 28profile = { path = "../profile" }
29hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } 29hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs
index fe659386a..9a9a605dd 100644
--- a/crates/ra_hir_def/src/body.rs
+++ b/crates/ra_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/scope.rs b/crates/ra_hir_def/src/body/scope.rs
index 079f14c29..9142bc05b 100644
--- a/crates/ra_hir_def/src/body/scope.rs
+++ b/crates/ra_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/db.rs b/crates/ra_hir_def/src/db.rs
index a925548b5..6d694de11 100644
--- a/crates/ra_hir_def/src/db.rs
+++ b/crates/ra_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/find_path.rs b/crates/ra_hir_def/src/find_path.rs
index 5099f417d..ac2c54ac5 100644
--- a/crates/ra_hir_def/src/find_path.rs
+++ b/crates/ra_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/ra_hir_def/src/generics.rs
index 4476f0316..835fe3fbd 100644
--- a/crates/ra_hir_def/src/generics.rs
+++ b/crates/ra_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/ra_hir_def/src/import_map.rs
index 431ff30ab..d32a0bdaf 100644
--- a/crates/ra_hir_def/src/import_map.rs
+++ b/crates/ra_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/ra_hir_def/src/item_scope.rs
index 8fee4b15e..f1e9dfd5b 100644
--- a/crates/ra_hir_def/src/item_scope.rs
+++ b/crates/ra_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/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs
index 6c843e339..2f62eddcb 100644
--- a/crates/ra_hir_def/src/item_tree/tests.rs
+++ b/crates/ra_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;
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs
index 806ac731f..f24a1dd77 100644
--- a/crates/ra_hir_def/src/lib.rs
+++ b/crates/ra_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/ra_hir_def/src/nameres.rs
index d26c837cc..bf302172d 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/ra_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/ra_hir_def/src/nameres/collector.rs
index 6a5891936..3e99c8773 100644
--- a/crates/ra_hir_def/src/nameres/collector.rs
+++ b/crates/ra_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/ra_hir_def/src/nameres/mod_resolution.rs
index 316245d6b..e8389b484 100644
--- a/crates/ra_hir_def/src/nameres/mod_resolution.rs
+++ b/crates/ra_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/ra_hir_def/src/nameres/path_resolution.rs
index dbfa7fccb..88e10574e 100644
--- a/crates/ra_hir_def/src/nameres/path_resolution.rs
+++ b/crates/ra_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/ra_hir_def/src/nameres/tests.rs
index 839b1de57..b105d56b2 100644
--- a/crates/ra_hir_def/src/nameres/tests.rs
+++ b/crates/ra_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/incremental.rs b/crates/ra_hir_def/src/nameres/tests/incremental.rs
index 0c288a108..cfbc62cc4 100644
--- a/crates/ra_hir_def/src/nameres/tests/incremental.rs
+++ b/crates/ra_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/path.rs b/crates/ra_hir_def/src/path.rs
index 88be07c8a..74d26f08b 100644
--- a/crates/ra_hir_def/src/path.rs
+++ b/crates/ra_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/resolver.rs b/crates/ra_hir_def/src/resolver.rs
index 0bf51eb7b..f8cc5e075 100644
--- a/crates/ra_hir_def/src/resolver.rs
+++ b/crates/ra_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/test_db.rs b/crates/ra_hir_def/src/test_db.rs
index 339f819b8..42a762936 100644
--- a/crates/ra_hir_def/src/test_db.rs
+++ b/crates/ra_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_expand/Cargo.toml b/crates/ra_hir_expand/Cargo.toml
index cbb0ac29b..41acf3712 100644
--- a/crates/ra_hir_expand/Cargo.toml
+++ b/crates/ra_hir_expand/Cargo.toml
@@ -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/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs
index 2d2f8bcb8..988a60d56 100644
--- a/crates/ra_hir_expand/src/builtin_derive.rs
+++ b/crates/ra_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/ra_hir_expand/src/builtin_macro.rs
index ae4c84382..86918b626 100644
--- a/crates/ra_hir_expand/src/builtin_macro.rs
+++ b/crates/ra_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/ra_hir_expand/src/db.rs
index c275f6b01..dcc038bcd 100644
--- a/crates/ra_hir_expand/src/db.rs
+++ b/crates/ra_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/eager.rs b/crates/ra_hir_expand/src/eager.rs
index bd3409f97..10c45646f 100644
--- a/crates/ra_hir_expand/src/eager.rs
+++ b/crates/ra_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/ra_hir_expand/src/hygiene.rs
index 23b5eac27..845e9cbc1 100644
--- a/crates/ra_hir_expand/src/hygiene.rs
+++ b/crates/ra_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/ra_hir_expand/src/lib.rs
index af0cc445f..7425b561a 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -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/ra_hir_expand/src/name.rs
index 4dcaff088..49841c7a1 100644
--- a/crates/ra_hir_expand/src/name.rs
+++ b/crates/ra_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/ra_hir_expand/src/proc_macro.rs
index 2c0ec41d2..80255ea32 100644
--- a/crates/ra_hir_expand/src/proc_macro.rs
+++ b/crates/ra_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/test_db.rs b/crates/ra_hir_expand/src/test_db.rs
index 332fa556f..86a5d867e 100644
--- a/crates/ra_hir_expand/src/test_db.rs
+++ b/crates/ra_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/ra_hir_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml
index 6156e4a85..720d171ac 100644
--- a/crates/ra_hir_ty/Cargo.toml
+++ b/crates/ra_hir_ty/Cargo.toml
@@ -21,7 +21,7 @@ stdx = { path = "../stdx" }
21hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } 21hir_def = { path = "../ra_hir_def", package = "ra_hir_def" }
22hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } 22hir_expand = { path = "../ra_hir_expand", package = "ra_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/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..210d9e9c8 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -46,7 +46,7 @@ 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" }
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/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/docs/dev/architecture.md b/docs/dev/architecture.md
index 21373729c..746d41f83 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -92,14 +92,14 @@ in particular: it shows off various methods of working with syntax tree.
92See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which 92See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which
93fixes a bug in the grammar. 93fixes a bug in the grammar.
94 94
95### `crates/ra_db` 95### `crates/base_db`
96 96
97We use the [salsa](https://github.com/salsa-rs/salsa) crate for incremental and 97We use the [salsa](https://github.com/salsa-rs/salsa) crate for incremental and
98on-demand computation. Roughly, you can think of salsa as a key-value store, but 98on-demand computation. Roughly, you can think of salsa as a key-value store, but
99it also can compute derived values using specified functions. The `ra_db` crate 99it also can compute derived values using specified functions. The `base_db` crate
100provides basic infrastructure for interacting with salsa. Crucially, it 100provides basic infrastructure for interacting with salsa. Crucially, it
101defines most of the "input" queries: facts supplied by the client of the 101defines most of the "input" queries: facts supplied by the client of the
102analyzer. Reading the docs of the `ra_db::input` module should be useful: 102analyzer. Reading the docs of the `base_db::input` module should be useful:
103everything else is strictly derived from those inputs. 103everything else is strictly derived from those inputs.
104 104
105### `crates/ra_hir*` crates 105### `crates/ra_hir*` crates
diff --git a/docs/dev/guide.md b/docs/dev/guide.md
index c3252f1f6..d14143226 100644
--- a/docs/dev/guide.md
+++ b/docs/dev/guide.md
@@ -259,7 +259,7 @@ Salsa input queries are defined in [`FilesDatabase`] (which is a part of
259`RootDatabase`). They closely mirror the familiar `AnalysisChange` structure: 259`RootDatabase`). They closely mirror the familiar `AnalysisChange` structure:
260indeed, what `apply_change` does is it sets the values of input queries. 260indeed, what `apply_change` does is it sets the values of input queries.
261 261
262[`FilesDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_db/src/input.rs#L150-L174 262[`FilesDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/base_db/src/input.rs#L150-L174
263 263
264## From text to semantic model 264## From text to semantic model
265 265
@@ -392,7 +392,7 @@ integers which can "intern" a location and return an integer ID back. The salsa
392database we use includes a couple of [interners]. How to "garbage collect" 392database we use includes a couple of [interners]. How to "garbage collect"
393unused locations is an open question. 393unused locations is an open question.
394 394
395[`LocationInterner`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_db/src/loc2id.rs#L65-L71 395[`LocationInterner`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/base_db/src/loc2id.rs#L65-L71
396[interners]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/db.rs#L22-L23 396[interners]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/db.rs#L22-L23
397 397
398For example, we use `LocationInterner` to assign IDs to definitions of functions, 398For example, we use `LocationInterner` to assign IDs to definitions of functions,