diff options
-rw-r--r-- | Cargo.lock | 144 | ||||
-rw-r--r-- | crates/base_db/Cargo.toml (renamed from crates/ra_db/Cargo.toml) | 8 | ||||
-rw-r--r-- | crates/base_db/src/cancellation.rs (renamed from crates/ra_db/src/cancellation.rs) | 0 | ||||
-rw-r--r-- | crates/base_db/src/fixture.rs (renamed from crates/ra_db/src/fixture.rs) | 0 | ||||
-rw-r--r-- | crates/base_db/src/input.rs (renamed from crates/ra_db/src/input.rs) | 0 | ||||
-rw-r--r-- | crates/base_db/src/lib.rs (renamed from crates/ra_db/src/lib.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/Cargo.toml (renamed from crates/ra_hir_def/Cargo.toml) | 13 | ||||
-rw-r--r-- | crates/hir_def/src/adt.rs (renamed from crates/ra_hir_def/src/adt.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/attr.rs (renamed from crates/ra_hir_def/src/attr.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/body.rs (renamed from crates/ra_hir_def/src/body.rs) | 4 | ||||
-rw-r--r-- | crates/hir_def/src/body/lower.rs (renamed from crates/ra_hir_def/src/body/lower.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/body/scope.rs (renamed from crates/ra_hir_def/src/body/scope.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/builtin_type.rs (renamed from crates/ra_hir_def/src/builtin_type.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/child_by_source.rs (renamed from crates/ra_hir_def/src/child_by_source.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/data.rs (renamed from crates/ra_hir_def/src/data.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/db.rs (renamed from crates/ra_hir_def/src/db.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/diagnostics.rs (renamed from crates/ra_hir_def/src/diagnostics.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/docs.rs (renamed from crates/ra_hir_def/src/docs.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/dyn_map.rs (renamed from crates/ra_hir_def/src/dyn_map.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/expr.rs (renamed from crates/ra_hir_def/src/expr.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/find_path.rs (renamed from crates/ra_hir_def/src/find_path.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/generics.rs (renamed from crates/ra_hir_def/src/generics.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/import_map.rs (renamed from crates/ra_hir_def/src/import_map.rs) | 4 | ||||
-rw-r--r-- | crates/hir_def/src/item_scope.rs (renamed from crates/ra_hir_def/src/item_scope.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/item_tree.rs (renamed from crates/ra_hir_def/src/item_tree.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/item_tree/lower.rs (renamed from crates/ra_hir_def/src/item_tree/lower.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/item_tree/tests.rs (renamed from crates/ra_hir_def/src/item_tree/tests.rs) | 10 | ||||
-rw-r--r-- | crates/hir_def/src/keys.rs (renamed from crates/ra_hir_def/src/keys.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/lang_item.rs (renamed from crates/ra_hir_def/src/lang_item.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/lib.rs (renamed from crates/ra_hir_def/src/lib.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/nameres.rs (renamed from crates/ra_hir_def/src/nameres.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs (renamed from crates/ra_hir_def/src/nameres/collector.rs) | 4 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/mod_resolution.rs (renamed from crates/ra_hir_def/src/nameres/mod_resolution.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/path_resolution.rs (renamed from crates/ra_hir_def/src/nameres/path_resolution.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/tests.rs (renamed from crates/ra_hir_def/src/nameres/tests.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/tests/globs.rs (renamed from crates/ra_hir_def/src/nameres/tests/globs.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/tests/incremental.rs (renamed from crates/ra_hir_def/src/nameres/tests/incremental.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/tests/macros.rs (renamed from crates/ra_hir_def/src/nameres/tests/macros.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/tests/mod_resolution.rs (renamed from crates/ra_hir_def/src/nameres/tests/mod_resolution.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/tests/primitives.rs (renamed from crates/ra_hir_def/src/nameres/tests/primitives.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/path.rs (renamed from crates/ra_hir_def/src/path.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/path/lower.rs (renamed from crates/ra_hir_def/src/path/lower.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/path/lower/lower_use.rs (renamed from crates/ra_hir_def/src/path/lower/lower_use.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/per_ns.rs (renamed from crates/ra_hir_def/src/per_ns.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/resolver.rs (renamed from crates/ra_hir_def/src/resolver.rs) | 2 | ||||
-rw-r--r-- | crates/hir_def/src/src.rs (renamed from crates/ra_hir_def/src/src.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/test_db.rs (renamed from crates/ra_hir_def/src/test_db.rs) | 6 | ||||
-rw-r--r-- | crates/hir_def/src/trace.rs (renamed from crates/ra_hir_def/src/trace.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/type_ref.rs (renamed from crates/ra_hir_def/src/type_ref.rs) | 0 | ||||
-rw-r--r-- | crates/hir_def/src/visibility.rs (renamed from crates/ra_hir_def/src/visibility.rs) | 0 | ||||
-rw-r--r-- | crates/hir_expand/Cargo.toml (renamed from crates/ra_hir_expand/Cargo.toml) | 10 | ||||
-rw-r--r-- | crates/hir_expand/src/ast_id_map.rs (renamed from crates/ra_hir_expand/src/ast_id_map.rs) | 0 | ||||
-rw-r--r-- | crates/hir_expand/src/builtin_derive.rs (renamed from crates/ra_hir_expand/src/builtin_derive.rs) | 2 | ||||
-rw-r--r-- | crates/hir_expand/src/builtin_macro.rs (renamed from crates/ra_hir_expand/src/builtin_macro.rs) | 4 | ||||
-rw-r--r-- | crates/hir_expand/src/db.rs (renamed from crates/ra_hir_expand/src/db.rs) | 2 | ||||
-rw-r--r-- | crates/hir_expand/src/diagnostics.rs (renamed from crates/ra_hir_expand/src/diagnostics.rs) | 0 | ||||
-rw-r--r-- | crates/hir_expand/src/eager.rs (renamed from crates/ra_hir_expand/src/eager.rs) | 2 | ||||
-rw-r--r-- | crates/hir_expand/src/hygiene.rs (renamed from crates/ra_hir_expand/src/hygiene.rs) | 2 | ||||
-rw-r--r-- | crates/hir_expand/src/lib.rs (renamed from crates/ra_hir_expand/src/lib.rs) | 4 | ||||
-rw-r--r-- | crates/hir_expand/src/name.rs (renamed from crates/ra_hir_expand/src/name.rs) | 2 | ||||
-rw-r--r-- | crates/hir_expand/src/proc_macro.rs (renamed from crates/ra_hir_expand/src/proc_macro.rs) | 2 | ||||
-rw-r--r-- | crates/hir_expand/src/quote.rs (renamed from crates/ra_hir_expand/src/quote.rs) | 0 | ||||
-rw-r--r-- | crates/hir_expand/src/test_db.rs (renamed from crates/ra_hir_expand/src/test_db.rs) | 6 | ||||
-rw-r--r-- | crates/project_model/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/project_model/src/cargo_workspace.rs | 2 | ||||
-rw-r--r-- | crates/project_model/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/project_model/src/project_json.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/assist_context.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/handlers/fix_visibility.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/handlers/generate_function.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/tests.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/Cargo.toml | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir/src/from_id.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/semantics.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/semantics/source_to_def.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/source_analyzer.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/Cargo.toml | 6 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/autoderef.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/db.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/lower.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/method_resolution.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/test_db.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/tests/simple.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk/interner.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk/mapping.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/call_hierarchy.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/diagnostics.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/display/navigation_target.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/goto_definition.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/goto_implementation.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/goto_type_definition.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/hover.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide/src/lib.rs | 10 | ||||
-rw-r--r-- | crates/ra_ide/src/mock_analysis.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/parent_module.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide/src/references/rename.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/ssr.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/status.rs | 8 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/html.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_tree.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/typing.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/typing/on_enter.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_db/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_ide_db/src/change.rs | 18 | ||||
-rw-r--r-- | crates/ra_ide_db/src/lib.rs | 14 | ||||
-rw-r--r-- | crates/ra_ide_db/src/search.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_db/src/source_change.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_db/src/symbol_index.rs | 6 | ||||
-rw-r--r-- | crates/ra_ssr/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_ssr/src/lib.rs | 8 | ||||
-rw-r--r-- | crates/ra_ssr/src/matching.rs | 2 | ||||
-rw-r--r-- | crates/ra_ssr/src/resolving.rs | 2 | ||||
-rw-r--r-- | crates/ra_ssr/src/search.rs | 4 | ||||
-rw-r--r-- | crates/ra_ssr/src/tests.rs | 6 | ||||
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 4 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/analysis_bench.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/analysis_stats.rs | 8 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/diagnostics.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/load_cargo.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/ssr.rs | 4 | ||||
-rw-r--r-- | crates/rust-analyzer/src/diagnostics/to_proto.rs | 12 | ||||
-rw-r--r-- | crates/rust-analyzer/src/from_proto.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/lsp_utils.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/test_data/macro_compiler_error.txt | 4 | ||||
-rw-r--r-- | docs/dev/architecture.md | 6 | ||||
-rw-r--r-- | docs/dev/guide.md | 4 | ||||
-rw-r--r-- | xtask/src/lib.rs | 2 | ||||
-rw-r--r-- | xtask/tests/tidy.rs | 2 |
144 files changed, 262 insertions, 263 deletions
diff --git a/Cargo.lock b/Cargo.lock index 9878dd88f..702bd5191 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -84,6 +84,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
84 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" | 84 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" |
85 | 85 | ||
86 | [[package]] | 86 | [[package]] |
87 | name = "base_db" | ||
88 | version = "0.0.0" | ||
89 | dependencies = [ | ||
90 | "cfg", | ||
91 | "profile", | ||
92 | "rustc-hash", | ||
93 | "salsa", | ||
94 | "stdx", | ||
95 | "syntax", | ||
96 | "test_utils", | ||
97 | "tt", | ||
98 | "vfs", | ||
99 | ] | ||
100 | |||
101 | [[package]] | ||
87 | name = "bitflags" | 102 | name = "bitflags" |
88 | version = "1.2.1" | 103 | version = "1.2.1" |
89 | source = "registry+https://github.com/rust-lang/crates.io-index" | 104 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -449,6 +464,50 @@ dependencies = [ | |||
449 | ] | 464 | ] |
450 | 465 | ||
451 | [[package]] | 466 | [[package]] |
467 | name = "hir_def" | ||
468 | version = "0.0.0" | ||
469 | dependencies = [ | ||
470 | "anymap", | ||
471 | "arena", | ||
472 | "base_db", | ||
473 | "cfg", | ||
474 | "drop_bomb", | ||
475 | "either", | ||
476 | "expect", | ||
477 | "fst", | ||
478 | "hir_expand", | ||
479 | "indexmap", | ||
480 | "itertools", | ||
481 | "log", | ||
482 | "mbe", | ||
483 | "once_cell", | ||
484 | "profile", | ||
485 | "rustc-hash", | ||
486 | "smallvec", | ||
487 | "stdx", | ||
488 | "syntax", | ||
489 | "test_utils", | ||
490 | "tt", | ||
491 | ] | ||
492 | |||
493 | [[package]] | ||
494 | name = "hir_expand" | ||
495 | version = "0.0.0" | ||
496 | dependencies = [ | ||
497 | "arena", | ||
498 | "base_db", | ||
499 | "either", | ||
500 | "log", | ||
501 | "mbe", | ||
502 | "parser", | ||
503 | "profile", | ||
504 | "rustc-hash", | ||
505 | "syntax", | ||
506 | "test_utils", | ||
507 | "tt", | ||
508 | ] | ||
509 | |||
510 | [[package]] | ||
452 | name = "home" | 511 | name = "home" |
453 | version = "0.5.3" | 512 | version = "0.5.3" |
454 | source = "registry+https://github.com/rust-lang/crates.io-index" | 513 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -956,12 +1015,12 @@ version = "0.0.0" | |||
956 | dependencies = [ | 1015 | dependencies = [ |
957 | "anyhow", | 1016 | "anyhow", |
958 | "arena", | 1017 | "arena", |
1018 | "base_db", | ||
959 | "cargo_metadata", | 1019 | "cargo_metadata", |
960 | "cfg", | 1020 | "cfg", |
961 | "log", | 1021 | "log", |
962 | "paths", | 1022 | "paths", |
963 | "proc_macro_api", | 1023 | "proc_macro_api", |
964 | "ra_db", | ||
965 | "rustc-hash", | 1024 | "rustc-hash", |
966 | "serde", | 1025 | "serde", |
967 | "serde_json", | 1026 | "serde_json", |
@@ -982,10 +1041,10 @@ dependencies = [ | |||
982 | name = "ra_assists" | 1041 | name = "ra_assists" |
983 | version = "0.1.0" | 1042 | version = "0.1.0" |
984 | dependencies = [ | 1043 | dependencies = [ |
1044 | "base_db", | ||
985 | "either", | 1045 | "either", |
986 | "itertools", | 1046 | "itertools", |
987 | "profile", | 1047 | "profile", |
988 | "ra_db", | ||
989 | "ra_hir", | 1048 | "ra_hir", |
990 | "ra_ide_db", | 1049 | "ra_ide_db", |
991 | "rustc-hash", | 1050 | "rustc-hash", |
@@ -996,32 +1055,17 @@ dependencies = [ | |||
996 | ] | 1055 | ] |
997 | 1056 | ||
998 | [[package]] | 1057 | [[package]] |
999 | name = "ra_db" | ||
1000 | version = "0.1.0" | ||
1001 | dependencies = [ | ||
1002 | "cfg", | ||
1003 | "profile", | ||
1004 | "rustc-hash", | ||
1005 | "salsa", | ||
1006 | "stdx", | ||
1007 | "syntax", | ||
1008 | "test_utils", | ||
1009 | "tt", | ||
1010 | "vfs", | ||
1011 | ] | ||
1012 | |||
1013 | [[package]] | ||
1014 | name = "ra_hir" | 1058 | name = "ra_hir" |
1015 | version = "0.1.0" | 1059 | version = "0.1.0" |
1016 | dependencies = [ | 1060 | dependencies = [ |
1017 | "arrayvec", | 1061 | "arrayvec", |
1062 | "base_db", | ||
1018 | "either", | 1063 | "either", |
1064 | "hir_def", | ||
1065 | "hir_expand", | ||
1019 | "itertools", | 1066 | "itertools", |
1020 | "log", | 1067 | "log", |
1021 | "profile", | 1068 | "profile", |
1022 | "ra_db", | ||
1023 | "ra_hir_def", | ||
1024 | "ra_hir_expand", | ||
1025 | "ra_hir_ty", | 1069 | "ra_hir_ty", |
1026 | "rustc-hash", | 1070 | "rustc-hash", |
1027 | "stdx", | 1071 | "stdx", |
@@ -1029,66 +1073,22 @@ dependencies = [ | |||
1029 | ] | 1073 | ] |
1030 | 1074 | ||
1031 | [[package]] | 1075 | [[package]] |
1032 | name = "ra_hir_def" | ||
1033 | version = "0.1.0" | ||
1034 | dependencies = [ | ||
1035 | "anymap", | ||
1036 | "arena", | ||
1037 | "cfg", | ||
1038 | "drop_bomb", | ||
1039 | "either", | ||
1040 | "expect", | ||
1041 | "fst", | ||
1042 | "indexmap", | ||
1043 | "itertools", | ||
1044 | "log", | ||
1045 | "mbe", | ||
1046 | "once_cell", | ||
1047 | "profile", | ||
1048 | "ra_db", | ||
1049 | "ra_hir_expand", | ||
1050 | "rustc-hash", | ||
1051 | "smallvec", | ||
1052 | "stdx", | ||
1053 | "syntax", | ||
1054 | "test_utils", | ||
1055 | "tt", | ||
1056 | ] | ||
1057 | |||
1058 | [[package]] | ||
1059 | name = "ra_hir_expand" | ||
1060 | version = "0.1.0" | ||
1061 | dependencies = [ | ||
1062 | "arena", | ||
1063 | "either", | ||
1064 | "log", | ||
1065 | "mbe", | ||
1066 | "parser", | ||
1067 | "profile", | ||
1068 | "ra_db", | ||
1069 | "rustc-hash", | ||
1070 | "syntax", | ||
1071 | "test_utils", | ||
1072 | "tt", | ||
1073 | ] | ||
1074 | |||
1075 | [[package]] | ||
1076 | name = "ra_hir_ty" | 1076 | name = "ra_hir_ty" |
1077 | version = "0.1.0" | 1077 | version = "0.1.0" |
1078 | dependencies = [ | 1078 | dependencies = [ |
1079 | "arena", | 1079 | "arena", |
1080 | "arrayvec", | 1080 | "arrayvec", |
1081 | "base_db", | ||
1081 | "chalk-ir", | 1082 | "chalk-ir", |
1082 | "chalk-recursive", | 1083 | "chalk-recursive", |
1083 | "chalk-solve", | 1084 | "chalk-solve", |
1084 | "ena", | 1085 | "ena", |
1085 | "expect", | 1086 | "expect", |
1087 | "hir_def", | ||
1088 | "hir_expand", | ||
1086 | "itertools", | 1089 | "itertools", |
1087 | "log", | 1090 | "log", |
1088 | "profile", | 1091 | "profile", |
1089 | "ra_db", | ||
1090 | "ra_hir_def", | ||
1091 | "ra_hir_expand", | ||
1092 | "rustc-hash", | 1092 | "rustc-hash", |
1093 | "scoped-tls", | 1093 | "scoped-tls", |
1094 | "smallvec", | 1094 | "smallvec", |
@@ -1104,6 +1104,7 @@ dependencies = [ | |||
1104 | name = "ra_ide" | 1104 | name = "ra_ide" |
1105 | version = "0.1.0" | 1105 | version = "0.1.0" |
1106 | dependencies = [ | 1106 | dependencies = [ |
1107 | "base_db", | ||
1107 | "cfg", | 1108 | "cfg", |
1108 | "either", | 1109 | "either", |
1109 | "expect", | 1110 | "expect", |
@@ -1113,7 +1114,6 @@ dependencies = [ | |||
1113 | "oorandom", | 1114 | "oorandom", |
1114 | "profile", | 1115 | "profile", |
1115 | "ra_assists", | 1116 | "ra_assists", |
1116 | "ra_db", | ||
1117 | "ra_hir", | 1117 | "ra_hir", |
1118 | "ra_ide_db", | 1118 | "ra_ide_db", |
1119 | "ra_ssr", | 1119 | "ra_ssr", |
@@ -1128,12 +1128,12 @@ dependencies = [ | |||
1128 | name = "ra_ide_db" | 1128 | name = "ra_ide_db" |
1129 | version = "0.1.0" | 1129 | version = "0.1.0" |
1130 | dependencies = [ | 1130 | dependencies = [ |
1131 | "base_db", | ||
1131 | "either", | 1132 | "either", |
1132 | "fst", | 1133 | "fst", |
1133 | "log", | 1134 | "log", |
1134 | "once_cell", | 1135 | "once_cell", |
1135 | "profile", | 1136 | "profile", |
1136 | "ra_db", | ||
1137 | "ra_hir", | 1137 | "ra_hir", |
1138 | "rayon", | 1138 | "rayon", |
1139 | "rustc-hash", | 1139 | "rustc-hash", |
@@ -1147,8 +1147,8 @@ dependencies = [ | |||
1147 | name = "ra_ssr" | 1147 | name = "ra_ssr" |
1148 | version = "0.1.0" | 1148 | version = "0.1.0" |
1149 | dependencies = [ | 1149 | dependencies = [ |
1150 | "base_db", | ||
1150 | "expect", | 1151 | "expect", |
1151 | "ra_db", | ||
1152 | "ra_hir", | 1152 | "ra_hir", |
1153 | "ra_ide_db", | 1153 | "ra_ide_db", |
1154 | "rustc-hash", | 1154 | "rustc-hash", |
@@ -1230,11 +1230,13 @@ name = "rust-analyzer" | |||
1230 | version = "0.1.0" | 1230 | version = "0.1.0" |
1231 | dependencies = [ | 1231 | dependencies = [ |
1232 | "anyhow", | 1232 | "anyhow", |
1233 | "base_db", | ||
1233 | "cfg", | 1234 | "cfg", |
1234 | "crossbeam-channel", | 1235 | "crossbeam-channel", |
1235 | "env_logger", | 1236 | "env_logger", |
1236 | "expect", | 1237 | "expect", |
1237 | "flycheck", | 1238 | "flycheck", |
1239 | "hir_def", | ||
1238 | "itertools", | 1240 | "itertools", |
1239 | "jod-thread", | 1241 | "jod-thread", |
1240 | "log", | 1242 | "log", |
@@ -1248,9 +1250,7 @@ dependencies = [ | |||
1248 | "proc_macro_srv", | 1250 | "proc_macro_srv", |
1249 | "profile", | 1251 | "profile", |
1250 | "project_model", | 1252 | "project_model", |
1251 | "ra_db", | ||
1252 | "ra_hir", | 1253 | "ra_hir", |
1253 | "ra_hir_def", | ||
1254 | "ra_hir_ty", | 1254 | "ra_hir_ty", |
1255 | "ra_ide", | 1255 | "ra_ide", |
1256 | "ra_ide_db", | 1256 | "ra_ide_db", |
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/ra_hir_def/Cargo.toml b/crates/hir_def/Cargo.toml index e7d3c4d5b..403bc2aff 100644 --- a/crates/ra_hir_def/Cargo.toml +++ b/crates/hir_def/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | name = "hir_def" |
3 | name = "ra_hir_def" | 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 |
@@ -21,12 +21,11 @@ indexmap = "1.4.0" | |||
21 | smallvec = "1.4.0" | 21 | smallvec = "1.4.0" |
22 | 22 | ||
23 | stdx = { path = "../stdx" } | 23 | stdx = { path = "../stdx" } |
24 | |||
25 | arena = { path = "../arena" } | 24 | arena = { path = "../arena" } |
26 | ra_db = { path = "../ra_db" } | 25 | base_db = { path = "../base_db" } |
27 | syntax = { path = "../syntax" } | 26 | syntax = { path = "../syntax" } |
28 | profile = { path = "../profile" } | 27 | profile = { path = "../profile" } |
29 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } | 28 | hir_expand = { path = "../hir_expand" } |
30 | test_utils = { path = "../test_utils" } | 29 | test_utils = { path = "../test_utils" } |
31 | mbe = { path = "../mbe" } | 30 | mbe = { path = "../mbe" } |
32 | cfg = { path = "../cfg" } | 31 | cfg = { path = "../cfg" } |
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/hir_def/src/adt.rs index d69ff2fc7..d69ff2fc7 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/hir_def/src/adt.rs | |||
diff --git a/crates/ra_hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index dea552a60..dea552a60 100644 --- a/crates/ra_hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs | |||
diff --git a/crates/ra_hir_def/src/body.rs b/crates/hir_def/src/body.rs index fe659386a..9a9a605dd 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/hir_def/src/body.rs | |||
@@ -6,11 +6,11 @@ pub mod scope; | |||
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/lower.rs b/crates/hir_def/src/body/lower.rs index a26251cde..a26251cde 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs | |||
diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs index 079f14c29..9142bc05b 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/hir_def/src/body/scope.rs | |||
@@ -169,8 +169,8 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope | |||
169 | 169 | ||
170 | #[cfg(test)] | 170 | #[cfg(test)] |
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/builtin_type.rs b/crates/hir_def/src/builtin_type.rs index 0f872b5c0..0f872b5c0 100644 --- a/crates/ra_hir_def/src/builtin_type.rs +++ b/crates/hir_def/src/builtin_type.rs | |||
diff --git a/crates/ra_hir_def/src/child_by_source.rs b/crates/hir_def/src/child_by_source.rs index dcb00a1d9..dcb00a1d9 100644 --- a/crates/ra_hir_def/src/child_by_source.rs +++ b/crates/hir_def/src/child_by_source.rs | |||
diff --git a/crates/ra_hir_def/src/data.rs b/crates/hir_def/src/data.rs index 9a8eb4ede..9a8eb4ede 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/hir_def/src/data.rs | |||
diff --git a/crates/ra_hir_def/src/db.rs b/crates/hir_def/src/db.rs index a925548b5..6d694de11 100644 --- a/crates/ra_hir_def/src/db.rs +++ b/crates/hir_def/src/db.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | //! Defines database & queries for name resolution. | 1 | //! Defines database & queries for name resolution. |
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/diagnostics.rs b/crates/hir_def/src/diagnostics.rs index 2e38a978f..2e38a978f 100644 --- a/crates/ra_hir_def/src/diagnostics.rs +++ b/crates/hir_def/src/diagnostics.rs | |||
diff --git a/crates/ra_hir_def/src/docs.rs b/crates/hir_def/src/docs.rs index e9a02b11b..e9a02b11b 100644 --- a/crates/ra_hir_def/src/docs.rs +++ b/crates/hir_def/src/docs.rs | |||
diff --git a/crates/ra_hir_def/src/dyn_map.rs b/crates/hir_def/src/dyn_map.rs index 6f269d7b0..6f269d7b0 100644 --- a/crates/ra_hir_def/src/dyn_map.rs +++ b/crates/hir_def/src/dyn_map.rs | |||
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/hir_def/src/expr.rs index c94b3a36f..c94b3a36f 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/hir_def/src/expr.rs | |||
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/hir_def/src/find_path.rs index 5099f417d..ac2c54ac5 100644 --- a/crates/ra_hir_def/src/find_path.rs +++ b/crates/hir_def/src/find_path.rs | |||
@@ -292,8 +292,8 @@ fn find_local_import_locations( | |||
292 | 292 | ||
293 | #[cfg(test)] | 293 | #[cfg(test)] |
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/hir_def/src/generics.rs index 4476f0316..835fe3fbd 100644 --- a/crates/ra_hir_def/src/generics.rs +++ b/crates/hir_def/src/generics.rs | |||
@@ -5,12 +5,12 @@ | |||
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/hir_def/src/import_map.rs index 431ff30ab..d32a0bdaf 100644 --- a/crates/ra_hir_def/src/import_map.rs +++ b/crates/hir_def/src/import_map.rs | |||
@@ -2,9 +2,9 @@ | |||
2 | 2 | ||
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/hir_def/src/item_scope.rs index 8fee4b15e..f1e9dfd5b 100644 --- a/crates/ra_hir_def/src/item_scope.rs +++ b/crates/hir_def/src/item_scope.rs | |||
@@ -3,9 +3,9 @@ | |||
3 | 3 | ||
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.rs b/crates/hir_def/src/item_tree.rs index e14722cae..e14722cae 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/hir_def/src/item_tree.rs | |||
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs index 391ab5d39..391ab5d39 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/hir_def/src/item_tree/lower.rs | |||
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs index 6c843e339..9c5bf72bd 100644 --- a/crates/ra_hir_def/src/item_tree/tests.rs +++ b/crates/hir_def/src/item_tree/tests.rs | |||
@@ -1,6 +1,6 @@ | |||
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; |
@@ -246,13 +246,13 @@ fn smoke() { | |||
246 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] | 246 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] |
247 | Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(3), kind: Unit } | 247 | Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(3), kind: Unit } |
248 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] | 248 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] |
249 | Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<ra_hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(4), kind: Tuple } | 249 | Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(4), kind: Tuple } |
250 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] | 250 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] |
251 | Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(5), kind: Record } | 251 | Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<syntax::ast::generated::nodes::Struct>(5), kind: Record } |
252 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] | 252 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] |
253 | Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<syntax::ast::generated::nodes::Enum>(6) } | 253 | Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<syntax::ast::generated::nodes::Enum>(6) } |
254 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] | 254 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] |
255 | Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(3..4)), ast_id: FileAstId::<syntax::ast::generated::nodes::Union>(7) } | 255 | Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::<hir_def::item_tree::Field>(3..4)), ast_id: FileAstId::<syntax::ast::generated::nodes::Union>(7) } |
256 | "##]], | 256 | "##]], |
257 | ); | 257 | ); |
258 | } | 258 | } |
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/hir_def/src/keys.rs index 40a5d92b5..40a5d92b5 100644 --- a/crates/ra_hir_def/src/keys.rs +++ b/crates/hir_def/src/keys.rs | |||
diff --git a/crates/ra_hir_def/src/lang_item.rs b/crates/hir_def/src/lang_item.rs index 063eadccb..063eadccb 100644 --- a/crates/ra_hir_def/src/lang_item.rs +++ b/crates/hir_def/src/lang_item.rs | |||
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index 806ac731f..f24a1dd77 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs | |||
@@ -53,11 +53,11 @@ mod test_db; | |||
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/hir_def/src/nameres.rs index d26c837cc..bf302172d 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -57,8 +57,8 @@ mod tests; | |||
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/hir_def/src/nameres/collector.rs index 6a5891936..3e99c8773 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs | |||
@@ -3,6 +3,7 @@ | |||
3 | //! `DefCollector::collect` contains the fixed-point iteration loop which | 3 | //! `DefCollector::collect` contains the fixed-point iteration loop which |
4 | //! resolves imports and expands macros. | 4 | //! resolves imports and expands macros. |
5 | 5 | ||
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/hir_def/src/nameres/mod_resolution.rs index 316245d6b..e8389b484 100644 --- a/crates/ra_hir_def/src/nameres/mod_resolution.rs +++ b/crates/hir_def/src/nameres/mod_resolution.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! This module resolves `mod foo;` declaration to file. | 1 | //! This module resolves `mod foo;` declaration to file. |
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/hir_def/src/nameres/path_resolution.rs index dbfa7fccb..88e10574e 100644 --- a/crates/ra_hir_def/src/nameres/path_resolution.rs +++ b/crates/hir_def/src/nameres/path_resolution.rs | |||
@@ -12,8 +12,8 @@ | |||
12 | 12 | ||
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/hir_def/src/nameres/tests.rs index 839b1de57..b105d56b2 100644 --- a/crates/ra_hir_def/src/nameres/tests.rs +++ b/crates/hir_def/src/nameres/tests.rs | |||
@@ -6,8 +6,8 @@ mod primitives; | |||
6 | 6 | ||
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/globs.rs b/crates/hir_def/src/nameres/tests/globs.rs index 2ae836e3c..2ae836e3c 100644 --- a/crates/ra_hir_def/src/nameres/tests/globs.rs +++ b/crates/hir_def/src/nameres/tests/globs.rs | |||
diff --git a/crates/ra_hir_def/src/nameres/tests/incremental.rs b/crates/hir_def/src/nameres/tests/incremental.rs index 0c288a108..cfbc62cc4 100644 --- a/crates/ra_hir_def/src/nameres/tests/incremental.rs +++ b/crates/hir_def/src/nameres/tests/incremental.rs | |||
@@ -1,6 +1,6 @@ | |||
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/nameres/tests/macros.rs b/crates/hir_def/src/nameres/tests/macros.rs index e0fb8bdef..e0fb8bdef 100644 --- a/crates/ra_hir_def/src/nameres/tests/macros.rs +++ b/crates/hir_def/src/nameres/tests/macros.rs | |||
diff --git a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs b/crates/hir_def/src/nameres/tests/mod_resolution.rs index 1f619787e..1f619787e 100644 --- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs | |||
diff --git a/crates/ra_hir_def/src/nameres/tests/primitives.rs b/crates/hir_def/src/nameres/tests/primitives.rs index 215e8952d..215e8952d 100644 --- a/crates/ra_hir_def/src/nameres/tests/primitives.rs +++ b/crates/hir_def/src/nameres/tests/primitives.rs | |||
diff --git a/crates/ra_hir_def/src/path.rs b/crates/hir_def/src/path.rs index 88be07c8a..74d26f08b 100644 --- a/crates/ra_hir_def/src/path.rs +++ b/crates/hir_def/src/path.rs | |||
@@ -8,11 +8,11 @@ use std::{ | |||
8 | }; | 8 | }; |
9 | 9 | ||
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/path/lower.rs b/crates/hir_def/src/path/lower.rs index 07b9723ce..07b9723ce 100644 --- a/crates/ra_hir_def/src/path/lower.rs +++ b/crates/hir_def/src/path/lower.rs | |||
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/hir_def/src/path/lower/lower_use.rs index 53cecb05f..53cecb05f 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/hir_def/src/path/lower/lower_use.rs | |||
diff --git a/crates/ra_hir_def/src/per_ns.rs b/crates/hir_def/src/per_ns.rs index 74665c588..74665c588 100644 --- a/crates/ra_hir_def/src/per_ns.rs +++ b/crates/hir_def/src/per_ns.rs | |||
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs index 0bf51eb7b..f8cc5e075 100644 --- a/crates/ra_hir_def/src/resolver.rs +++ b/crates/hir_def/src/resolver.rs | |||
@@ -1,11 +1,11 @@ | |||
1 | //! Name resolution façade. | 1 | //! Name resolution façade. |
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/src.rs b/crates/hir_def/src/src.rs index 7a79b0314..7a79b0314 100644 --- a/crates/ra_hir_def/src/src.rs +++ b/crates/hir_def/src/src.rs | |||
diff --git a/crates/ra_hir_def/src/test_db.rs b/crates/hir_def/src/test_db.rs index 339f819b8..42a762936 100644 --- a/crates/ra_hir_def/src/test_db.rs +++ b/crates/hir_def/src/test_db.rs | |||
@@ -5,15 +5,15 @@ use std::{ | |||
5 | sync::{Arc, Mutex}, | 5 | sync::{Arc, Mutex}, |
6 | }; | 6 | }; |
7 | 7 | ||
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_def/src/trace.rs b/crates/hir_def/src/trace.rs index fd64e7018..fd64e7018 100644 --- a/crates/ra_hir_def/src/trace.rs +++ b/crates/hir_def/src/trace.rs | |||
diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/hir_def/src/type_ref.rs index 1a78c1444..1a78c1444 100644 --- a/crates/ra_hir_def/src/type_ref.rs +++ b/crates/hir_def/src/type_ref.rs | |||
diff --git a/crates/ra_hir_def/src/visibility.rs b/crates/hir_def/src/visibility.rs index e6e0853a3..e6e0853a3 100644 --- a/crates/ra_hir_def/src/visibility.rs +++ b/crates/hir_def/src/visibility.rs | |||
diff --git a/crates/ra_hir_expand/Cargo.toml b/crates/hir_expand/Cargo.toml index cbb0ac29b..1c4699291 100644 --- a/crates/ra_hir_expand/Cargo.toml +++ b/crates/hir_expand/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | name = "hir_expand" |
3 | name = "ra_hir_expand" | 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 |
@@ -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/ast_id_map.rs b/crates/hir_expand/src/ast_id_map.rs index f63629b30..f63629b30 100644 --- a/crates/ra_hir_expand/src/ast_id_map.rs +++ b/crates/hir_expand/src/ast_id_map.rs | |||
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/hir_expand/src/builtin_derive.rs index 2d2f8bcb8..988a60d56 100644 --- a/crates/ra_hir_expand/src/builtin_derive.rs +++ b/crates/hir_expand/src/builtin_derive.rs | |||
@@ -253,8 +253,8 @@ fn partial_ord_expand( | |||
253 | 253 | ||
254 | #[cfg(test)] | 254 | #[cfg(test)] |
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/hir_expand/src/builtin_macro.rs index ae4c84382..86918b626 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/hir_expand/src/builtin_macro.rs | |||
@@ -4,10 +4,10 @@ use crate::{ | |||
4 | MacroDefId, MacroDefKind, TextSize, | 4 | MacroDefId, MacroDefKind, TextSize, |
5 | }; | 5 | }; |
6 | 6 | ||
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/hir_expand/src/db.rs index c275f6b01..dcc038bcd 100644 --- a/crates/ra_hir_expand/src/db.rs +++ b/crates/hir_expand/src/db.rs | |||
@@ -2,9 +2,9 @@ | |||
2 | 2 | ||
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/diagnostics.rs b/crates/hir_expand/src/diagnostics.rs index 59d35debe..59d35debe 100644 --- a/crates/ra_hir_expand/src/diagnostics.rs +++ b/crates/hir_expand/src/diagnostics.rs | |||
diff --git a/crates/ra_hir_expand/src/eager.rs b/crates/hir_expand/src/eager.rs index bd3409f97..10c45646f 100644 --- a/crates/ra_hir_expand/src/eager.rs +++ b/crates/hir_expand/src/eager.rs | |||
@@ -25,8 +25,8 @@ use crate::{ | |||
25 | EagerCallLoc, EagerMacroId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, | 25 | EagerCallLoc, EagerMacroId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, |
26 | }; | 26 | }; |
27 | 27 | ||
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/hir_expand/src/hygiene.rs index 23b5eac27..845e9cbc1 100644 --- a/crates/ra_hir_expand/src/hygiene.rs +++ b/crates/hir_expand/src/hygiene.rs | |||
@@ -2,8 +2,8 @@ | |||
2 | //! | 2 | //! |
3 | //! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at | 3 | //! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at |
4 | //! this moment, this is horribly incomplete and handles only `$crate`. | 4 | //! this moment, this is horribly incomplete and handles only `$crate`. |
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/hir_expand/src/lib.rs index af0cc445f..2be15e841 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! `ra_hir_expand` deals with macro expansion. | 1 | //! `hir_expand` deals with macro expansion. |
2 | //! | 2 | //! |
3 | //! Specifically, it implements a concept of `MacroFile` -- a file whose syntax | 3 | //! Specifically, it implements a concept of `MacroFile` -- a file whose syntax |
4 | //! tree originates not from the text of some `FileId`, but from some macro | 4 | //! tree originates not from the text of some `FileId`, but from some macro |
@@ -18,7 +18,7 @@ pub mod eager; | |||
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/hir_expand/src/name.rs index 4dcaff088..49841c7a1 100644 --- a/crates/ra_hir_expand/src/name.rs +++ b/crates/hir_expand/src/name.rs | |||
@@ -115,7 +115,7 @@ impl AsName for ast::FieldKind { | |||
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
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/hir_expand/src/proc_macro.rs index 2c0ec41d2..80255ea32 100644 --- a/crates/ra_hir_expand/src/proc_macro.rs +++ b/crates/hir_expand/src/proc_macro.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! Proc Macro Expander stub | 1 | //! Proc Macro Expander stub |
2 | 2 | ||
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/quote.rs b/crates/hir_expand/src/quote.rs index 219bc2097..219bc2097 100644 --- a/crates/ra_hir_expand/src/quote.rs +++ b/crates/hir_expand/src/quote.rs | |||
diff --git a/crates/ra_hir_expand/src/test_db.rs b/crates/hir_expand/src/test_db.rs index 332fa556f..86a5d867e 100644 --- a/crates/ra_hir_expand/src/test_db.rs +++ b/crates/hir_expand/src/test_db.rs | |||
@@ -5,12 +5,12 @@ use std::{ | |||
5 | sync::{Arc, Mutex}, | 5 | sync::{Arc, Mutex}, |
6 | }; | 6 | }; |
7 | 7 | ||
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/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..edca5dc6f 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml | |||
@@ -18,8 +18,8 @@ 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 = "../hir_expand" } |
24 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } | 24 | hir_def = { path = "../hir_def" } |
25 | hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } | 25 | hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } |
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 98724c146..8ffb9e99b 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -2,6 +2,7 @@ | |||
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::{ |
@@ -815,7 +815,7 @@ pub struct MacroDef { | |||
815 | impl MacroDef { | 815 | impl MacroDef { |
816 | /// FIXME: right now, this just returns the root module of the crate that | 816 | /// FIXME: right now, this just returns the root module of the crate that |
817 | /// defines this macro. The reasons for this is that macros are expanded | 817 | /// defines this macro. The reasons for this is that macros are expanded |
818 | /// early, in `ra_hir_expand`, where modules simply do not exist yet. | 818 | /// early, in `hir_expand`, where modules simply do not exist yet. |
819 | pub fn module(self, db: &dyn HirDatabase) -> Option<Module> { | 819 | pub fn module(self, db: &dyn HirDatabase) -> Option<Module> { |
820 | let krate = self.id.krate?; | 820 | let krate = self.id.krate?; |
821 | let module_id = db.crate_def_map(krate).root; | 821 | let module_id = db.crate_def_map(krate).root; |
diff --git a/crates/ra_hir/src/from_id.rs b/crates/ra_hir/src/from_id.rs index 679ae8121..a53ac1e08 100644 --- a/crates/ra_hir/src/from_id.rs +++ b/crates/ra_hir/src/from_id.rs | |||
@@ -29,7 +29,7 @@ macro_rules! from_id { | |||
29 | } | 29 | } |
30 | 30 | ||
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_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml index 6156e4a85..d430b08ca 100644 --- a/crates/ra_hir_ty/Cargo.toml +++ b/crates/ra_hir_ty/Cargo.toml | |||
@@ -18,10 +18,10 @@ rustc-hash = "1.1.0" | |||
18 | 18 | ||
19 | stdx = { path = "../stdx" } | 19 | stdx = { path = "../stdx" } |
20 | 20 | ||
21 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } | 21 | hir_def = { path = "../hir_def" } |
22 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } | 22 | hir_expand = { path = "../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/tests/simple.rs b/crates/ra_hir_ty/src/tests/simple.rs index 5a7cf9455..59eb59d5f 100644 --- a/crates/ra_hir_ty/src/tests/simple.rs +++ b/crates/ra_hir_ty/src/tests/simple.rs | |||
@@ -1776,8 +1776,8 @@ fn main() { | |||
1776 | ); | 1776 | ); |
1777 | } | 1777 | } |
1778 | 1778 | ||
1779 | // This test is actually testing the shadowing behavior within ra_hir_def. It | 1779 | // This test is actually testing the shadowing behavior within hir_def. It |
1780 | // lives here because the testing infrastructure in ra_hir_def isn't currently | 1780 | // lives here because the testing infrastructure in hir_def isn't currently |
1781 | // capable of asserting the necessary conditions. | 1781 | // capable of asserting the necessary conditions. |
1782 | #[test] | 1782 | #[test] |
1783 | fn should_be_shadowing_imports() { | 1783 | fn should_be_shadowing_imports() { |
diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs index 2576a9dfc..255323717 100644 --- a/crates/ra_hir_ty/src/traits.rs +++ b/crates/ra_hir_ty/src/traits.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | //! Trait solving using Chalk. | 1 | //! Trait solving using Chalk. |
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..0dee719de 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -46,11 +46,11 @@ 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" } |
53 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } | 53 | hir_def = { path = "../hir_def" } |
54 | hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } | 54 | hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } |
55 | proc_macro_srv = { path = "../proc_macro_srv" } | 55 | proc_macro_srv = { path = "../proc_macro_srv" } |
56 | 56 | ||
diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs index bc5f77e1a..b20a1675e 100644 --- a/crates/rust-analyzer/src/cli/analysis_bench.rs +++ b/crates/rust-analyzer/src/cli/analysis_bench.rs | |||
@@ -3,7 +3,7 @@ | |||
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/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index 97f331352..6d5408156 100644 --- a/crates/rust-analyzer/src/diagnostics/to_proto.rs +++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs | |||
@@ -1116,7 +1116,7 @@ mod tests { | |||
1116 | fn macro_compiler_error() { | 1116 | fn macro_compiler_error() { |
1117 | check( | 1117 | check( |
1118 | r##"{ | 1118 | r##"{ |
1119 | "rendered": "error: Please register your known path in the path module\n --> crates/ra_hir_def/src/path.rs:265:9\n |\n265 | compile_error!(\"Please register your known path in the path module\")\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n | \n ::: crates/ra_hir_def/src/data.rs:80:16\n |\n80 | let path = path![std::future::Future];\n | -------------------------- in this macro invocation\n\n", | 1119 | "rendered": "error: Please register your known path in the path module\n --> crates/hir_def/src/path.rs:265:9\n |\n265 | compile_error!(\"Please register your known path in the path module\")\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n | \n ::: crates/hir_def/src/data.rs:80:16\n |\n80 | let path = path![std::future::Future];\n | -------------------------- in this macro invocation\n\n", |
1120 | "children": [], | 1120 | "children": [], |
1121 | "code": null, | 1121 | "code": null, |
1122 | "level": "error", | 1122 | "level": "error", |
@@ -1134,7 +1134,7 @@ mod tests { | |||
1134 | "column_end": 2, | 1134 | "column_end": 2, |
1135 | "column_start": 1, | 1135 | "column_start": 1, |
1136 | "expansion": null, | 1136 | "expansion": null, |
1137 | "file_name": "crates/ra_hir_def/src/path.rs", | 1137 | "file_name": "crates/hir_def/src/path.rs", |
1138 | "is_primary": false, | 1138 | "is_primary": false, |
1139 | "label": null, | 1139 | "label": null, |
1140 | "line_end": 267, | 1140 | "line_end": 267, |
@@ -1227,7 +1227,7 @@ mod tests { | |||
1227 | "column_end": 2, | 1227 | "column_end": 2, |
1228 | "column_start": 1, | 1228 | "column_start": 1, |
1229 | "expansion": null, | 1229 | "expansion": null, |
1230 | "file_name": "crates/ra_hir_def/src/path.rs", | 1230 | "file_name": "crates/hir_def/src/path.rs", |
1231 | "is_primary": false, | 1231 | "is_primary": false, |
1232 | "label": null, | 1232 | "label": null, |
1233 | "line_end": 277, | 1233 | "line_end": 277, |
@@ -1284,7 +1284,7 @@ mod tests { | |||
1284 | "column_end": 42, | 1284 | "column_end": 42, |
1285 | "column_start": 16, | 1285 | "column_start": 16, |
1286 | "expansion": null, | 1286 | "expansion": null, |
1287 | "file_name": "crates/ra_hir_def/src/data.rs", | 1287 | "file_name": "crates/hir_def/src/data.rs", |
1288 | "is_primary": false, | 1288 | "is_primary": false, |
1289 | "label": null, | 1289 | "label": null, |
1290 | "line_end": 80, | 1290 | "line_end": 80, |
@@ -1300,7 +1300,7 @@ mod tests { | |||
1300 | ] | 1300 | ] |
1301 | } | 1301 | } |
1302 | }, | 1302 | }, |
1303 | "file_name": "crates/ra_hir_def/src/path.rs", | 1303 | "file_name": "crates/hir_def/src/path.rs", |
1304 | "is_primary": false, | 1304 | "is_primary": false, |
1305 | "label": null, | 1305 | "label": null, |
1306 | "line_end": 272, | 1306 | "line_end": 272, |
@@ -1316,7 +1316,7 @@ mod tests { | |||
1316 | ] | 1316 | ] |
1317 | } | 1317 | } |
1318 | }, | 1318 | }, |
1319 | "file_name": "crates/ra_hir_def/src/path.rs", | 1319 | "file_name": "crates/hir_def/src/path.rs", |
1320 | "is_primary": true, | 1320 | "is_primary": true, |
1321 | "label": null, | 1321 | "label": null, |
1322 | "line_end": 265, | 1322 | "line_end": 265, |
diff --git a/crates/rust-analyzer/src/from_proto.rs b/crates/rust-analyzer/src/from_proto.rs index ad88ffdd7..945a353dd 100644 --- a/crates/rust-analyzer/src/from_proto.rs +++ b/crates/rust-analyzer/src/from_proto.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! Conversion lsp_types types to rust-analyzer specific ones. | 1 | //! Conversion lsp_types types to rust-analyzer specific ones. |
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, |
diff --git a/crates/rust-analyzer/test_data/macro_compiler_error.txt b/crates/rust-analyzer/test_data/macro_compiler_error.txt index f695db73c..89dae7d5a 100644 --- a/crates/rust-analyzer/test_data/macro_compiler_error.txt +++ b/crates/rust-analyzer/test_data/macro_compiler_error.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | [ | 1 | [ |
2 | MappedRustDiagnostic { | 2 | MappedRustDiagnostic { |
3 | url: "file:///test/crates/ra_hir_def/src/data.rs", | 3 | url: "file:///test/crates/hir_def/src/data.rs", |
4 | diagnostic: Diagnostic { | 4 | diagnostic: Diagnostic { |
5 | range: Range { | 5 | range: Range { |
6 | start: Position { | 6 | start: Position { |
@@ -24,7 +24,7 @@ | |||
24 | [ | 24 | [ |
25 | DiagnosticRelatedInformation { | 25 | DiagnosticRelatedInformation { |
26 | location: Location { | 26 | location: Location { |
27 | uri: "file:///test/crates/ra_hir_def/src/path.rs", | 27 | uri: "file:///test/crates/hir_def/src/path.rs", |
28 | range: Range { | 28 | range: Range { |
29 | start: Position { | 29 | start: Position { |
30 | line: 264, | 30 | line: 264, |
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 21373729c..746d41f83 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md | |||
@@ -92,14 +92,14 @@ in particular: it shows off various methods of working with syntax tree. | |||
92 | See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which | 92 | See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which |
93 | fixes a bug in the grammar. | 93 | fixes a bug in the grammar. |
94 | 94 | ||
95 | ### `crates/ra_db` | 95 | ### `crates/base_db` |
96 | 96 | ||
97 | We use the [salsa](https://github.com/salsa-rs/salsa) crate for incremental and | 97 | We use the [salsa](https://github.com/salsa-rs/salsa) crate for incremental and |
98 | on-demand computation. Roughly, you can think of salsa as a key-value store, but | 98 | on-demand computation. Roughly, you can think of salsa as a key-value store, but |
99 | it also can compute derived values using specified functions. The `ra_db` crate | 99 | it also can compute derived values using specified functions. The `base_db` crate |
100 | provides basic infrastructure for interacting with salsa. Crucially, it | 100 | provides basic infrastructure for interacting with salsa. Crucially, it |
101 | defines most of the "input" queries: facts supplied by the client of the | 101 | defines most of the "input" queries: facts supplied by the client of the |
102 | analyzer. Reading the docs of the `ra_db::input` module should be useful: | 102 | analyzer. Reading the docs of the `base_db::input` module should be useful: |
103 | everything else is strictly derived from those inputs. | 103 | everything else is strictly derived from those inputs. |
104 | 104 | ||
105 | ### `crates/ra_hir*` crates | 105 | ### `crates/ra_hir*` crates |
diff --git a/docs/dev/guide.md b/docs/dev/guide.md index c3252f1f6..d14143226 100644 --- a/docs/dev/guide.md +++ b/docs/dev/guide.md | |||
@@ -259,7 +259,7 @@ Salsa input queries are defined in [`FilesDatabase`] (which is a part of | |||
259 | `RootDatabase`). They closely mirror the familiar `AnalysisChange` structure: | 259 | `RootDatabase`). They closely mirror the familiar `AnalysisChange` structure: |
260 | indeed, what `apply_change` does is it sets the values of input queries. | 260 | indeed, what `apply_change` does is it sets the values of input queries. |
261 | 261 | ||
262 | [`FilesDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_db/src/input.rs#L150-L174 | 262 | [`FilesDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/base_db/src/input.rs#L150-L174 |
263 | 263 | ||
264 | ## From text to semantic model | 264 | ## From text to semantic model |
265 | 265 | ||
@@ -392,7 +392,7 @@ integers which can "intern" a location and return an integer ID back. The salsa | |||
392 | database we use includes a couple of [interners]. How to "garbage collect" | 392 | database we use includes a couple of [interners]. How to "garbage collect" |
393 | unused locations is an open question. | 393 | unused locations is an open question. |
394 | 394 | ||
395 | [`LocationInterner`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_db/src/loc2id.rs#L65-L71 | 395 | [`LocationInterner`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/base_db/src/loc2id.rs#L65-L71 |
396 | [interners]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/db.rs#L22-L23 | 396 | [interners]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/db.rs#L22-L23 |
397 | 397 | ||
398 | For example, we use `LocationInterner` to assign IDs to definitions of functions, | 398 | For example, we use `LocationInterner` to assign IDs to definitions of functions, |
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 904a9ee71..807ef587c 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs | |||
@@ -139,7 +139,7 @@ pub fn run_pre_cache() -> Result<()> { | |||
139 | } | 139 | } |
140 | 140 | ||
141 | fs2::remove_file("./target/.rustc_info.json")?; | 141 | fs2::remove_file("./target/.rustc_info.json")?; |
142 | let to_delete = ["ra_", "heavy_test", "xtask"]; | 142 | let to_delete = ["hir", "heavy_test", "xtask", "ide", "rust-analyzer"]; |
143 | for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() { | 143 | for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() { |
144 | for entry in Path::new(dir).read_dir()? { | 144 | for entry in Path::new(dir).read_dir()? { |
145 | let entry = entry?; | 145 | let entry = entry?; |
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 2e68e71db..dc367d1e0 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs | |||
@@ -193,7 +193,7 @@ impl TidyDocs { | |||
193 | 193 | ||
194 | let poorly_documented = [ | 194 | let poorly_documented = [ |
195 | "ra_hir", | 195 | "ra_hir", |
196 | "ra_hir_expand", | 196 | "hir_expand", |
197 | "ra_ide", | 197 | "ra_ide", |
198 | "mbe", | 198 | "mbe", |
199 | "parser", | 199 | "parser", |