diff options
Diffstat (limited to 'crates')
108 files changed, 153 insertions, 153 deletions
diff --git a/crates/ra_db/Cargo.toml b/crates/base_db/Cargo.toml index ad432f096..7347d7528 100644 --- a/crates/ra_db/Cargo.toml +++ b/crates/base_db/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | name = "base_db" |
3 | name = "ra_db" | 3 | version = "0.0.0" |
4 | version = "0.1.0" | ||
5 | authors = ["rust-analyzer developers"] | ||
6 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = 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. |
2 | mod cancellation; | 2 | mod cancellation; |
3 | mod input; | 3 | mod input; |
4 | pub mod fixture; | 4 | pub 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 | ||
19 | arena = { path = "../arena" } | 19 | arena = { path = "../arena" } |
20 | cfg = { path = "../cfg" } | 20 | cfg = { path = "../cfg" } |
21 | ra_db = { path = "../ra_db" } | 21 | base_db = { path = "../base_db" } |
22 | toolchain = { path = "../toolchain" } | 22 | toolchain = { path = "../toolchain" } |
23 | proc_macro_api = { path = "../proc_macro_api" } | 23 | proc_macro_api = { path = "../proc_macro_api" } |
24 | paths = { path = "../paths" } | 24 | paths = { 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 | ||
10 | use anyhow::{Context, Result}; | 10 | use anyhow::{Context, Result}; |
11 | use arena::{Arena, Idx}; | 11 | use arena::{Arena, Idx}; |
12 | use base_db::Edition; | ||
12 | use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; | 13 | use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; |
13 | use paths::{AbsPath, AbsPathBuf}; | 14 | use paths::{AbsPath, AbsPathBuf}; |
14 | use ra_db::Edition; | ||
15 | use rustc_hash::FxHashMap; | 15 | use rustc_hash::FxHashMap; |
16 | 16 | ||
17 | use crate::cfg_flag::CfgFlag; | 17 | use 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 | ||
14 | use anyhow::{bail, Context, Result}; | 14 | use anyhow::{bail, Context, Result}; |
15 | use base_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId}; | ||
15 | use cfg::CfgOptions; | 16 | use cfg::CfgOptions; |
16 | use paths::{AbsPath, AbsPathBuf}; | 17 | use paths::{AbsPath, AbsPathBuf}; |
17 | use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId}; | ||
18 | use rustc_hash::{FxHashMap, FxHashSet}; | 18 | use rustc_hash::{FxHashMap, FxHashSet}; |
19 | 19 | ||
20 | use crate::cfg_flag::CfgFlag; | 20 | use 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 | ||
3 | use std::path::PathBuf; | 3 | use std::path::PathBuf; |
4 | 4 | ||
5 | use base_db::{CrateId, CrateName, Dependency, Edition}; | ||
5 | use paths::{AbsPath, AbsPathBuf}; | 6 | use paths::{AbsPath, AbsPathBuf}; |
6 | use ra_db::{CrateId, CrateName, Dependency, Edition}; | ||
7 | use rustc_hash::FxHashMap; | 7 | use rustc_hash::FxHashMap; |
8 | use serde::{de, Deserialize}; | 8 | use 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" } | |||
18 | syntax = { path = "../syntax" } | 18 | syntax = { path = "../syntax" } |
19 | text_edit = { path = "../text_edit" } | 19 | text_edit = { path = "../text_edit" } |
20 | profile = { path = "../profile" } | 20 | profile = { path = "../profile" } |
21 | ra_db = { path = "../ra_db" } | 21 | base_db = { path = "../base_db" } |
22 | ra_ide_db = { path = "../ra_ide_db" } | 22 | ra_ide_db = { path = "../ra_ide_db" } |
23 | hir = { path = "../ra_hir", package = "ra_hir" } | 23 | hir = { path = "../ra_hir", package = "ra_hir" } |
24 | test_utils = { path = "../test_utils" } | 24 | test_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 @@ | |||
3 | use std::mem; | 3 | use std::mem; |
4 | 4 | ||
5 | use algo::find_covering_element; | 5 | use algo::find_covering_element; |
6 | use base_db::{FileId, FileRange}; | ||
6 | use hir::Semantics; | 7 | use hir::Semantics; |
7 | use ra_db::{FileId, FileRange}; | ||
8 | use ra_ide_db::{ | 8 | use 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 @@ | |||
1 | use base_db::FileId; | ||
1 | use hir::{EnumVariant, Module, ModuleDef, Name}; | 2 | use hir::{EnumVariant, Module, ModuleDef, Name}; |
2 | use ra_db::FileId; | ||
3 | use ra_ide_db::{defs::Definition, search::Reference, RootDatabase}; | 3 | use ra_ide_db::{defs::Definition, search::Reference, RootDatabase}; |
4 | use rustc_hash::FxHashSet; | 4 | use rustc_hash::FxHashSet; |
5 | use syntax::{ | 5 | use 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 @@ | |||
1 | use base_db::FileId; | ||
1 | use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution}; | 2 | use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution}; |
2 | use ra_db::FileId; | ||
3 | use syntax::{ast, AstNode, TextRange, TextSize}; | 3 | use syntax::{ast, AstNode, TextRange, TextSize}; |
4 | 4 | ||
5 | use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists}; | 5 | use 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 @@ | |||
1 | use base_db::FileId; | ||
1 | use hir::HirDisplay; | 2 | use hir::HirDisplay; |
2 | use ra_db::FileId; | ||
3 | use rustc_hash::{FxHashMap, FxHashSet}; | 3 | use rustc_hash::{FxHashMap, FxHashSet}; |
4 | use syntax::{ | 4 | use 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; | |||
17 | pub mod utils; | 17 | pub mod utils; |
18 | pub mod ast_transform; | 18 | pub mod ast_transform; |
19 | 19 | ||
20 | use base_db::FileRange; | ||
20 | use hir::Semantics; | 21 | use hir::Semantics; |
21 | use ra_db::FileRange; | ||
22 | use ra_ide_db::{source_change::SourceChange, RootDatabase}; | 22 | use ra_ide_db::{source_change::SourceChange, RootDatabase}; |
23 | use syntax::TextRange; | 23 | use 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 @@ | |||
1 | mod generated; | 1 | mod generated; |
2 | 2 | ||
3 | use base_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt}; | ||
3 | use hir::Semantics; | 4 | use hir::Semantics; |
4 | use ra_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt}; | ||
5 | use ra_ide_db::RootDatabase; | 5 | use ra_ide_db::RootDatabase; |
6 | use syntax::TextRange; | 6 | use syntax::TextRange; |
7 | use test_utils::{assert_eq_text, extract_offset, extract_range}; | 7 | use 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 | ||
19 | stdx = { path = "../stdx" } | 19 | stdx = { path = "../stdx" } |
20 | syntax = { path = "../syntax" } | 20 | syntax = { path = "../syntax" } |
21 | ra_db = { path = "../ra_db" } | 21 | base_db = { path = "../base_db" } |
22 | profile = { path = "../profile" } | 22 | profile = { path = "../profile" } |
23 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } | 23 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } |
24 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } | 24 | hir_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 @@ | |||
2 | use std::{iter, sync::Arc}; | 2 | use std::{iter, sync::Arc}; |
3 | 3 | ||
4 | use arrayvec::ArrayVec; | 4 | use arrayvec::ArrayVec; |
5 | use base_db::{CrateId, Edition, FileId}; | ||
5 | use either::Either; | 6 | use either::Either; |
6 | use hir_def::{ | 7 | use 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 | }; |
33 | use ra_db::{CrateId, Edition, FileId}; | ||
34 | use rustc_hash::FxHashSet; | 34 | use rustc_hash::FxHashSet; |
35 | use stdx::impl_from; | 35 | use stdx::impl_from; |
36 | use syntax::{ | 36 | use 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 | ||
31 | from_id![ | 31 | from_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 | ||
5 | use std::{cell::RefCell, fmt, iter::successors}; | 5 | use std::{cell::RefCell, fmt, iter::successors}; |
6 | 6 | ||
7 | use base_db::{FileId, FileRange}; | ||
7 | use hir_def::{ | 8 | use 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::{ | |||
11 | use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo}; | 12 | use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo}; |
12 | use hir_ty::associated_type_shorthand_candidates; | 13 | use hir_ty::associated_type_shorthand_candidates; |
13 | use itertools::Itertools; | 14 | use itertools::Itertools; |
14 | use ra_db::{FileId, FileRange}; | ||
15 | use rustc_hash::{FxHashMap, FxHashSet}; | 15 | use rustc_hash::{FxHashMap, FxHashSet}; |
16 | use syntax::{ | 16 | use 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 | ||
3 | use base_db::FileId; | ||
3 | use hir_def::{ | 4 | use 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 | }; |
11 | use hir_expand::{name::AsName, AstId, MacroDefKind}; | 12 | use hir_expand::{name::AsName, AstId, MacroDefKind}; |
12 | use ra_db::FileId; | ||
13 | use rustc_hash::FxHashMap; | 13 | use rustc_hash::FxHashMap; |
14 | use stdx::impl_from; | 14 | use stdx::impl_from; |
15 | use syntax::{ | 15 | use 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 | }; |
34 | use ra_db::CrateId; | 34 | use 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" | |||
23 | stdx = { path = "../stdx" } | 23 | stdx = { path = "../stdx" } |
24 | 24 | ||
25 | arena = { path = "../arena" } | 25 | arena = { path = "../arena" } |
26 | ra_db = { path = "../ra_db" } | 26 | base_db = { path = "../base_db" } |
27 | syntax = { path = "../syntax" } | 27 | syntax = { path = "../syntax" } |
28 | profile = { path = "../profile" } | 28 | profile = { path = "../profile" } |
29 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } | 29 | hir_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; | |||
6 | use std::{mem, ops::Index, sync::Arc}; | 6 | use std::{mem, ops::Index, sync::Arc}; |
7 | 7 | ||
8 | use arena::{map::ArenaMap, Arena}; | 8 | use arena::{map::ArenaMap, Arena}; |
9 | use base_db::CrateId; | ||
9 | use cfg::CfgOptions; | 10 | use cfg::CfgOptions; |
10 | use drop_bomb::DropBomb; | 11 | use drop_bomb::DropBomb; |
11 | use either::Either; | 12 | use either::Either; |
12 | use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; | 13 | use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; |
13 | use ra_db::CrateId; | ||
14 | use rustc_hash::FxHashMap; | 14 | use rustc_hash::FxHashMap; |
15 | use syntax::{ast, AstNode, AstPtr}; | 15 | use syntax::{ast, AstNode, AstPtr}; |
16 | use test_utils::mark; | 16 | use test_utils::mark; |
@@ -320,7 +320,7 @@ impl BodySourceMap { | |||
320 | 320 | ||
321 | #[cfg(test)] | 321 | #[cfg(test)] |
322 | mod tests { | 322 | mod 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)] |
171 | mod tests { | 171 | mod 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. |
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use base_db::{salsa, CrateId, SourceDatabase, Upcast}; | ||
4 | use hir_expand::{db::AstDatabase, HirFileId}; | 5 | use hir_expand::{db::AstDatabase, HirFileId}; |
5 | use ra_db::{salsa, CrateId, SourceDatabase, Upcast}; | ||
6 | use syntax::SmolStr; | 6 | use syntax::SmolStr; |
7 | 7 | ||
8 | use crate::{ | 8 | use 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)] |
294 | mod tests { | 294 | mod 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 @@ | |||
5 | use std::sync::Arc; | 5 | use std::sync::Arc; |
6 | 6 | ||
7 | use arena::{map::ArenaMap, Arena}; | 7 | use arena::{map::ArenaMap, Arena}; |
8 | use base_db::FileId; | ||
8 | use either::Either; | 9 | use either::Either; |
9 | use hir_expand::{ | 10 | use hir_expand::{ |
10 | name::{name, AsName, Name}, | 11 | name::{name, AsName, Name}, |
11 | InFile, | 12 | InFile, |
12 | }; | 13 | }; |
13 | use ra_db::FileId; | ||
14 | use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; | 14 | use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; |
15 | 15 | ||
16 | use crate::{ | 16 | use 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 | ||
3 | use std::{cmp::Ordering, fmt, hash::BuildHasherDefault, sync::Arc}; | 3 | use std::{cmp::Ordering, fmt, hash::BuildHasherDefault, sync::Arc}; |
4 | 4 | ||
5 | use base_db::CrateId; | ||
5 | use fst::{self, Streamer}; | 6 | use fst::{self, Streamer}; |
6 | use indexmap::{map::Entry, IndexMap}; | 7 | use indexmap::{map::Entry, IndexMap}; |
7 | use ra_db::CrateId; | ||
8 | use rustc_hash::{FxHashMap, FxHasher}; | 8 | use rustc_hash::{FxHashMap, FxHasher}; |
9 | use smallvec::SmallVec; | 9 | use smallvec::SmallVec; |
10 | use syntax::SmolStr; | 10 | use syntax::SmolStr; |
@@ -327,8 +327,8 @@ pub fn search_dependencies<'a>( | |||
327 | 327 | ||
328 | #[cfg(test)] | 328 | #[cfg(test)] |
329 | mod tests { | 329 | mod 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 | ||
4 | use std::collections::hash_map::Entry; | 4 | use std::collections::hash_map::Entry; |
5 | 5 | ||
6 | use base_db::CrateId; | ||
6 | use hir_expand::name::Name; | 7 | use hir_expand::name::Name; |
7 | use once_cell::sync::Lazy; | 8 | use once_cell::sync::Lazy; |
8 | use ra_db::CrateId; | ||
9 | use rustc_hash::{FxHashMap, FxHashSet}; | 9 | use rustc_hash::{FxHashMap, FxHashSet}; |
10 | use test_utils::mark; | 10 | use 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 @@ | |||
1 | use base_db::fixture::WithFixture; | ||
1 | use expect::{expect, Expect}; | 2 | use expect::{expect, Expect}; |
2 | use hir_expand::{db::AstDatabase, HirFileId, InFile}; | 3 | use hir_expand::{db::AstDatabase, HirFileId, InFile}; |
3 | use ra_db::fixture::WithFixture; | ||
4 | use rustc_hash::FxHashSet; | 4 | use rustc_hash::FxHashSet; |
5 | use std::sync::Arc; | 5 | use std::sync::Arc; |
6 | use stdx::format_to; | 6 | use 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; | |||
53 | use std::hash::{Hash, Hasher}; | 53 | use std::hash::{Hash, Hasher}; |
54 | 54 | ||
55 | use arena::Idx; | 55 | use arena::Idx; |
56 | use base_db::{impl_intern_key, salsa, CrateId}; | ||
56 | use hir_expand::{ | 57 | use 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 | }; |
60 | use ra_db::{impl_intern_key, salsa, CrateId}; | ||
61 | use syntax::ast; | 61 | use syntax::ast; |
62 | 62 | ||
63 | use crate::builtin_type::BuiltinType; | 63 | use 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; | |||
57 | use std::sync::Arc; | 57 | use std::sync::Arc; |
58 | 58 | ||
59 | use arena::Arena; | 59 | use arena::Arena; |
60 | use base_db::{CrateId, Edition, FileId}; | ||
60 | use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; | 61 | use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; |
61 | use ra_db::{CrateId, Edition, FileId}; | ||
62 | use rustc_hash::FxHashMap; | 62 | use rustc_hash::FxHashMap; |
63 | use stdx::format_to; | 63 | use stdx::format_to; |
64 | use syntax::ast; | 64 | use 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 | ||
6 | use base_db::{CrateId, FileId, ProcMacroId}; | ||
6 | use cfg::CfgOptions; | 7 | use cfg::CfgOptions; |
7 | use hir_expand::{ | 8 | use 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 | }; |
15 | use ra_db::{CrateId, FileId, ProcMacroId}; | ||
16 | use rustc_hash::FxHashMap; | 16 | use rustc_hash::FxHashMap; |
17 | use syntax::ast; | 17 | use syntax::ast; |
18 | use test_utils::mark; | 18 | use test_utils::mark; |
@@ -1209,7 +1209,7 @@ fn is_macro_rules(path: &ModPath) -> bool { | |||
1209 | mod tests { | 1209 | mod 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. |
2 | use base_db::FileId; | ||
2 | use hir_expand::name::Name; | 3 | use hir_expand::name::Name; |
3 | use ra_db::FileId; | ||
4 | use syntax::SmolStr; | 4 | use syntax::SmolStr; |
5 | 5 | ||
6 | use crate::{db::DefDatabase, HirFileId}; | 6 | use 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 | ||
13 | use std::iter::successors; | 13 | use std::iter::successors; |
14 | 14 | ||
15 | use base_db::Edition; | ||
15 | use hir_expand::name::Name; | 16 | use hir_expand::name::Name; |
16 | use ra_db::Edition; | ||
17 | use test_utils::mark; | 17 | use test_utils::mark; |
18 | 18 | ||
19 | use crate::{ | 19 | use 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 | ||
7 | use std::sync::Arc; | 7 | use std::sync::Arc; |
8 | 8 | ||
9 | use base_db::{fixture::WithFixture, SourceDatabase}; | ||
9 | use expect::{expect, Expect}; | 10 | use expect::{expect, Expect}; |
10 | use ra_db::{fixture::WithFixture, SourceDatabase}; | ||
11 | use test_utils::mark; | 11 | use test_utils::mark; |
12 | 12 | ||
13 | use crate::{db::DefDatabase, nameres::*, test_db::TestDB}; | 13 | use 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 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | 2 | ||
3 | use ra_db::SourceDatabaseExt; | 3 | use base_db::SourceDatabaseExt; |
4 | 4 | ||
5 | use super::*; | 5 | use 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 | ||
10 | use crate::body::LowerCtx; | 10 | use crate::body::LowerCtx; |
11 | use base_db::CrateId; | ||
11 | use hir_expand::{ | 12 | use hir_expand::{ |
12 | hygiene::Hygiene, | 13 | hygiene::Hygiene, |
13 | name::{AsName, Name}, | 14 | name::{AsName, Name}, |
14 | }; | 15 | }; |
15 | use ra_db::CrateId; | ||
16 | use syntax::ast; | 16 | use syntax::ast; |
17 | 17 | ||
18 | use crate::{ | 18 | use 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. |
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use base_db::CrateId; | ||
4 | use hir_expand::{ | 5 | use hir_expand::{ |
5 | name::{name, Name}, | 6 | name::{name, Name}, |
6 | MacroDefId, | 7 | MacroDefId, |
7 | }; | 8 | }; |
8 | use ra_db::CrateId; | ||
9 | use rustc_hash::FxHashSet; | 9 | use rustc_hash::FxHashSet; |
10 | 10 | ||
11 | use crate::{ | 11 | use 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 | ||
8 | use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, Upcast}; | ||
8 | use hir_expand::db::AstDatabase; | 9 | use hir_expand::db::AstDatabase; |
9 | use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, Upcast}; | ||
10 | use rustc_hash::FxHashSet; | 10 | use rustc_hash::FxHashSet; |
11 | 11 | ||
12 | use crate::db::DefDatabase; | 12 | use 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" | |||
14 | rustc-hash = "1.0.0" | 14 | rustc-hash = "1.0.0" |
15 | 15 | ||
16 | arena = { path = "../arena" } | 16 | arena = { path = "../arena" } |
17 | ra_db = { path = "../ra_db" } | 17 | base_db = { path = "../base_db" } |
18 | syntax = { path = "../syntax" } | 18 | syntax = { path = "../syntax" } |
19 | parser = { path = "../parser" } | 19 | parser = { path = "../parser" } |
20 | profile = { path = "../profile" } | 20 | profile = { 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)] |
255 | mod tests { | 255 | mod 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 | ||
7 | use base_db::FileId; | ||
7 | use either::Either; | 8 | use either::Either; |
8 | use mbe::parse_to_token_tree; | 9 | use mbe::parse_to_token_tree; |
9 | use parser::FragmentKind; | 10 | use parser::FragmentKind; |
10 | use ra_db::FileId; | ||
11 | use syntax::ast::{self, AstToken, HasStringValue}; | 11 | use syntax::ast::{self, AstToken, HasStringValue}; |
12 | 12 | ||
13 | macro_rules! register_builtin { | 13 | macro_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 | ||
3 | use std::sync::Arc; | 3 | use std::sync::Arc; |
4 | 4 | ||
5 | use base_db::{salsa, SourceDatabase}; | ||
5 | use mbe::{ExpandResult, MacroRules}; | 6 | use mbe::{ExpandResult, MacroRules}; |
6 | use parser::FragmentKind; | 7 | use parser::FragmentKind; |
7 | use ra_db::{salsa, SourceDatabase}; | ||
8 | use syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode}; | 8 | use syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode}; |
9 | 9 | ||
10 | use crate::{ | 10 | use 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 | ||
28 | use base_db::CrateId; | ||
28 | use parser::FragmentKind; | 29 | use parser::FragmentKind; |
29 | use ra_db::CrateId; | ||
30 | use std::sync::Arc; | 30 | use std::sync::Arc; |
31 | use syntax::{algo::SyntaxRewriter, SyntaxNode}; | 31 | use 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`. |
5 | use base_db::CrateId; | ||
5 | use either::Either; | 6 | use either::Either; |
6 | use ra_db::CrateId; | ||
7 | use syntax::ast; | 7 | use syntax::ast; |
8 | 8 | ||
9 | use crate::{ | 9 | use 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; | |||
18 | use std::hash::Hash; | 18 | use std::hash::Hash; |
19 | use std::sync::Arc; | 19 | use std::sync::Arc; |
20 | 20 | ||
21 | use ra_db::{impl_intern_key, salsa, CrateId, FileId}; | 21 | use base_db::{impl_intern_key, salsa, CrateId, FileId}; |
22 | use syntax::{ | 22 | use 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 | ||
118 | impl AsName for ra_db::Dependency { | 118 | impl 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 | ||
3 | use crate::{db::AstDatabase, LazyMacroId}; | 3 | use crate::{db::AstDatabase, LazyMacroId}; |
4 | use ra_db::{CrateId, ProcMacroId}; | 4 | use base_db::{CrateId, ProcMacroId}; |
5 | use tt::buffer::{Cursor, TokenBuffer}; | 5 | use 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 | ||
8 | use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate}; | 8 | use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate}; |
9 | use rustc_hash::FxHashSet; | 9 | use 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" } | |||
21 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } | 21 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } |
22 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } | 22 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } |
23 | arena = { path = "../arena" } | 23 | arena = { path = "../arena" } |
24 | ra_db = { path = "../ra_db" } | 24 | base_db = { path = "../base_db" } |
25 | profile = { path = "../profile" } | 25 | profile = { path = "../profile" } |
26 | syntax = { path = "../syntax" } | 26 | syntax = { path = "../syntax" } |
27 | test_utils = { path = "../test_utils" } | 27 | test_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 | ||
6 | use std::iter::successors; | 6 | use std::iter::successors; |
7 | 7 | ||
8 | use base_db::CrateId; | ||
8 | use hir_def::lang_item::LangItemTarget; | 9 | use hir_def::lang_item::LangItemTarget; |
9 | use hir_expand::name::name; | 10 | use hir_expand::name::name; |
10 | use log::{info, warn}; | 11 | use log::{info, warn}; |
11 | use ra_db::CrateId; | ||
12 | 12 | ||
13 | use crate::{ | 13 | use 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 @@ | |||
3 | use std::sync::Arc; | 3 | use std::sync::Arc; |
4 | 4 | ||
5 | use arena::map::ArenaMap; | 5 | use arena::map::ArenaMap; |
6 | use base_db::{impl_intern_key, salsa, CrateId, Upcast}; | ||
6 | use hir_def::{ | 7 | use 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 | }; |
10 | use ra_db::{impl_intern_key, salsa, CrateId, Upcast}; | ||
11 | 11 | ||
12 | use crate::{ | 12 | use 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)] |
210 | mod tests { | 210 | mod 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 | ||
27 | use std::{iter, mem, ops::Deref, sync::Arc}; | 27 | use std::{iter, mem, ops::Deref, sync::Arc}; |
28 | 28 | ||
29 | use base_db::{salsa, CrateId}; | ||
29 | use hir_def::{ | 30 | use 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 | }; |
35 | use itertools::Itertools; | 36 | use itertools::Itertools; |
36 | use ra_db::{salsa, CrateId}; | ||
37 | 37 | ||
38 | use crate::{ | 38 | use 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 @@ | |||
8 | use std::{iter, sync::Arc}; | 8 | use std::{iter, sync::Arc}; |
9 | 9 | ||
10 | use arena::map::ArenaMap; | 10 | use arena::map::ArenaMap; |
11 | use base_db::CrateId; | ||
11 | use hir_def::{ | 12 | use 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 | }; |
22 | use hir_expand::name::Name; | 23 | use hir_expand::name::Name; |
23 | use ra_db::CrateId; | ||
24 | use smallvec::SmallVec; | 24 | use smallvec::SmallVec; |
25 | use stdx::impl_from; | 25 | use stdx::impl_from; |
26 | use test_utils::mark; | 26 | use 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 @@ | |||
5 | use std::{iter, sync::Arc}; | 5 | use std::{iter, sync::Arc}; |
6 | 6 | ||
7 | use arrayvec::ArrayVec; | 7 | use arrayvec::ArrayVec; |
8 | use base_db::CrateId; | ||
8 | use hir_def::{ | 9 | use 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 | }; |
14 | use hir_expand::name::Name; | 15 | use hir_expand::name::Name; |
15 | use ra_db::CrateId; | ||
16 | use rustc_hash::{FxHashMap, FxHashSet}; | 16 | use rustc_hash::{FxHashMap, FxHashSet}; |
17 | 17 | ||
18 | use super::Substs; | 18 | use 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 | ||
8 | use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast}; | ||
8 | use hir_def::{db::DefDatabase, ModuleId}; | 9 | use hir_def::{db::DefDatabase, ModuleId}; |
9 | use hir_expand::db::AstDatabase; | 10 | use hir_expand::db::AstDatabase; |
10 | use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast}; | ||
11 | use rustc_hash::{FxHashMap, FxHashSet}; | 11 | use rustc_hash::{FxHashMap, FxHashSet}; |
12 | use syntax::TextRange; | 12 | use syntax::TextRange; |
13 | use test_utils::extract_annotations; | 13 | use 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 | ||
11 | use std::sync::Arc; | 11 | use std::sync::Arc; |
12 | 12 | ||
13 | use base_db::{fixture::WithFixture, FileRange, SourceDatabase, SourceDatabaseExt}; | ||
13 | use expect::Expect; | 14 | use expect::Expect; |
14 | use hir_def::{ | 15 | use 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 | }; |
23 | use hir_expand::{db::AstDatabase, InFile}; | 24 | use hir_expand::{db::AstDatabase, InFile}; |
24 | use ra_db::{fixture::WithFixture, FileRange, SourceDatabase, SourceDatabaseExt}; | ||
25 | use stdx::format_to; | 25 | use stdx::format_to; |
26 | use syntax::{ | 26 | use 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. |
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use base_db::CrateId; | ||
4 | use chalk_ir::cast::Cast; | 5 | use chalk_ir::cast::Cast; |
5 | use chalk_solve::Solver; | 6 | use chalk_solve::Solver; |
6 | use hir_def::{lang_item::LangItemTarget, TraitId}; | 7 | use hir_def::{lang_item::LangItemTarget, TraitId}; |
7 | use ra_db::CrateId; | ||
8 | 8 | ||
9 | use crate::{db::HirDatabase, DebruijnIndex, Substs}; | 9 | use 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; | |||
6 | use chalk_ir::{fold::shift::Shift, CanonicalVarKinds, GenericArg, TypeName}; | 6 | use chalk_ir::{fold::shift::Shift, CanonicalVarKinds, GenericArg, TypeName}; |
7 | use chalk_solve::rust_ir::{self, OpaqueTyDatumBound, WellKnownTrait}; | 7 | use chalk_solve::rust_ir::{self, OpaqueTyDatumBound, WellKnownTrait}; |
8 | 8 | ||
9 | use base_db::{salsa::InternKey, CrateId}; | ||
9 | use hir_def::{ | 10 | use 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 | }; |
13 | use ra_db::{salsa::InternKey, CrateId}; | ||
14 | 14 | ||
15 | use super::ChalkContext; | 15 | use super::ChalkContext; |
16 | use crate::{ | 16 | use 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 | ||
4 | use super::tls; | 4 | use super::tls; |
5 | use base_db::salsa::InternId; | ||
5 | use chalk_ir::{GenericArg, Goal, GoalData}; | 6 | use chalk_ir::{GenericArg, Goal, GoalData}; |
6 | use hir_def::TypeAliasId; | 7 | use hir_def::TypeAliasId; |
7 | use ra_db::salsa::InternId; | ||
8 | use std::{fmt, sync::Arc}; | 8 | use 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 | }; |
10 | use chalk_solve::rust_ir; | 10 | use chalk_solve::rust_ir; |
11 | 11 | ||
12 | use base_db::salsa::InternKey; | ||
12 | use hir_def::{type_ref::Mutability, AssocContainerId, GenericDefId, Lookup, TypeAliasId}; | 13 | use hir_def::{type_ref::Mutability, AssocContainerId, GenericDefId, Lookup, TypeAliasId}; |
13 | use ra_db::salsa::InternKey; | ||
14 | 14 | ||
15 | use crate::{ | 15 | use 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 | ||
24 | syntax = { path = "../syntax" } | 24 | syntax = { path = "../syntax" } |
25 | text_edit = { path = "../text_edit" } | 25 | text_edit = { path = "../text_edit" } |
26 | ra_db = { path = "../ra_db" } | 26 | base_db = { path = "../base_db" } |
27 | ra_ide_db = { path = "../ra_ide_db" } | 27 | ra_ide_db = { path = "../ra_ide_db" } |
28 | cfg = { path = "../cfg" } | 28 | cfg = { path = "../cfg" } |
29 | profile = { path = "../profile" } | 29 | profile = { 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)] |
139 | mod tests { | 139 | mod 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 | ||
3 | use base_db::SourceDatabase; | ||
3 | use hir::{Semantics, SemanticsScope, Type}; | 4 | use hir::{Semantics, SemanticsScope, Type}; |
4 | use ra_db::SourceDatabase; | ||
5 | use ra_ide_db::RootDatabase; | 5 | use ra_ide_db::RootDatabase; |
6 | use syntax::{ | 6 | use 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 | ||
7 | use std::cell::RefCell; | 7 | use std::cell::RefCell; |
8 | 8 | ||
9 | use base_db::SourceDatabase; | ||
9 | use hir::{diagnostics::DiagnosticSinkBuilder, Semantics}; | 10 | use hir::{diagnostics::DiagnosticSinkBuilder, Semantics}; |
10 | use itertools::Itertools; | 11 | use itertools::Itertools; |
11 | use ra_db::SourceDatabase; | ||
12 | use ra_ide_db::RootDatabase; | 12 | use ra_ide_db::RootDatabase; |
13 | use syntax::{ | 13 | use 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. |
3 | use crate::Fix; | 3 | use crate::Fix; |
4 | use ast::{edit::IndentLevel, make}; | 4 | use ast::{edit::IndentLevel, make}; |
5 | use base_db::FileId; | ||
5 | use hir::{ | 6 | use 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 | }; |
10 | use ra_db::FileId; | ||
11 | use ra_ide_db::{ | 11 | use 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 | ||
3 | use base_db::{FileId, SourceDatabase}; | ||
3 | use either::Either; | 4 | use either::Either; |
4 | use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource}; | 5 | use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource}; |
5 | use ra_db::{FileId, SourceDatabase}; | ||
6 | use ra_ide_db::{defs::Definition, RootDatabase}; | 6 | use ra_ide_db::{defs::Definition, RootDatabase}; |
7 | use syntax::{ | 7 | use 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)] |
102 | mod tests { | 102 | mod 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)] |
76 | mod tests { | 76 | mod 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)] |
56 | mod tests { | 56 | mod 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 @@ | |||
1 | use base_db::SourceDatabase; | ||
1 | use hir::{ | 2 | use 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 | }; |
5 | use itertools::Itertools; | 6 | use itertools::Itertools; |
6 | use ra_db::SourceDatabase; | ||
7 | use ra_ide_db::{ | 7 | use 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)] |
354 | mod tests { | 354 | mod 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 | ||
48 | use std::sync::Arc; | 48 | use std::sync::Arc; |
49 | 49 | ||
50 | use cfg::CfgOptions; | 50 | use base_db::{ |
51 | use 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 | }; |
54 | use cfg::CfgOptions; | ||
55 | use ra_ide_db::{ | 55 | use 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 | ||
84 | pub use hir::{Documentation, Semantics}; | 84 | pub use base_db::{ |
85 | pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist}; | ||
86 | pub 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 | }; |
88 | pub use hir::{Documentation, Semantics}; | ||
89 | pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist}; | ||
90 | pub use ra_ide_db::{ | 90 | pub 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 |
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use base_db::{CrateName, FileSet, SourceRoot, VfsPath}; | ||
4 | use cfg::CfgOptions; | 5 | use cfg::CfgOptions; |
5 | use ra_db::{CrateName, FileSet, SourceRoot, VfsPath}; | ||
6 | use test_utils::{ | 6 | use 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 @@ | |||
1 | use base_db::{CrateId, FileId, FilePosition}; | ||
1 | use hir::Semantics; | 2 | use hir::Semantics; |
2 | use ra_db::{CrateId, FileId, FilePosition}; | ||
3 | use ra_ide_db::RootDatabase; | 3 | use ra_ide_db::RootDatabase; |
4 | use syntax::{ | 4 | use 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)] |
65 | mod tests { | 65 | mod 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 | ||
3 | use base_db::SourceDatabaseExt; | ||
3 | use hir::{Module, ModuleDef, ModuleSource, Semantics}; | 4 | use hir::{Module, ModuleDef, ModuleSource, Semantics}; |
4 | use ra_db::SourceDatabaseExt; | ||
5 | use ra_ide_db::{ | 5 | use 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 @@ | |||
1 | use ra_db::{FilePosition, FileRange}; | 1 | use base_db::{FilePosition, FileRange}; |
2 | use ra_ide_db::RootDatabase; | 2 | use ra_ide_db::RootDatabase; |
3 | 3 | ||
4 | use crate::SourceFileEdit; | 4 | use 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 @@ | |||
1 | use std::{fmt, iter::FromIterator, sync::Arc}; | 1 | use std::{fmt, iter::FromIterator, sync::Arc}; |
2 | 2 | ||
3 | use hir::MacroFile; | 3 | use base_db::{ |
4 | use profile::{memory_usage, Bytes}; | ||
5 | use ra_db::{ | ||
6 | salsa::debug::{DebugQueryTable, TableEntry}, | 4 | salsa::debug::{DebugQueryTable, TableEntry}, |
7 | FileTextQuery, SourceRootId, | 5 | FileTextQuery, SourceRootId, |
8 | }; | 6 | }; |
7 | use hir::MacroFile; | ||
8 | use profile::{memory_usage, Bytes}; | ||
9 | use ra_ide_db::{ | 9 | use 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}; | |||
16 | use crate::FileId; | 16 | use crate::FileId; |
17 | 17 | ||
18 | fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { | 18 | fn 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 | } |
21 | fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { | 21 | fn 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 | ||
3 | use base_db::SourceDatabase; | ||
3 | use oorandom::Rand32; | 4 | use oorandom::Rand32; |
4 | use ra_db::SourceDatabase; | ||
5 | use syntax::{AstNode, TextRange, TextSize}; | 5 | use syntax::{AstNode, TextRange, TextSize}; |
6 | 6 | ||
7 | use crate::{syntax_highlighting::highlight, FileId, RootDatabase}; | 7 | use 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 @@ | |||
1 | use ra_db::{FileId, SourceDatabase}; | 1 | use base_db::{FileId, SourceDatabase}; |
2 | use ra_ide_db::RootDatabase; | 2 | use ra_ide_db::RootDatabase; |
3 | use syntax::{ | 3 | use 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 | ||
16 | mod on_enter; | 16 | mod on_enter; |
17 | 17 | ||
18 | use ra_db::{FilePosition, SourceDatabase}; | 18 | use base_db::{FilePosition, SourceDatabase}; |
19 | use ra_ide_db::{source_change::SourceFileEdit, RootDatabase}; | 19 | use ra_ide_db::{source_change::SourceFileEdit, RootDatabase}; |
20 | use syntax::{ | 20 | use 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 | ||
4 | use ra_db::{FilePosition, SourceDatabase}; | 4 | use base_db::{FilePosition, SourceDatabase}; |
5 | use ra_ide_db::RootDatabase; | 5 | use ra_ide_db::RootDatabase; |
6 | use syntax::{ | 6 | use 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 | ||
24 | syntax = { path = "../syntax" } | 24 | syntax = { path = "../syntax" } |
25 | text_edit = { path = "../text_edit" } | 25 | text_edit = { path = "../text_edit" } |
26 | ra_db = { path = "../ra_db" } | 26 | base_db = { path = "../base_db" } |
27 | profile = { path = "../profile" } | 27 | profile = { path = "../profile" } |
28 | test_utils = { path = "../test_utils" } | 28 | test_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 | ||
4 | use std::{fmt, sync::Arc, time}; | 4 | use std::{fmt, sync::Arc, time}; |
5 | 5 | ||
6 | use profile::{memory_usage, Bytes}; | 6 | use base_db::{ |
7 | use 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 | }; |
10 | use profile::{memory_usage, Bytes}; | ||
11 | use rustc_hash::FxHashSet; | 11 | use rustc_hash::FxHashSet; |
12 | 12 | ||
13 | use crate::{symbol_index::SymbolsDatabase, RootDatabase}; | 13 | use 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 | ||
14 | use std::{fmt, sync::Arc}; | 14 | use std::{fmt, sync::Arc}; |
15 | 15 | ||
16 | use hir::db::{AstDatabase, DefDatabase, HirDatabase}; | 16 | use base_db::{ |
17 | use 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 | }; |
21 | use hir::db::{AstDatabase, DefDatabase, HirDatabase}; | ||
22 | use rustc_hash::FxHashSet; | 22 | use rustc_hash::FxHashSet; |
23 | 23 | ||
24 | use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase}; | 24 | use 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)] |
132 | pub trait LineIndexDatabase: ra_db::SourceDatabase + CheckCanceled { | 132 | pub 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 | ||
7 | use std::{convert::TryInto, mem}; | 7 | use std::{convert::TryInto, mem}; |
8 | 8 | ||
9 | use base_db::{FileId, FileRange, SourceDatabaseExt}; | ||
9 | use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; | 10 | use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; |
10 | use once_cell::unsync::Lazy; | 11 | use once_cell::unsync::Lazy; |
11 | use ra_db::{FileId, FileRange, SourceDatabaseExt}; | ||
12 | use rustc_hash::FxHashMap; | 12 | use rustc_hash::FxHashMap; |
13 | use syntax::{ast, match_ast, AstNode, TextRange, TextSize}; | 13 | use 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 | ||
6 | use ra_db::FileId; | 6 | use base_db::FileId; |
7 | use text_edit::TextEdit; | 7 | use 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 | ||
31 | use fst::{self, Streamer}; | 31 | use base_db::{ |
32 | use hir::db::DefDatabase; | ||
33 | use ra_db::{ | ||
34 | salsa::{self, ParallelDatabase}, | 32 | salsa::{self, ParallelDatabase}, |
35 | CrateId, FileId, SourceDatabaseExt, SourceRootId, | 33 | CrateId, FileId, SourceDatabaseExt, SourceRootId, |
36 | }; | 34 | }; |
35 | use fst::{self, Streamer}; | ||
36 | use hir::db::DefDatabase; | ||
37 | use rayon::prelude::*; | 37 | use rayon::prelude::*; |
38 | use rustc_hash::{FxHashMap, FxHashSet}; | 38 | use rustc_hash::{FxHashMap, FxHashSet}; |
39 | use syntax::{ | 39 | use 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] |
14 | text_edit = { path = "../text_edit" } | 14 | text_edit = { path = "../text_edit" } |
15 | syntax = { path = "../syntax" } | 15 | syntax = { path = "../syntax" } |
16 | ra_db = { path = "../ra_db" } | 16 | base_db = { path = "../base_db" } |
17 | ra_ide_db = { path = "../ra_ide_db" } | 17 | ra_ide_db = { path = "../ra_ide_db" } |
18 | hir = { path = "../ra_hir", package = "ra_hir" } | 18 | hir = { path = "../ra_hir", package = "ra_hir" } |
19 | rustc-hash = "1.1.0" | 19 | rustc-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; | |||
18 | pub use crate::errors::SsrError; | 18 | pub use crate::errors::SsrError; |
19 | pub use crate::matching::Match; | 19 | pub use crate::matching::Match; |
20 | use crate::matching::MatchFailureReason; | 20 | use crate::matching::MatchFailureReason; |
21 | use base_db::{FileId, FilePosition, FileRange}; | ||
21 | use hir::Semantics; | 22 | use hir::Semantics; |
22 | use ra_db::{FileId, FilePosition, FileRange}; | ||
23 | use ra_ide_db::source_change::SourceFileEdit; | 23 | use ra_ide_db::source_change::SourceFileEdit; |
24 | use resolving::ResolvedRule; | 24 | use resolving::ResolvedRule; |
25 | use rustc_hash::FxHashMap; | 25 | use 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 | }; |
9 | use base_db::FileRange; | ||
9 | use hir::Semantics; | 10 | use hir::Semantics; |
10 | use ra_db::FileRange; | ||
11 | use rustc_hash::FxHashMap; | 11 | use rustc_hash::FxHashMap; |
12 | use std::{cell::Cell, iter::Peekable}; | 12 | use std::{cell::Cell, iter::Peekable}; |
13 | use syntax::ast::{AstNode, AstToken}; | 13 | use 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 | ||
3 | use crate::errors::error; | 3 | use crate::errors::error; |
4 | use crate::{parsing, SsrError}; | 4 | use crate::{parsing, SsrError}; |
5 | use base_db::FilePosition; | ||
5 | use parsing::Placeholder; | 6 | use parsing::Placeholder; |
6 | use ra_db::FilePosition; | ||
7 | use rustc_hash::FxHashMap; | 7 | use rustc_hash::FxHashMap; |
8 | use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken}; | 8 | use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken}; |
9 | use test_utils::mark; | 9 | use 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 | }; |
8 | use ra_db::{FileId, FileRange}; | 8 | use base_db::{FileId, FileRange}; |
9 | use ra_ide_db::{ | 9 | use 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 @@ | |||
1 | use crate::{MatchFinder, SsrRule}; | 1 | use crate::{MatchFinder, SsrRule}; |
2 | use base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; | ||
2 | use expect::{expect, Expect}; | 3 | use expect::{expect, Expect}; |
3 | use ra_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; | ||
4 | use rustc_hash::FxHashSet; | 4 | use rustc_hash::FxHashSet; |
5 | use std::sync::Arc; | 5 | use std::sync::Arc; |
6 | use test_utils::{mark, RangeOrOffset}; | 6 | use 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. |
64 | pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) { | 64 | pub(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" } | |||
46 | toolchain = { path = "../toolchain" } | 46 | toolchain = { path = "../toolchain" } |
47 | 47 | ||
48 | # This should only be used in CLI | 48 | # This should only be used in CLI |
49 | ra_db = { path = "../ra_db" } | 49 | base_db = { path = "../base_db" } |
50 | ra_ide_db = { path = "../ra_ide_db" } | 50 | ra_ide_db = { path = "../ra_ide_db" } |
51 | ra_ssr = { path = "../ra_ssr" } | 51 | ra_ssr = { path = "../ra_ssr" } |
52 | hir = { path = "../ra_hir", package = "ra_hir" } | 52 | hir = { 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 @@ | |||
3 | use std::{env, path::PathBuf, str::FromStr, sync::Arc, time::Instant}; | 3 | use std::{env, path::PathBuf, str::FromStr, sync::Arc, time::Instant}; |
4 | 4 | ||
5 | use anyhow::{bail, format_err, Result}; | 5 | use anyhow::{bail, format_err, Result}; |
6 | use ra_db::{ | 6 | use 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 | ||
9 | use base_db::{ | ||
10 | salsa::{self, ParallelDatabase}, | ||
11 | SourceDatabaseExt, | ||
12 | }; | ||
9 | use hir::{ | 13 | use 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; | |||
14 | use hir_ty::{Ty, TypeWalk}; | 18 | use hir_ty::{Ty, TypeWalk}; |
15 | use itertools::Itertools; | 19 | use itertools::Itertools; |
16 | use oorandom::Rand32; | 20 | use oorandom::Rand32; |
17 | use ra_db::{ | ||
18 | salsa::{self, ParallelDatabase}, | ||
19 | SourceDatabaseExt, | ||
20 | }; | ||
21 | use rayon::prelude::*; | 21 | use rayon::prelude::*; |
22 | use rustc_hash::FxHashSet; | 22 | use rustc_hash::FxHashSet; |
23 | use stdx::format_to; | 23 | use 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; | |||
6 | use anyhow::anyhow; | 6 | use anyhow::anyhow; |
7 | use rustc_hash::FxHashSet; | 7 | use rustc_hash::FxHashSet; |
8 | 8 | ||
9 | use base_db::SourceDatabaseExt; | ||
9 | use hir::Crate; | 10 | use hir::Crate; |
10 | use ra_db::SourceDatabaseExt; | ||
11 | use ra_ide::Severity; | 11 | use ra_ide::Severity; |
12 | 12 | ||
13 | use crate::cli::{load_cargo::load_cargo, Result}; | 13 | use 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 @@ | |||
3 | use std::{path::Path, sync::Arc}; | 3 | use std::{path::Path, sync::Arc}; |
4 | 4 | ||
5 | use anyhow::Result; | 5 | use anyhow::Result; |
6 | use base_db::CrateGraph; | ||
6 | use crossbeam_channel::{unbounded, Receiver}; | 7 | use crossbeam_channel::{unbounded, Receiver}; |
7 | use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; | 8 | use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; |
8 | use ra_db::CrateGraph; | ||
9 | use ra_ide::{AnalysisChange, AnalysisHost}; | 9 | use ra_ide::{AnalysisChange, AnalysisHost}; |
10 | use vfs::{loader::Handle, AbsPath, AbsPathBuf}; | 10 | use 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}; | |||
4 | use ra_ssr::{MatchFinder, SsrPattern, SsrRule}; | 4 | use ra_ssr::{MatchFinder, SsrPattern, SsrRule}; |
5 | 5 | ||
6 | pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> { | 6 | pub 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. |
28 | pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> { | 28 | pub 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. |
2 | use std::convert::TryFrom; | 2 | use std::convert::TryFrom; |
3 | 3 | ||
4 | use ra_db::{FileId, FilePosition, FileRange}; | 4 | use base_db::{FileId, FilePosition, FileRange}; |
5 | use ra_ide::{AssistKind, LineCol, LineIndex}; | 5 | use ra_ide::{AssistKind, LineCol, LineIndex}; |
6 | use syntax::{TextRange, TextSize}; | 6 | use syntax::{TextRange, TextSize}; |
7 | use vfs::AbsPathBuf; | 7 | use 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 | ||
6 | use std::{sync::Arc, time::Instant}; | 6 | use std::{sync::Arc, time::Instant}; |
7 | 7 | ||
8 | use base_db::{CrateId, VfsPath}; | ||
8 | use crossbeam_channel::{unbounded, Receiver, Sender}; | 9 | use crossbeam_channel::{unbounded, Receiver, Sender}; |
9 | use flycheck::FlycheckHandle; | 10 | use flycheck::FlycheckHandle; |
10 | use lsp_types::{SemanticTokens, Url}; | 11 | use lsp_types::{SemanticTokens, Url}; |
11 | use parking_lot::{Mutex, RwLock}; | 12 | use parking_lot::{Mutex, RwLock}; |
12 | use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; | 13 | use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; |
13 | use ra_db::{CrateId, VfsPath}; | ||
14 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; | 14 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; |
15 | use rustc_hash::FxHashMap; | 15 | use 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. |
2 | use std::{error::Error, ops::Range}; | 2 | use std::{error::Error, ops::Range}; |
3 | 3 | ||
4 | use base_db::Canceled; | ||
4 | use lsp_server::Notification; | 5 | use lsp_server::Notification; |
5 | use ra_db::Canceled; | ||
6 | use ra_ide::LineIndex; | 6 | use ra_ide::LineIndex; |
7 | 7 | ||
8 | use crate::{from_proto, global_state::GlobalState}; | 8 | use 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 | ||
8 | use base_db::VfsPath; | ||
8 | use crossbeam_channel::{select, Receiver}; | 9 | use crossbeam_channel::{select, Receiver}; |
9 | use lsp_server::{Connection, Notification, Request, Response}; | 10 | use lsp_server::{Connection, Notification, Request, Response}; |
10 | use lsp_types::notification::Notification as _; | 11 | use lsp_types::notification::Notification as _; |
11 | use ra_db::VfsPath; | ||
12 | use ra_ide::{Canceled, FileId}; | 12 | use ra_ide::{Canceled, FileId}; |
13 | 13 | ||
14 | use crate::{ | 14 | use 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 |
2 | use std::{mem, sync::Arc}; | 2 | use std::{mem, sync::Arc}; |
3 | 3 | ||
4 | use base_db::{CrateGraph, SourceRoot, VfsPath}; | ||
4 | use flycheck::FlycheckHandle; | 5 | use flycheck::FlycheckHandle; |
5 | use project_model::{ProcMacroClient, ProjectWorkspace}; | 6 | use project_model::{ProcMacroClient, ProjectWorkspace}; |
6 | use ra_db::{CrateGraph, SourceRoot, VfsPath}; | ||
7 | use ra_ide::AnalysisChange; | 7 | use ra_ide::AnalysisChange; |
8 | use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind}; | 8 | use 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 | ||
7 | use base_db::{FileId, FileRange}; | ||
7 | use itertools::Itertools; | 8 | use itertools::Itertools; |
8 | use ra_db::{FileId, FileRange}; | ||
9 | use ra_ide::{ | 9 | use 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, |