diff options
-rw-r--r-- | Cargo.lock | 8 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | crates/ra_batch/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_batch/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_cli/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_cli/src/analysis_bench.rs | 2 | ||||
-rw-r--r-- | crates/ra_cli/src/main.rs | 2 | ||||
-rw-r--r-- | crates/ra_db/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 20 | ||||
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir/src/from_source.rs | 13 | ||||
-rw-r--r-- | crates/ra_hir_def/src/attr.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/body.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/docs.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/lang_item.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 15 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/path_resolution.rs | 16 | ||||
-rw-r--r-- | crates/ra_hir_def/src/resolver.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/test_db.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 10 | ||||
-rw-r--r-- | crates/ra_ide/Cargo.toml (renamed from crates/ra_ide_api/Cargo.toml) | 4 | ||||
-rw-r--r-- | crates/ra_ide/src/assists.rs (renamed from crates/ra_ide_api/src/assists.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/call_info.rs (renamed from crates/ra_ide_api/src/call_info.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/change.rs (renamed from crates/ra_ide_api/src/change.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion.rs (renamed from crates/ra_ide_api/src/completion.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_dot.rs (renamed from crates/ra_ide_api/src/completion/complete_dot.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_fn_param.rs (renamed from crates/ra_ide_api/src/completion/complete_fn_param.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_keyword.rs (renamed from crates/ra_ide_api/src/completion/complete_keyword.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_macro_in_item_position.rs (renamed from crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_path.rs (renamed from crates/ra_ide_api/src/completion/complete_path.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_pattern.rs (renamed from crates/ra_ide_api/src/completion/complete_pattern.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_postfix.rs (renamed from crates/ra_ide_api/src/completion/complete_postfix.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_record_literal.rs (renamed from crates/ra_ide_api/src/completion/complete_record_literal.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_record_pattern.rs (renamed from crates/ra_ide_api/src/completion/complete_record_pattern.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_scope.rs (renamed from crates/ra_ide_api/src/completion/complete_scope.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_snippet.rs (renamed from crates/ra_ide_api/src/completion/complete_snippet.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs (renamed from crates/ra_ide_api/src/completion/completion_context.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/completion_item.rs (renamed from crates/ra_ide_api/src/completion/completion_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/presentation.rs (renamed from crates/ra_ide_api/src/completion/presentation.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/db.rs (renamed from crates/ra_ide_api/src/db.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/diagnostics.rs (renamed from crates/ra_ide_api/src/diagnostics.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/display.rs (renamed from crates/ra_ide_api/src/display.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/display/function_signature.rs (renamed from crates/ra_ide_api/src/display/function_signature.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/display/navigation_target.rs (renamed from crates/ra_ide_api/src/display/navigation_target.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/display/short_label.rs (renamed from crates/ra_ide_api/src/display/short_label.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/display/structure.rs (renamed from crates/ra_ide_api/src/display/structure.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/expand.rs (renamed from crates/ra_ide_api/src/expand.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/expand_macro.rs (renamed from crates/ra_ide_api/src/expand_macro.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/extend_selection.rs (renamed from crates/ra_ide_api/src/extend_selection.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/feature_flags.rs (renamed from crates/ra_ide_api/src/feature_flags.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/folding_ranges.rs (renamed from crates/ra_ide_api/src/folding_ranges.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/goto_definition.rs (renamed from crates/ra_ide_api/src/goto_definition.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/goto_type_definition.rs (renamed from crates/ra_ide_api/src/goto_type_definition.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/hover.rs (renamed from crates/ra_ide_api/src/hover.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/impls.rs (renamed from crates/ra_ide_api/src/impls.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/inlay_hints.rs (renamed from crates/ra_ide_api/src/inlay_hints.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/join_lines.rs (renamed from crates/ra_ide_api/src/join_lines.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/lib.rs (renamed from crates/ra_ide_api/src/lib.rs) | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/line_index.rs (renamed from crates/ra_ide_api/src/line_index.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/line_index_utils.rs (renamed from crates/ra_ide_api/src/line_index_utils.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/marks.rs (renamed from crates/ra_ide_api/src/marks.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/matching_brace.rs (renamed from crates/ra_ide_api/src/matching_brace.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/mock_analysis.rs (renamed from crates/ra_ide_api/src/mock_analysis.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/parent_module.rs (renamed from crates/ra_ide_api/src/parent_module.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/references.rs (renamed from crates/ra_ide_api/src/references.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/references/classify.rs (renamed from crates/ra_ide_api/src/references/classify.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/references/name_definition.rs (renamed from crates/ra_ide_api/src/references/name_definition.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/references/rename.rs (renamed from crates/ra_ide_api/src/references/rename.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/references/search_scope.rs (renamed from crates/ra_ide_api/src/references/search_scope.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/runnables.rs (renamed from crates/ra_ide_api/src/runnables.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/snapshots/highlighting.html (renamed from crates/ra_ide_api/src/snapshots/highlighting.html) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/snapshots/rainbow_highlighting.html (renamed from crates/ra_ide_api/src/snapshots/rainbow_highlighting.html) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/source_change.rs (renamed from crates/ra_ide_api/src/source_change.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/status.rs (renamed from crates/ra_ide_api/src/status.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/symbol_index.rs (renamed from crates/ra_ide_api/src/symbol_index.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs (renamed from crates/ra_ide_api/src/syntax_highlighting.rs) | 5 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_tree.rs (renamed from crates/ra_ide_api/src/syntax_tree.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/test_utils.rs (renamed from crates/ra_ide_api/src/test_utils.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/typing.rs (renamed from crates/ra_ide_api/src/typing.rs) | 0 | ||||
-rw-r--r-- | crates/ra_ide/src/wasm_shims.rs (renamed from crates/ra_ide_api/src/wasm_shims.rs) | 0 | ||||
-rw-r--r-- | crates/ra_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/cargo_target_spec.rs | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 6 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 6 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/subscriptions.rs | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/world.rs | 2 | ||||
-rw-r--r-- | docs/dev/README.md | 2 | ||||
-rw-r--r-- | docs/dev/architecture.md | 12 | ||||
-rw-r--r-- | docs/dev/guide.md | 24 | ||||
-rw-r--r--[-rwxr-xr-x] | editors/code/src/utils/terminateProcess.sh | 0 | ||||
-rw-r--r-- | xtask/tests/tidy-tests/docs.rs | 2 |
94 files changed, 97 insertions, 100 deletions
diff --git a/Cargo.lock b/Cargo.lock index 0f7a45d6c..b0a0e841c 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -906,7 +906,7 @@ dependencies = [ | |||
906 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 906 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
907 | "ra_db 0.1.0", | 907 | "ra_db 0.1.0", |
908 | "ra_hir 0.1.0", | 908 | "ra_hir 0.1.0", |
909 | "ra_ide_api 0.1.0", | 909 | "ra_ide 0.1.0", |
910 | "ra_project_model 0.1.0", | 910 | "ra_project_model 0.1.0", |
911 | "ra_vfs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | 911 | "ra_vfs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", |
912 | "ra_vfs_glob 0.1.0", | 912 | "ra_vfs_glob 0.1.0", |
@@ -932,7 +932,7 @@ dependencies = [ | |||
932 | "ra_batch 0.1.0", | 932 | "ra_batch 0.1.0", |
933 | "ra_db 0.1.0", | 933 | "ra_db 0.1.0", |
934 | "ra_hir 0.1.0", | 934 | "ra_hir 0.1.0", |
935 | "ra_ide_api 0.1.0", | 935 | "ra_ide 0.1.0", |
936 | "ra_prof 0.1.0", | 936 | "ra_prof 0.1.0", |
937 | "ra_syntax 0.1.0", | 937 | "ra_syntax 0.1.0", |
938 | ] | 938 | ] |
@@ -1027,7 +1027,7 @@ dependencies = [ | |||
1027 | ] | 1027 | ] |
1028 | 1028 | ||
1029 | [[package]] | 1029 | [[package]] |
1030 | name = "ra_ide_api" | 1030 | name = "ra_ide" |
1031 | version = "0.1.0" | 1031 | version = "0.1.0" |
1032 | dependencies = [ | 1032 | dependencies = [ |
1033 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1033 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1065,7 +1065,7 @@ dependencies = [ | |||
1065 | "lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1065 | "lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1066 | "lsp-types 0.61.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1066 | "lsp-types 0.61.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1067 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1067 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1068 | "ra_ide_api 0.1.0", | 1068 | "ra_ide 0.1.0", |
1069 | "ra_prof 0.1.0", | 1069 | "ra_prof 0.1.0", |
1070 | "ra_project_model 0.1.0", | 1070 | "ra_project_model 0.1.0", |
1071 | "ra_syntax 0.1.0", | 1071 | "ra_syntax 0.1.0", |
@@ -56,7 +56,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0 | |||
56 | 56 | ||
57 | ## Quick Links | 57 | ## Quick Links |
58 | 58 | ||
59 | * API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/ | 59 | * API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide/ |
60 | 60 | ||
61 | 61 | ||
62 | ## License | 62 | ## License |
diff --git a/crates/ra_batch/Cargo.toml b/crates/ra_batch/Cargo.toml index 35626d77d..3bf351fe3 100644 --- a/crates/ra_batch/Cargo.toml +++ b/crates/ra_batch/Cargo.toml | |||
@@ -15,6 +15,6 @@ crossbeam-channel = "0.4.0" | |||
15 | ra_vfs = "0.5.0" | 15 | ra_vfs = "0.5.0" |
16 | ra_vfs_glob = { path = "../ra_vfs_glob" } | 16 | ra_vfs_glob = { path = "../ra_vfs_glob" } |
17 | ra_db = { path = "../ra_db" } | 17 | ra_db = { path = "../ra_db" } |
18 | ra_ide_api = { path = "../ra_ide_api" } | 18 | ra_ide = { path = "../ra_ide" } |
19 | ra_hir = { path = "../ra_hir" } | 19 | ra_hir = { path = "../ra_hir" } |
20 | ra_project_model = { path = "../ra_project_model" } | 20 | ra_project_model = { path = "../ra_project_model" } |
diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index cb389eb26..2c9645c00 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs | |||
@@ -6,7 +6,7 @@ use rustc_hash::FxHashMap; | |||
6 | 6 | ||
7 | use crossbeam_channel::{unbounded, Receiver}; | 7 | use crossbeam_channel::{unbounded, Receiver}; |
8 | use ra_db::{CrateGraph, FileId, SourceRootId}; | 8 | use ra_db::{CrateGraph, FileId, SourceRootId}; |
9 | use ra_ide_api::{AnalysisChange, AnalysisHost, FeatureFlags}; | 9 | use ra_ide::{AnalysisChange, AnalysisHost, FeatureFlags}; |
10 | use ra_project_model::{get_rustc_cfg_options, PackageRoot, ProjectWorkspace}; | 10 | use ra_project_model::{get_rustc_cfg_options, PackageRoot, ProjectWorkspace}; |
11 | use ra_vfs::{RootEntry, Vfs, VfsChange, VfsTask, Watch}; | 11 | use ra_vfs::{RootEntry, Vfs, VfsChange, VfsTask, Watch}; |
12 | use ra_vfs_glob::RustPackageFilterBuilder; | 12 | use ra_vfs_glob::RustPackageFilterBuilder; |
diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml index 3bb475997..c7e0d0f0f 100644 --- a/crates/ra_cli/Cargo.toml +++ b/crates/ra_cli/Cargo.toml | |||
@@ -10,7 +10,7 @@ pico-args = "0.3.0" | |||
10 | flexi_logger = "0.14.0" | 10 | flexi_logger = "0.14.0" |
11 | 11 | ||
12 | ra_syntax = { path = "../ra_syntax" } | 12 | ra_syntax = { path = "../ra_syntax" } |
13 | ra_ide_api = { path = "../ra_ide_api" } | 13 | ra_ide = { path = "../ra_ide" } |
14 | ra_batch = { path = "../ra_batch" } | 14 | ra_batch = { path = "../ra_batch" } |
15 | ra_hir = { path = "../ra_hir" } | 15 | ra_hir = { path = "../ra_hir" } |
16 | ra_db = { path = "../ra_db" } | 16 | ra_db = { path = "../ra_db" } |
diff --git a/crates/ra_cli/src/analysis_bench.rs b/crates/ra_cli/src/analysis_bench.rs index 34105af57..5485a38ff 100644 --- a/crates/ra_cli/src/analysis_bench.rs +++ b/crates/ra_cli/src/analysis_bench.rs | |||
@@ -10,7 +10,7 @@ use ra_db::{ | |||
10 | salsa::{Database, Durability}, | 10 | salsa::{Database, Durability}, |
11 | FileId, SourceDatabaseExt, | 11 | FileId, SourceDatabaseExt, |
12 | }; | 12 | }; |
13 | use ra_ide_api::{Analysis, AnalysisChange, AnalysisHost, FilePosition, LineCol}; | 13 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FilePosition, LineCol}; |
14 | 14 | ||
15 | use crate::Result; | 15 | use crate::Result; |
16 | 16 | ||
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 08f353147..fe847e611 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs | |||
@@ -9,7 +9,7 @@ use std::{error::Error, fmt::Write, io::Read}; | |||
9 | 9 | ||
10 | use flexi_logger::Logger; | 10 | use flexi_logger::Logger; |
11 | use pico_args::Arguments; | 11 | use pico_args::Arguments; |
12 | use ra_ide_api::{file_structure, Analysis}; | 12 | use ra_ide::{file_structure, Analysis}; |
13 | use ra_prof::profile; | 13 | use ra_prof::profile; |
14 | use ra_syntax::{AstNode, SourceFile}; | 14 | use ra_syntax::{AstNode, SourceFile}; |
15 | 15 | ||
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index e8852531b..21341b769 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! ra_db defines basic database traits. The concrete DB is defined by ra_ide_api. | 1 | //! ra_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/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 87c78d98e..5a3e24e9e 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -174,15 +174,15 @@ pub use hir_def::attr::Attrs; | |||
174 | 174 | ||
175 | impl Module { | 175 | impl Module { |
176 | pub(crate) fn new(krate: Crate, crate_module_id: LocalModuleId) -> Module { | 176 | pub(crate) fn new(krate: Crate, crate_module_id: LocalModuleId) -> Module { |
177 | Module { id: ModuleId { krate: krate.crate_id, module_id: crate_module_id } } | 177 | Module { id: ModuleId { krate: krate.crate_id, local_id: crate_module_id } } |
178 | } | 178 | } |
179 | 179 | ||
180 | /// Name of this module. | 180 | /// Name of this module. |
181 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { | 181 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { |
182 | let def_map = db.crate_def_map(self.id.krate); | 182 | let def_map = db.crate_def_map(self.id.krate); |
183 | let parent = def_map[self.id.module_id].parent?; | 183 | let parent = def_map[self.id.local_id].parent?; |
184 | def_map[parent].children.iter().find_map(|(name, module_id)| { | 184 | def_map[parent].children.iter().find_map(|(name, module_id)| { |
185 | if *module_id == self.id.module_id { | 185 | if *module_id == self.id.local_id { |
186 | Some(name.clone()) | 186 | Some(name.clone()) |
187 | } else { | 187 | } else { |
188 | None | 188 | None |
@@ -206,14 +206,14 @@ impl Module { | |||
206 | /// Finds a child module with the specified name. | 206 | /// Finds a child module with the specified name. |
207 | pub fn child(self, db: &impl DefDatabase, name: &Name) -> Option<Module> { | 207 | pub fn child(self, db: &impl DefDatabase, name: &Name) -> Option<Module> { |
208 | let def_map = db.crate_def_map(self.id.krate); | 208 | let def_map = db.crate_def_map(self.id.krate); |
209 | let child_id = def_map[self.id.module_id].children.get(name)?; | 209 | let child_id = def_map[self.id.local_id].children.get(name)?; |
210 | Some(self.with_module_id(*child_id)) | 210 | Some(self.with_module_id(*child_id)) |
211 | } | 211 | } |
212 | 212 | ||
213 | /// Iterates over all child modules. | 213 | /// Iterates over all child modules. |
214 | pub fn children(self, db: &impl DefDatabase) -> impl Iterator<Item = Module> { | 214 | pub fn children(self, db: &impl DefDatabase) -> impl Iterator<Item = Module> { |
215 | let def_map = db.crate_def_map(self.id.krate); | 215 | let def_map = db.crate_def_map(self.id.krate); |
216 | let children = def_map[self.id.module_id] | 216 | let children = def_map[self.id.local_id] |
217 | .children | 217 | .children |
218 | .iter() | 218 | .iter() |
219 | .map(|(_, module_id)| self.with_module_id(*module_id)) | 219 | .map(|(_, module_id)| self.with_module_id(*module_id)) |
@@ -224,7 +224,7 @@ impl Module { | |||
224 | /// Finds a parent module. | 224 | /// Finds a parent module. |
225 | pub fn parent(self, db: &impl DefDatabase) -> Option<Module> { | 225 | pub fn parent(self, db: &impl DefDatabase) -> Option<Module> { |
226 | let def_map = db.crate_def_map(self.id.krate); | 226 | let def_map = db.crate_def_map(self.id.krate); |
227 | let parent_id = def_map[self.id.module_id].parent?; | 227 | let parent_id = def_map[self.id.local_id].parent?; |
228 | Some(self.with_module_id(parent_id)) | 228 | Some(self.with_module_id(parent_id)) |
229 | } | 229 | } |
230 | 230 | ||
@@ -240,7 +240,7 @@ impl Module { | |||
240 | 240 | ||
241 | /// Returns a `ModuleScope`: a set of items, visible in this module. | 241 | /// Returns a `ModuleScope`: a set of items, visible in this module. |
242 | pub fn scope(self, db: &impl HirDatabase) -> Vec<(Name, ScopeDef, Option<Import>)> { | 242 | pub fn scope(self, db: &impl HirDatabase) -> Vec<(Name, ScopeDef, Option<Import>)> { |
243 | db.crate_def_map(self.id.krate)[self.id.module_id] | 243 | db.crate_def_map(self.id.krate)[self.id.local_id] |
244 | .scope | 244 | .scope |
245 | .entries() | 245 | .entries() |
246 | .map(|(name, res)| { | 246 | .map(|(name, res)| { |
@@ -250,7 +250,7 @@ impl Module { | |||
250 | } | 250 | } |
251 | 251 | ||
252 | pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) { | 252 | pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) { |
253 | db.crate_def_map(self.id.krate).add_diagnostics(db, self.id.module_id, sink); | 253 | db.crate_def_map(self.id.krate).add_diagnostics(db, self.id.local_id, sink); |
254 | for decl in self.declarations(db) { | 254 | for decl in self.declarations(db) { |
255 | match decl { | 255 | match decl { |
256 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), | 256 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), |
@@ -275,12 +275,12 @@ impl Module { | |||
275 | 275 | ||
276 | pub fn declarations(self, db: &impl DefDatabase) -> Vec<ModuleDef> { | 276 | pub fn declarations(self, db: &impl DefDatabase) -> Vec<ModuleDef> { |
277 | let def_map = db.crate_def_map(self.id.krate); | 277 | let def_map = db.crate_def_map(self.id.krate); |
278 | def_map[self.id.module_id].scope.declarations().map(ModuleDef::from).collect() | 278 | def_map[self.id.local_id].scope.declarations().map(ModuleDef::from).collect() |
279 | } | 279 | } |
280 | 280 | ||
281 | pub fn impl_blocks(self, db: &impl DefDatabase) -> Vec<ImplBlock> { | 281 | pub fn impl_blocks(self, db: &impl DefDatabase) -> Vec<ImplBlock> { |
282 | let def_map = db.crate_def_map(self.id.krate); | 282 | let def_map = db.crate_def_map(self.id.krate); |
283 | def_map[self.id.module_id].impls.iter().copied().map(ImplBlock::from).collect() | 283 | def_map[self.id.local_id].impls.iter().copied().map(ImplBlock::from).collect() |
284 | } | 284 | } |
285 | 285 | ||
286 | fn with_module_id(self, module_id: LocalModuleId) -> Module { | 286 | fn with_module_id(self, module_id: LocalModuleId) -> Module { |
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index 076d86f2b..bf3ee0834 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -22,7 +22,7 @@ impl Module { | |||
22 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. | 22 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. |
23 | pub fn definition_source(self, db: &impl DefDatabase) -> Source<ModuleSource> { | 23 | pub fn definition_source(self, db: &impl DefDatabase) -> Source<ModuleSource> { |
24 | let def_map = db.crate_def_map(self.id.krate); | 24 | let def_map = db.crate_def_map(self.id.krate); |
25 | let src = def_map[self.id.module_id].definition_source(db); | 25 | let src = def_map[self.id.local_id].definition_source(db); |
26 | src.map(|it| match it { | 26 | src.map(|it| match it { |
27 | Either::A(it) => ModuleSource::SourceFile(it), | 27 | Either::A(it) => ModuleSource::SourceFile(it), |
28 | Either::B(it) => ModuleSource::Module(it), | 28 | Either::B(it) => ModuleSource::Module(it), |
@@ -33,7 +33,7 @@ impl Module { | |||
33 | /// `None` for the crate root. | 33 | /// `None` for the crate root. |
34 | pub fn declaration_source(self, db: &impl DefDatabase) -> Option<Source<ast::Module>> { | 34 | pub fn declaration_source(self, db: &impl DefDatabase) -> Option<Source<ast::Module>> { |
35 | let def_map = db.crate_def_map(self.id.krate); | 35 | let def_map = db.crate_def_map(self.id.krate); |
36 | def_map[self.id.module_id].declaration_source(db) | 36 | def_map[self.id.local_id].declaration_source(db) |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index 95db7161b..9f7c22b21 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs | |||
@@ -262,13 +262,12 @@ impl Module { | |||
262 | 262 | ||
263 | let original_file = src.file_id.original_file(db); | 263 | let original_file = src.file_id.original_file(db); |
264 | 264 | ||
265 | let (krate, module_id) = | 265 | let (krate, local_id) = db.relevant_crates(original_file).iter().find_map(|&crate_id| { |
266 | db.relevant_crates(original_file).iter().find_map(|&crate_id| { | 266 | let crate_def_map = db.crate_def_map(crate_id); |
267 | let crate_def_map = db.crate_def_map(crate_id); | 267 | let local_id = crate_def_map.modules_for_file(original_file).next()?; |
268 | let local_module_id = crate_def_map.modules_for_file(original_file).next()?; | 268 | Some((crate_id, local_id)) |
269 | Some((crate_id, local_module_id)) | 269 | })?; |
270 | })?; | 270 | Some(Module { id: ModuleId { krate, local_id } }) |
271 | Some(Module { id: ModuleId { krate, module_id } }) | ||
272 | } | 271 | } |
273 | } | 272 | } |
274 | 273 | ||
diff --git a/crates/ra_hir_def/src/attr.rs b/crates/ra_hir_def/src/attr.rs index 298608e27..fffb22201 100644 --- a/crates/ra_hir_def/src/attr.rs +++ b/crates/ra_hir_def/src/attr.rs | |||
@@ -35,7 +35,7 @@ impl Attrs { | |||
35 | match def { | 35 | match def { |
36 | AttrDefId::ModuleId(module) => { | 36 | AttrDefId::ModuleId(module) => { |
37 | let def_map = db.crate_def_map(module.krate); | 37 | let def_map = db.crate_def_map(module.krate); |
38 | let src = match def_map[module.module_id].declaration_source(db) { | 38 | let src = match def_map[module.local_id].declaration_source(db) { |
39 | Some(it) => it, | 39 | Some(it) => it, |
40 | None => return Attrs::default(), | 40 | None => return Attrs::default(), |
41 | }; | 41 | }; |
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 78a532bdd..a57a0176d 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs | |||
@@ -82,7 +82,7 @@ impl Expander { | |||
82 | } | 82 | } |
83 | 83 | ||
84 | fn resolve_path_as_macro(&self, db: &impl DefDatabase, path: &Path) -> Option<MacroDefId> { | 84 | fn resolve_path_as_macro(&self, db: &impl DefDatabase, path: &Path) -> Option<MacroDefId> { |
85 | self.crate_def_map.resolve_path(db, self.module.module_id, path).0.take_macros() | 85 | self.crate_def_map.resolve_path(db, self.module.local_id, path).0.take_macros() |
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
diff --git a/crates/ra_hir_def/src/docs.rs b/crates/ra_hir_def/src/docs.rs index 4749b642f..34ed9b7a5 100644 --- a/crates/ra_hir_def/src/docs.rs +++ b/crates/ra_hir_def/src/docs.rs | |||
@@ -36,7 +36,7 @@ impl Documentation { | |||
36 | match def { | 36 | match def { |
37 | AttrDefId::ModuleId(module) => { | 37 | AttrDefId::ModuleId(module) => { |
38 | let def_map = db.crate_def_map(module.krate); | 38 | let def_map = db.crate_def_map(module.krate); |
39 | let src = def_map[module.module_id].declaration_source(db)?; | 39 | let src = def_map[module.local_id].declaration_source(db)?; |
40 | docs_from_ast(&src.value) | 40 | docs_from_ast(&src.value) |
41 | } | 41 | } |
42 | AttrDefId::StructFieldId(it) => { | 42 | AttrDefId::StructFieldId(it) => { |
diff --git a/crates/ra_hir_def/src/lang_item.rs b/crates/ra_hir_def/src/lang_item.rs index f15c23db9..f4fdbdcfc 100644 --- a/crates/ra_hir_def/src/lang_item.rs +++ b/crates/ra_hir_def/src/lang_item.rs | |||
@@ -41,7 +41,7 @@ impl LangItems { | |||
41 | crate_def_map | 41 | crate_def_map |
42 | .modules | 42 | .modules |
43 | .iter() | 43 | .iter() |
44 | .filter_map(|(module_id, _)| db.module_lang_items(ModuleId { krate, module_id })) | 44 | .filter_map(|(local_id, _)| db.module_lang_items(ModuleId { krate, local_id })) |
45 | .for_each(|it| lang_items.items.extend(it.items.iter().map(|(k, v)| (k.clone(), *v)))); | 45 | .for_each(|it| lang_items.items.extend(it.items.iter().map(|(k, v)| (k.clone(), *v)))); |
46 | 46 | ||
47 | Arc::new(lang_items) | 47 | Arc::new(lang_items) |
@@ -80,7 +80,7 @@ impl LangItems { | |||
80 | fn collect_lang_items(&mut self, db: &impl DefDatabase, module: ModuleId) { | 80 | fn collect_lang_items(&mut self, db: &impl DefDatabase, module: ModuleId) { |
81 | // Look for impl targets | 81 | // Look for impl targets |
82 | let def_map = db.crate_def_map(module.krate); | 82 | let def_map = db.crate_def_map(module.krate); |
83 | let module_data = &def_map[module.module_id]; | 83 | let module_data = &def_map[module.local_id]; |
84 | for &impl_block in module_data.impls.iter() { | 84 | for &impl_block in module_data.impls.iter() { |
85 | self.collect_lang_item(db, impl_block, LangItemTarget::ImplBlockId) | 85 | self.collect_lang_item(db, impl_block, LangItemTarget::ImplBlockId) |
86 | } | 86 | } |
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index ddf464c60..bc5530896 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -50,7 +50,7 @@ impl_arena_id!(LocalImportId); | |||
50 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 50 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
51 | pub struct ModuleId { | 51 | pub struct ModuleId { |
52 | pub krate: CrateId, | 52 | pub krate: CrateId, |
53 | pub module_id: LocalModuleId, | 53 | pub local_id: LocalModuleId, |
54 | } | 54 | } |
55 | 55 | ||
56 | /// An ID of a module, **local** to a specific crate | 56 | /// An ID of a module, **local** to a specific crate |
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index ea3abfdae..603b49738 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -37,7 +37,7 @@ pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> C | |||
37 | log::debug!("crate dep {:?} -> {:?}", dep.name, dep.crate_id); | 37 | log::debug!("crate dep {:?} -> {:?}", dep.name, dep.crate_id); |
38 | def_map.extern_prelude.insert( | 38 | def_map.extern_prelude.insert( |
39 | dep.as_name(), | 39 | dep.as_name(), |
40 | ModuleId { krate: dep.crate_id, module_id: dep_def_map.root }.into(), | 40 | ModuleId { krate: dep.crate_id, local_id: dep_def_map.root }.into(), |
41 | ); | 41 | ); |
42 | 42 | ||
43 | // look for the prelude | 43 | // look for the prelude |
@@ -323,7 +323,7 @@ where | |||
323 | tested_by!(glob_across_crates); | 323 | tested_by!(glob_across_crates); |
324 | // glob import from other crate => we can just import everything once | 324 | // glob import from other crate => we can just import everything once |
325 | let item_map = self.db.crate_def_map(m.krate); | 325 | let item_map = self.db.crate_def_map(m.krate); |
326 | let scope = &item_map[m.module_id].scope; | 326 | let scope = &item_map[m.local_id].scope; |
327 | 327 | ||
328 | // Module scoped macros is included | 328 | // Module scoped macros is included |
329 | let items = scope | 329 | let items = scope |
@@ -337,7 +337,7 @@ where | |||
337 | // glob import from same crate => we do an initial | 337 | // glob import from same crate => we do an initial |
338 | // import, and then need to propagate any further | 338 | // import, and then need to propagate any further |
339 | // additions | 339 | // additions |
340 | let scope = &self.def_map[m.module_id].scope; | 340 | let scope = &self.def_map[m.local_id].scope; |
341 | 341 | ||
342 | // Module scoped macros is included | 342 | // Module scoped macros is included |
343 | let items = scope | 343 | let items = scope |
@@ -349,7 +349,7 @@ where | |||
349 | self.update(module_id, Some(import_id), &items); | 349 | self.update(module_id, Some(import_id), &items); |
350 | // record the glob import in case we add further items | 350 | // record the glob import in case we add further items |
351 | self.glob_imports | 351 | self.glob_imports |
352 | .entry(m.module_id) | 352 | .entry(m.local_id) |
353 | .or_default() | 353 | .or_default() |
354 | .push((module_id, import_id)); | 354 | .push((module_id, import_id)); |
355 | } | 355 | } |
@@ -590,7 +590,7 @@ where | |||
590 | raw::RawItemKind::Impl(imp) => { | 590 | raw::RawItemKind::Impl(imp) => { |
591 | let module = ModuleId { | 591 | let module = ModuleId { |
592 | krate: self.def_collector.def_map.krate, | 592 | krate: self.def_collector.def_map.krate, |
593 | module_id: self.module_id, | 593 | local_id: self.module_id, |
594 | }; | 594 | }; |
595 | let ctx = LocationCtx::new(self.def_collector.db, module, self.file_id); | 595 | let ctx = LocationCtx::new(self.def_collector.db, module, self.file_id); |
596 | let imp_id = ImplId::from_ast_id(ctx, self.raw_items[imp].ast_id); | 596 | let imp_id = ImplId::from_ast_id(ctx, self.raw_items[imp].ast_id); |
@@ -673,7 +673,7 @@ where | |||
673 | modules[self.module_id].children.insert(name.clone(), res); | 673 | modules[self.module_id].children.insert(name.clone(), res); |
674 | let resolution = Resolution { | 674 | let resolution = Resolution { |
675 | def: PerNs::types( | 675 | def: PerNs::types( |
676 | ModuleId { krate: self.def_collector.def_map.krate, module_id: res }.into(), | 676 | ModuleId { krate: self.def_collector.def_map.krate, local_id: res }.into(), |
677 | ), | 677 | ), |
678 | import: None, | 678 | import: None, |
679 | }; | 679 | }; |
@@ -682,8 +682,7 @@ where | |||
682 | } | 682 | } |
683 | 683 | ||
684 | fn define_def(&mut self, def: &raw::DefData) { | 684 | fn define_def(&mut self, def: &raw::DefData) { |
685 | let module = | 685 | let module = ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id }; |
686 | ModuleId { krate: self.def_collector.def_map.krate, module_id: self.module_id }; | ||
687 | let ctx = LocationCtx::new(self.def_collector.db, module, self.file_id); | 686 | let ctx = LocationCtx::new(self.def_collector.db, module, self.file_id); |
688 | 687 | ||
689 | let name = def.name.clone(); | 688 | let name = def.name.clone(); |
diff --git a/crates/ra_hir_def/src/nameres/path_resolution.rs b/crates/ra_hir_def/src/nameres/path_resolution.rs index 9455f22bb..b72c55bd1 100644 --- a/crates/ra_hir_def/src/nameres/path_resolution.rs +++ b/crates/ra_hir_def/src/nameres/path_resolution.rs | |||
@@ -74,19 +74,19 @@ impl CrateDefMap { | |||
74 | PathKind::DollarCrate(krate) => { | 74 | PathKind::DollarCrate(krate) => { |
75 | if krate == self.krate { | 75 | if krate == self.krate { |
76 | tested_by!(macro_dollar_crate_self); | 76 | tested_by!(macro_dollar_crate_self); |
77 | PerNs::types(ModuleId { krate: self.krate, module_id: self.root }.into()) | 77 | PerNs::types(ModuleId { krate: self.krate, local_id: self.root }.into()) |
78 | } else { | 78 | } else { |
79 | let def_map = db.crate_def_map(krate); | 79 | let def_map = db.crate_def_map(krate); |
80 | let module = ModuleId { krate, module_id: def_map.root }; | 80 | let module = ModuleId { krate, local_id: def_map.root }; |
81 | tested_by!(macro_dollar_crate_other); | 81 | tested_by!(macro_dollar_crate_other); |
82 | PerNs::types(module.into()) | 82 | PerNs::types(module.into()) |
83 | } | 83 | } |
84 | } | 84 | } |
85 | PathKind::Crate => { | 85 | PathKind::Crate => { |
86 | PerNs::types(ModuleId { krate: self.krate, module_id: self.root }.into()) | 86 | PerNs::types(ModuleId { krate: self.krate, local_id: self.root }.into()) |
87 | } | 87 | } |
88 | PathKind::Self_ => { | 88 | PathKind::Self_ => { |
89 | PerNs::types(ModuleId { krate: self.krate, module_id: original_module }.into()) | 89 | PerNs::types(ModuleId { krate: self.krate, local_id: original_module }.into()) |
90 | } | 90 | } |
91 | // plain import or absolute path in 2015: crate-relative with | 91 | // plain import or absolute path in 2015: crate-relative with |
92 | // fallback to extern prelude (with the simplification in | 92 | // fallback to extern prelude (with the simplification in |
@@ -113,7 +113,7 @@ impl CrateDefMap { | |||
113 | } | 113 | } |
114 | PathKind::Super => { | 114 | PathKind::Super => { |
115 | if let Some(p) = self.modules[original_module].parent { | 115 | if let Some(p) = self.modules[original_module].parent { |
116 | PerNs::types(ModuleId { krate: self.krate, module_id: p }.into()) | 116 | PerNs::types(ModuleId { krate: self.krate, local_id: p }.into()) |
117 | } else { | 117 | } else { |
118 | log::debug!("super path in root module"); | 118 | log::debug!("super path in root module"); |
119 | return ResolvePathResult::empty(ReachedFixedPoint::Yes); | 119 | return ResolvePathResult::empty(ReachedFixedPoint::Yes); |
@@ -160,7 +160,7 @@ impl CrateDefMap { | |||
160 | Path { segments: path.segments[i..].to_vec(), kind: PathKind::Self_ }; | 160 | Path { segments: path.segments[i..].to_vec(), kind: PathKind::Self_ }; |
161 | log::debug!("resolving {:?} in other crate", path); | 161 | log::debug!("resolving {:?} in other crate", path); |
162 | let defp_map = db.crate_def_map(module.krate); | 162 | let defp_map = db.crate_def_map(module.krate); |
163 | let (def, s) = defp_map.resolve_path(db, module.module_id, &path); | 163 | let (def, s) = defp_map.resolve_path(db, module.local_id, &path); |
164 | return ResolvePathResult::with( | 164 | return ResolvePathResult::with( |
165 | def, | 165 | def, |
166 | ReachedFixedPoint::Yes, | 166 | ReachedFixedPoint::Yes, |
@@ -169,7 +169,7 @@ impl CrateDefMap { | |||
169 | } | 169 | } |
170 | 170 | ||
171 | // Since it is a qualified path here, it should not contains legacy macros | 171 | // Since it is a qualified path here, it should not contains legacy macros |
172 | match self[module.module_id].scope.get(&segment.name) { | 172 | match self[module.local_id].scope.get(&segment.name) { |
173 | Some(res) => res.def, | 173 | Some(res) => res.def, |
174 | _ => { | 174 | _ => { |
175 | log::debug!("path segment {:?} not found", segment.name); | 175 | log::debug!("path segment {:?} not found", segment.name); |
@@ -254,7 +254,7 @@ impl CrateDefMap { | |||
254 | keep = db.crate_def_map(prelude.krate); | 254 | keep = db.crate_def_map(prelude.krate); |
255 | &keep | 255 | &keep |
256 | }; | 256 | }; |
257 | def_map[prelude.module_id].scope.get(name).map_or_else(PerNs::none, |res| res.def) | 257 | def_map[prelude.local_id].scope.get(name).map_or_else(PerNs::none, |res| res.def) |
258 | } else { | 258 | } else { |
259 | PerNs::none() | 259 | PerNs::none() |
260 | } | 260 | } |
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/ra_hir_def/src/resolver.rs index 5155365cc..0847f6dcf 100644 --- a/crates/ra_hir_def/src/resolver.rs +++ b/crates/ra_hir_def/src/resolver.rs | |||
@@ -325,7 +325,7 @@ impl Resolver { | |||
325 | if let Scope::ModuleScope(m) = scope { | 325 | if let Scope::ModuleScope(m) = scope { |
326 | if let Some(prelude) = m.crate_def_map.prelude { | 326 | if let Some(prelude) = m.crate_def_map.prelude { |
327 | let prelude_def_map = db.crate_def_map(prelude.krate); | 327 | let prelude_def_map = db.crate_def_map(prelude.krate); |
328 | traits.extend(prelude_def_map[prelude.module_id].scope.traits()); | 328 | traits.extend(prelude_def_map[prelude.local_id].scope.traits()); |
329 | } | 329 | } |
330 | traits.extend(m.crate_def_map[m.module_id].scope.traits()); | 330 | traits.extend(m.crate_def_map[m.module_id].scope.traits()); |
331 | } | 331 | } |
@@ -402,7 +402,7 @@ impl Scope { | |||
402 | }); | 402 | }); |
403 | if let Some(prelude) = m.crate_def_map.prelude { | 403 | if let Some(prelude) = m.crate_def_map.prelude { |
404 | let prelude_def_map = db.crate_def_map(prelude.krate); | 404 | let prelude_def_map = db.crate_def_map(prelude.krate); |
405 | prelude_def_map[prelude.module_id].scope.entries().for_each(|(name, res)| { | 405 | prelude_def_map[prelude.local_id].scope.entries().for_each(|(name, res)| { |
406 | f(name.clone(), ScopeDef::PerNs(res.def)); | 406 | f(name.clone(), ScopeDef::PerNs(res.def)); |
407 | }); | 407 | }); |
408 | } | 408 | } |
@@ -492,7 +492,7 @@ pub trait HasResolver: Copy { | |||
492 | impl HasResolver for ModuleId { | 492 | impl HasResolver for ModuleId { |
493 | fn resolver(self, db: &impl DefDatabase) -> Resolver { | 493 | fn resolver(self, db: &impl DefDatabase) -> Resolver { |
494 | let def_map = db.crate_def_map(self.krate); | 494 | let def_map = db.crate_def_map(self.krate); |
495 | Resolver::default().push_module_scope(def_map, self.module_id) | 495 | Resolver::default().push_module_scope(def_map, self.local_id) |
496 | } | 496 | } |
497 | } | 497 | } |
498 | 498 | ||
diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index 874357008..1dc9793f9 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs | |||
@@ -73,9 +73,9 @@ impl TestDB { | |||
73 | pub fn module_for_file(&self, file_id: FileId) -> ModuleId { | 73 | pub fn module_for_file(&self, file_id: FileId) -> ModuleId { |
74 | for &krate in self.relevant_crates(file_id).iter() { | 74 | for &krate in self.relevant_crates(file_id).iter() { |
75 | let crate_def_map = self.crate_def_map(krate); | 75 | let crate_def_map = self.crate_def_map(krate); |
76 | for (module_id, data) in crate_def_map.modules.iter() { | 76 | for (local_id, data) in crate_def_map.modules.iter() { |
77 | if data.definition == Some(file_id) { | 77 | if data.definition == Some(file_id) { |
78 | return ModuleId { krate, module_id }; | 78 | return ModuleId { krate, local_id }; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index c1744663a..c8461b447 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -4677,7 +4677,7 @@ fn type_at_pos(db: &TestDB, pos: FilePosition) -> String { | |||
4677 | 4677 | ||
4678 | let module = db.module_for_file(pos.file_id); | 4678 | let module = db.module_for_file(pos.file_id); |
4679 | let crate_def_map = db.crate_def_map(module.krate); | 4679 | let crate_def_map = db.crate_def_map(module.krate); |
4680 | for decl in crate_def_map[module.module_id].scope.declarations() { | 4680 | for decl in crate_def_map[module.local_id].scope.declarations() { |
4681 | if let ModuleDefId::FunctionId(func) = decl { | 4681 | if let ModuleDefId::FunctionId(func) = decl { |
4682 | let (_body, source_map) = db.body_with_source_map(func.into()); | 4682 | let (_body, source_map) = db.body_with_source_map(func.into()); |
4683 | if let Some(expr_id) = source_map.node_expr(Source::new(pos.file_id.into(), &expr)) { | 4683 | if let Some(expr_id) = source_map.node_expr(Source::new(pos.file_id.into(), &expr)) { |
@@ -4753,7 +4753,7 @@ fn infer(content: &str) -> String { | |||
4753 | let crate_def_map = db.crate_def_map(module.krate); | 4753 | let crate_def_map = db.crate_def_map(module.krate); |
4754 | 4754 | ||
4755 | let mut defs: Vec<DefWithBodyId> = Vec::new(); | 4755 | let mut defs: Vec<DefWithBodyId> = Vec::new(); |
4756 | visit_module(&db, &crate_def_map, module.module_id, &mut |it| defs.push(it)); | 4756 | visit_module(&db, &crate_def_map, module.local_id, &mut |it| defs.push(it)); |
4757 | defs.sort_by_key(|def| match def { | 4757 | defs.sort_by_key(|def| match def { |
4758 | DefWithBodyId::FunctionId(it) => { | 4758 | DefWithBodyId::FunctionId(it) => { |
4759 | it.lookup(&db).ast_id.to_node(&db).syntax().text_range().start() | 4759 | it.lookup(&db).ast_id.to_node(&db).syntax().text_range().start() |
@@ -4796,7 +4796,7 @@ fn visit_module( | |||
4796 | } | 4796 | } |
4797 | } | 4797 | } |
4798 | } | 4798 | } |
4799 | ModuleDefId::ModuleId(it) => visit_module(db, crate_def_map, it.module_id, cb), | 4799 | ModuleDefId::ModuleId(it) => visit_module(db, crate_def_map, it.local_id, cb), |
4800 | _ => (), | 4800 | _ => (), |
4801 | } | 4801 | } |
4802 | } | 4802 | } |
@@ -4844,7 +4844,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() { | |||
4844 | let events = db.log_executed(|| { | 4844 | let events = db.log_executed(|| { |
4845 | let module = db.module_for_file(pos.file_id); | 4845 | let module = db.module_for_file(pos.file_id); |
4846 | let crate_def_map = db.crate_def_map(module.krate); | 4846 | let crate_def_map = db.crate_def_map(module.krate); |
4847 | visit_module(&db, &crate_def_map, module.module_id, &mut |def| { | 4847 | visit_module(&db, &crate_def_map, module.local_id, &mut |def| { |
4848 | db.infer(def); | 4848 | db.infer(def); |
4849 | }); | 4849 | }); |
4850 | }); | 4850 | }); |
@@ -4866,7 +4866,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() { | |||
4866 | let events = db.log_executed(|| { | 4866 | let events = db.log_executed(|| { |
4867 | let module = db.module_for_file(pos.file_id); | 4867 | let module = db.module_for_file(pos.file_id); |
4868 | let crate_def_map = db.crate_def_map(module.krate); | 4868 | let crate_def_map = db.crate_def_map(module.krate); |
4869 | visit_module(&db, &crate_def_map, module.module_id, &mut |def| { | 4869 | visit_module(&db, &crate_def_map, module.local_id, &mut |def| { |
4870 | db.infer(def); | 4870 | db.infer(def); |
4871 | }); | 4871 | }); |
4872 | }); | 4872 | }); |
diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide/Cargo.toml index 15346f388..e6383dd35 100644 --- a/crates/ra_ide_api/Cargo.toml +++ b/crates/ra_ide/Cargo.toml | |||
@@ -1,6 +1,6 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | edition = "2018" |
3 | name = "ra_ide_api" | 3 | name = "ra_ide" |
4 | version = "0.1.0" | 4 | version = "0.1.0" |
5 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
6 | 6 | ||
@@ -32,7 +32,7 @@ ra_prof = { path = "../ra_prof" } | |||
32 | test_utils = { path = "../test_utils" } | 32 | test_utils = { path = "../test_utils" } |
33 | ra_assists = { path = "../ra_assists" } | 33 | ra_assists = { path = "../ra_assists" } |
34 | 34 | ||
35 | # ra_ide_api should depend only on the top-level `hir` package. if you need | 35 | # ra_ide should depend only on the top-level `hir` package. if you need |
36 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. | 36 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. |
37 | hir = { path = "../ra_hir", package = "ra_hir" } | 37 | hir = { path = "../ra_hir", package = "ra_hir" } |
38 | 38 | ||
diff --git a/crates/ra_ide_api/src/assists.rs b/crates/ra_ide/src/assists.rs index e00589733..e00589733 100644 --- a/crates/ra_ide_api/src/assists.rs +++ b/crates/ra_ide/src/assists.rs | |||
diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide/src/call_info.rs index d559dc4d0..d559dc4d0 100644 --- a/crates/ra_ide_api/src/call_info.rs +++ b/crates/ra_ide/src/call_info.rs | |||
diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide/src/change.rs index 4a76d1dd8..4a76d1dd8 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide/src/change.rs | |||
diff --git a/crates/ra_ide_api/src/completion.rs b/crates/ra_ide/src/completion.rs index abe1f36ce..abe1f36ce 100644 --- a/crates/ra_ide_api/src/completion.rs +++ b/crates/ra_ide/src/completion.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide/src/completion/complete_dot.rs index b6fe48627..b6fe48627 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide/src/completion/complete_dot.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs index 502458706..502458706 100644 --- a/crates/ra_ide_api/src/completion/complete_fn_param.rs +++ b/crates/ra_ide/src/completion/complete_fn_param.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index eb7cd9ac2..eb7cd9ac2 100644 --- a/crates/ra_ide_api/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs b/crates/ra_ide/src/completion/complete_macro_in_item_position.rs index faadd1e3f..faadd1e3f 100644 --- a/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs +++ b/crates/ra_ide/src/completion/complete_macro_in_item_position.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide/src/completion/complete_path.rs index 89e0009a1..89e0009a1 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide/src/completion/complete_path.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_pattern.rs b/crates/ra_ide/src/completion/complete_pattern.rs index fd03b1c40..fd03b1c40 100644 --- a/crates/ra_ide_api/src/completion/complete_pattern.rs +++ b/crates/ra_ide/src/completion/complete_pattern.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs index 646a30c76..646a30c76 100644 --- a/crates/ra_ide_api/src/completion/complete_postfix.rs +++ b/crates/ra_ide/src/completion/complete_postfix.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_record_literal.rs b/crates/ra_ide/src/completion/complete_record_literal.rs index 577c394d2..577c394d2 100644 --- a/crates/ra_ide_api/src/completion/complete_record_literal.rs +++ b/crates/ra_ide/src/completion/complete_record_literal.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_record_pattern.rs b/crates/ra_ide/src/completion/complete_record_pattern.rs index a56c7e3a1..a56c7e3a1 100644 --- a/crates/ra_ide_api/src/completion/complete_record_pattern.rs +++ b/crates/ra_ide/src/completion/complete_record_pattern.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_scope.rs index d5739b58a..d5739b58a 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide/src/completion/complete_scope.rs | |||
diff --git a/crates/ra_ide_api/src/completion/complete_snippet.rs b/crates/ra_ide/src/completion/complete_snippet.rs index 1f2988b36..1f2988b36 100644 --- a/crates/ra_ide_api/src/completion/complete_snippet.rs +++ b/crates/ra_ide/src/completion/complete_snippet.rs | |||
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index b8345c91d..b8345c91d 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide/src/completion/completion_item.rs index 93f336370..93f336370 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide/src/completion/completion_item.rs | |||
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs index 5f056730a..5f056730a 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide/src/completion/presentation.rs | |||
diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide/src/db.rs index f739ebecd..f739ebecd 100644 --- a/crates/ra_ide_api/src/db.rs +++ b/crates/ra_ide/src/db.rs | |||
diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index cc1ccab4b..cc1ccab4b 100644 --- a/crates/ra_ide_api/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs | |||
diff --git a/crates/ra_ide_api/src/display.rs b/crates/ra_ide/src/display.rs index 30617412a..30617412a 100644 --- a/crates/ra_ide_api/src/display.rs +++ b/crates/ra_ide/src/display.rs | |||
diff --git a/crates/ra_ide_api/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index d96de4e4c..d96de4e4c 100644 --- a/crates/ra_ide_api/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs | |||
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index 6ac60722b..6ac60722b 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs | |||
diff --git a/crates/ra_ide_api/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs index 9ffc9b980..9ffc9b980 100644 --- a/crates/ra_ide_api/src/display/short_label.rs +++ b/crates/ra_ide/src/display/short_label.rs | |||
diff --git a/crates/ra_ide_api/src/display/structure.rs b/crates/ra_ide/src/display/structure.rs index a80d65ac7..a80d65ac7 100644 --- a/crates/ra_ide_api/src/display/structure.rs +++ b/crates/ra_ide/src/display/structure.rs | |||
diff --git a/crates/ra_ide_api/src/expand.rs b/crates/ra_ide/src/expand.rs index 2f1abf509..2f1abf509 100644 --- a/crates/ra_ide_api/src/expand.rs +++ b/crates/ra_ide/src/expand.rs | |||
diff --git a/crates/ra_ide_api/src/expand_macro.rs b/crates/ra_ide/src/expand_macro.rs index abc602244..abc602244 100644 --- a/crates/ra_ide_api/src/expand_macro.rs +++ b/crates/ra_ide/src/expand_macro.rs | |||
diff --git a/crates/ra_ide_api/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs index 4b7bfc0b1..4b7bfc0b1 100644 --- a/crates/ra_ide_api/src/extend_selection.rs +++ b/crates/ra_ide/src/extend_selection.rs | |||
diff --git a/crates/ra_ide_api/src/feature_flags.rs b/crates/ra_ide/src/feature_flags.rs index de4ae513d..de4ae513d 100644 --- a/crates/ra_ide_api/src/feature_flags.rs +++ b/crates/ra_ide/src/feature_flags.rs | |||
diff --git a/crates/ra_ide_api/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 4eeb76d14..4eeb76d14 100644 --- a/crates/ra_ide_api/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs | |||
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs index c10a6c844..c10a6c844 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide/src/goto_definition.rs | |||
diff --git a/crates/ra_ide_api/src/goto_type_definition.rs b/crates/ra_ide/src/goto_type_definition.rs index 992a08809..992a08809 100644 --- a/crates/ra_ide_api/src/goto_type_definition.rs +++ b/crates/ra_ide/src/goto_type_definition.rs | |||
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide/src/hover.rs index 260a7b869..260a7b869 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
diff --git a/crates/ra_ide_api/src/impls.rs b/crates/ra_ide/src/impls.rs index aa480e399..aa480e399 100644 --- a/crates/ra_ide_api/src/impls.rs +++ b/crates/ra_ide/src/impls.rs | |||
diff --git a/crates/ra_ide_api/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 45149bf0c..45149bf0c 100644 --- a/crates/ra_ide_api/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs | |||
diff --git a/crates/ra_ide_api/src/join_lines.rs b/crates/ra_ide/src/join_lines.rs index 7deeb3494..7deeb3494 100644 --- a/crates/ra_ide_api/src/join_lines.rs +++ b/crates/ra_ide/src/join_lines.rs | |||
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide/src/lib.rs index cb6c24eaa..d1bff4a76 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! ra_ide_api crate provides "ide-centric" APIs for the rust-analyzer. That is, | 1 | //! ra_ide crate provides "ide-centric" APIs for the rust-analyzer. That is, |
2 | //! it generally operates with files and text ranges, and returns results as | 2 | //! it generally operates with files and text ranges, and returns results as |
3 | //! Strings, suitable for displaying to the human. | 3 | //! Strings, suitable for displaying to the human. |
4 | //! | 4 | //! |
diff --git a/crates/ra_ide_api/src/line_index.rs b/crates/ra_ide/src/line_index.rs index 710890d27..710890d27 100644 --- a/crates/ra_ide_api/src/line_index.rs +++ b/crates/ra_ide/src/line_index.rs | |||
diff --git a/crates/ra_ide_api/src/line_index_utils.rs b/crates/ra_ide/src/line_index_utils.rs index bd1e08feb..bd1e08feb 100644 --- a/crates/ra_ide_api/src/line_index_utils.rs +++ b/crates/ra_ide/src/line_index_utils.rs | |||
diff --git a/crates/ra_ide_api/src/marks.rs b/crates/ra_ide/src/marks.rs index 848ae4dc7..848ae4dc7 100644 --- a/crates/ra_ide_api/src/marks.rs +++ b/crates/ra_ide/src/marks.rs | |||
diff --git a/crates/ra_ide_api/src/matching_brace.rs b/crates/ra_ide/src/matching_brace.rs index d1204fac0..d1204fac0 100644 --- a/crates/ra_ide_api/src/matching_brace.rs +++ b/crates/ra_ide/src/matching_brace.rs | |||
diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs index bf8a54932..bf8a54932 100644 --- a/crates/ra_ide_api/src/mock_analysis.rs +++ b/crates/ra_ide/src/mock_analysis.rs | |||
diff --git a/crates/ra_ide_api/src/parent_module.rs b/crates/ra_ide/src/parent_module.rs index 6027e7d54..6027e7d54 100644 --- a/crates/ra_ide_api/src/parent_module.rs +++ b/crates/ra_ide/src/parent_module.rs | |||
diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide/src/references.rs index 21a1ea69e..21a1ea69e 100644 --- a/crates/ra_ide_api/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
diff --git a/crates/ra_ide_api/src/references/classify.rs b/crates/ra_ide/src/references/classify.rs index 5cea805ec..5cea805ec 100644 --- a/crates/ra_ide_api/src/references/classify.rs +++ b/crates/ra_ide/src/references/classify.rs | |||
diff --git a/crates/ra_ide_api/src/references/name_definition.rs b/crates/ra_ide/src/references/name_definition.rs index 10d3a2364..10d3a2364 100644 --- a/crates/ra_ide_api/src/references/name_definition.rs +++ b/crates/ra_ide/src/references/name_definition.rs | |||
diff --git a/crates/ra_ide_api/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index d58496049..d58496049 100644 --- a/crates/ra_ide_api/src/references/rename.rs +++ b/crates/ra_ide/src/references/rename.rs | |||
diff --git a/crates/ra_ide_api/src/references/search_scope.rs b/crates/ra_ide/src/references/search_scope.rs index f5c9589f4..f5c9589f4 100644 --- a/crates/ra_ide_api/src/references/search_scope.rs +++ b/crates/ra_ide/src/references/search_scope.rs | |||
diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide/src/runnables.rs index 8039a5164..8039a5164 100644 --- a/crates/ra_ide_api/src/runnables.rs +++ b/crates/ra_ide/src/runnables.rs | |||
diff --git a/crates/ra_ide_api/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index b39c4d371..b39c4d371 100644 --- a/crates/ra_ide_api/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html | |||
diff --git a/crates/ra_ide_api/src/snapshots/rainbow_highlighting.html b/crates/ra_ide/src/snapshots/rainbow_highlighting.html index 79f11ea80..79f11ea80 100644 --- a/crates/ra_ide_api/src/snapshots/rainbow_highlighting.html +++ b/crates/ra_ide/src/snapshots/rainbow_highlighting.html | |||
diff --git a/crates/ra_ide_api/src/source_change.rs b/crates/ra_ide/src/source_change.rs index f5f7f8807..f5f7f8807 100644 --- a/crates/ra_ide_api/src/source_change.rs +++ b/crates/ra_ide/src/source_change.rs | |||
diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide/src/status.rs index 1bb27eb85..1bb27eb85 100644 --- a/crates/ra_ide_api/src/status.rs +++ b/crates/ra_ide/src/status.rs | |||
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide/src/symbol_index.rs index 5729eb5b3..5729eb5b3 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide/src/symbol_index.rs | |||
diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 10165a9bb..9a3e4c82f 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -306,7 +306,7 @@ fn main() { | |||
306 | "# | 306 | "# |
307 | .trim(), | 307 | .trim(), |
308 | ); | 308 | ); |
309 | let dst_file = project_dir().join("crates/ra_ide_api/src/snapshots/highlighting.html"); | 309 | let dst_file = project_dir().join("crates/ra_ide/src/snapshots/highlighting.html"); |
310 | let actual_html = &analysis.highlight_as_html(file_id, false).unwrap(); | 310 | let actual_html = &analysis.highlight_as_html(file_id, false).unwrap(); |
311 | let expected_html = &read_text(&dst_file); | 311 | let expected_html = &read_text(&dst_file); |
312 | std::fs::write(dst_file, &actual_html).unwrap(); | 312 | std::fs::write(dst_file, &actual_html).unwrap(); |
@@ -332,8 +332,7 @@ fn bar() { | |||
332 | "# | 332 | "# |
333 | .trim(), | 333 | .trim(), |
334 | ); | 334 | ); |
335 | let dst_file = | 335 | let dst_file = project_dir().join("crates/ra_ide/src/snapshots/rainbow_highlighting.html"); |
336 | project_dir().join("crates/ra_ide_api/src/snapshots/rainbow_highlighting.html"); | ||
337 | let actual_html = &analysis.highlight_as_html(file_id, true).unwrap(); | 336 | let actual_html = &analysis.highlight_as_html(file_id, true).unwrap(); |
338 | let expected_html = &read_text(&dst_file); | 337 | let expected_html = &read_text(&dst_file); |
339 | std::fs::write(dst_file, &actual_html).unwrap(); | 338 | std::fs::write(dst_file, &actual_html).unwrap(); |
diff --git a/crates/ra_ide_api/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index 4d0f0fc47..4d0f0fc47 100644 --- a/crates/ra_ide_api/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs | |||
diff --git a/crates/ra_ide_api/src/test_utils.rs b/crates/ra_ide/src/test_utils.rs index 8adb214d4..8adb214d4 100644 --- a/crates/ra_ide_api/src/test_utils.rs +++ b/crates/ra_ide/src/test_utils.rs | |||
diff --git a/crates/ra_ide_api/src/typing.rs b/crates/ra_ide/src/typing.rs index 21e5be9b3..21e5be9b3 100644 --- a/crates/ra_ide_api/src/typing.rs +++ b/crates/ra_ide/src/typing.rs | |||
diff --git a/crates/ra_ide_api/src/wasm_shims.rs b/crates/ra_ide/src/wasm_shims.rs index 088cc9be4..088cc9be4 100644 --- a/crates/ra_ide_api/src/wasm_shims.rs +++ b/crates/ra_ide/src/wasm_shims.rs | |||
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index 58b9cfaa0..21aef842c 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml | |||
@@ -22,7 +22,7 @@ jod-thread = "0.1.0" | |||
22 | ra_vfs = "0.5.0" | 22 | ra_vfs = "0.5.0" |
23 | ra_syntax = { path = "../ra_syntax" } | 23 | ra_syntax = { path = "../ra_syntax" } |
24 | ra_text_edit = { path = "../ra_text_edit" } | 24 | ra_text_edit = { path = "../ra_text_edit" } |
25 | ra_ide_api = { path = "../ra_ide_api" } | 25 | ra_ide = { path = "../ra_ide" } |
26 | lsp-server = "0.3.0" | 26 | lsp-server = "0.3.0" |
27 | ra_project_model = { path = "../ra_project_model" } | 27 | ra_project_model = { path = "../ra_project_model" } |
28 | ra_prof = { path = "../ra_prof" } | 28 | ra_prof = { path = "../ra_prof" } |
diff --git a/crates/ra_lsp_server/src/cargo_target_spec.rs b/crates/ra_lsp_server/src/cargo_target_spec.rs index d996b53de..c4a9e7101 100644 --- a/crates/ra_lsp_server/src/cargo_target_spec.rs +++ b/crates/ra_lsp_server/src/cargo_target_spec.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use ra_ide_api::{FileId, RunnableKind}; | 3 | use ra_ide::{FileId, RunnableKind}; |
4 | use ra_project_model::{self, ProjectWorkspace, TargetKind}; | 4 | use ra_project_model::{self, ProjectWorkspace, TargetKind}; |
5 | 5 | ||
6 | use crate::{world::WorldSnapshot, Result}; | 6 | use crate::{world::WorldSnapshot, Result}; |
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 94ed619fa..b13093cfe 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -6,7 +6,7 @@ use lsp_types::{ | |||
6 | SymbolKind, TextDocumentEdit, TextDocumentIdentifier, TextDocumentItem, | 6 | SymbolKind, TextDocumentEdit, TextDocumentIdentifier, TextDocumentItem, |
7 | TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, WorkspaceEdit, | 7 | TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, WorkspaceEdit, |
8 | }; | 8 | }; |
9 | use ra_ide_api::{ | 9 | use ra_ide::{ |
10 | translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, | 10 | translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, |
11 | FileRange, FileSystemEdit, Fold, FoldKind, InsertTextFormat, LineCol, LineIndex, | 11 | FileRange, FileSystemEdit, Fold, FoldKind, InsertTextFormat, LineCol, LineIndex, |
12 | NavigationTarget, RangeInfo, Severity, SourceChange, SourceFileEdit, | 12 | NavigationTarget, RangeInfo, Severity, SourceChange, SourceFileEdit, |
@@ -173,7 +173,7 @@ impl ConvWith<&LineIndex> for Range { | |||
173 | } | 173 | } |
174 | } | 174 | } |
175 | 175 | ||
176 | impl Conv for ra_ide_api::Documentation { | 176 | impl Conv for ra_ide::Documentation { |
177 | type Output = lsp_types::Documentation; | 177 | type Output = lsp_types::Documentation; |
178 | fn conv(self) -> Documentation { | 178 | fn conv(self) -> Documentation { |
179 | Documentation::MarkupContent(MarkupContent { | 179 | Documentation::MarkupContent(MarkupContent { |
@@ -183,7 +183,7 @@ impl Conv for ra_ide_api::Documentation { | |||
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | impl Conv for ra_ide_api::FunctionSignature { | 186 | impl Conv for ra_ide::FunctionSignature { |
187 | type Output = lsp_types::SignatureInformation; | 187 | type Output = lsp_types::SignatureInformation; |
188 | fn conv(self) -> Self::Output { | 188 | fn conv(self) -> Self::Output { |
189 | use lsp_types::{ParameterInformation, ParameterLabel, SignatureInformation}; | 189 | use lsp_types::{ParameterInformation, ParameterLabel, SignatureInformation}; |
diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/ra_lsp_server/src/lib.rs index 9c36402b0..2ca149fd5 100644 --- a/crates/ra_lsp_server/src/lib.rs +++ b/crates/ra_lsp_server/src/lib.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! Implementation of the LSP for rust-analyzer. | 1 | //! Implementation of the LSP for rust-analyzer. |
2 | //! | 2 | //! |
3 | //! This crate takes Rust-specific analysis results from ra_ide_api and | 3 | //! This crate takes Rust-specific analysis results from ra_ide and |
4 | //! translates into LSP types. | 4 | //! translates into LSP types. |
5 | //! | 5 | //! |
6 | //! It also is the root of all state. `world` module defines the bulk of the | 6 | //! It also is the root of all state. `world` module defines the bulk of the |
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 0dc0aeee8..83845f1e0 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs | |||
@@ -9,7 +9,7 @@ use std::{error::Error, fmt, panic, path::PathBuf, sync::Arc, time::Instant}; | |||
9 | use crossbeam_channel::{select, unbounded, RecvError, Sender}; | 9 | use crossbeam_channel::{select, unbounded, RecvError, Sender}; |
10 | use lsp_server::{Connection, ErrorCode, Message, Notification, Request, RequestId, Response}; | 10 | use lsp_server::{Connection, ErrorCode, Message, Notification, Request, RequestId, Response}; |
11 | use lsp_types::{ClientCapabilities, NumberOrString}; | 11 | use lsp_types::{ClientCapabilities, NumberOrString}; |
12 | use ra_ide_api::{Canceled, FeatureFlags, FileId, LibraryData, SourceRootId}; | 12 | use ra_ide::{Canceled, FeatureFlags, FileId, LibraryData, SourceRootId}; |
13 | use ra_prof::profile; | 13 | use ra_prof::profile; |
14 | use ra_vfs::{VfsTask, Watch}; | 14 | use ra_vfs::{VfsTask, Watch}; |
15 | use relative_path::RelativePathBuf; | 15 | use relative_path::RelativePathBuf; |
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index e552f2106..c81fa7f67 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -9,7 +9,7 @@ use lsp_types::{ | |||
9 | Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse, | 9 | Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse, |
10 | Range, RenameParams, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit, | 10 | Range, RenameParams, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit, |
11 | }; | 11 | }; |
12 | use ra_ide_api::{ | 12 | use ra_ide::{ |
13 | AssistId, FileId, FilePosition, FileRange, Query, Runnable, RunnableKind, SearchScope, | 13 | AssistId, FileId, FilePosition, FileRange, Query, Runnable, RunnableKind, SearchScope, |
14 | }; | 14 | }; |
15 | use ra_prof::profile; | 15 | use ra_prof::profile; |
@@ -162,7 +162,7 @@ pub fn handle_on_type_formatting( | |||
162 | let line_index = world.analysis().file_line_index(position.file_id)?; | 162 | let line_index = world.analysis().file_line_index(position.file_id)?; |
163 | let line_endings = world.file_line_endings(position.file_id); | 163 | let line_endings = world.file_line_endings(position.file_id); |
164 | 164 | ||
165 | // in `ra_ide_api`, the `on_type` invariant is that | 165 | // in `ra_ide`, the `on_type` invariant is that |
166 | // `text.char_at(position) == typed_char`. | 166 | // `text.char_at(position) == typed_char`. |
167 | position.offset = position.offset - TextUnit::of_char('.'); | 167 | position.offset = position.offset - TextUnit::of_char('.'); |
168 | let char_typed = params.ch.chars().next().unwrap_or('\0'); | 168 | let char_typed = params.ch.chars().next().unwrap_or('\0'); |
@@ -894,7 +894,7 @@ pub fn handle_inlay_hints( | |||
894 | label: api_type.label.to_string(), | 894 | label: api_type.label.to_string(), |
895 | range: api_type.range.conv_with(&line_index), | 895 | range: api_type.range.conv_with(&line_index), |
896 | kind: match api_type.kind { | 896 | kind: match api_type.kind { |
897 | ra_ide_api::InlayKind::TypeHint => InlayKind::TypeHint, | 897 | ra_ide::InlayKind::TypeHint => InlayKind::TypeHint, |
898 | }, | 898 | }, |
899 | }) | 899 | }) |
900 | .collect()) | 900 | .collect()) |
diff --git a/crates/ra_lsp_server/src/main_loop/subscriptions.rs b/crates/ra_lsp_server/src/main_loop/subscriptions.rs index 3856263b0..609b2adcc 100644 --- a/crates/ra_lsp_server/src/main_loop/subscriptions.rs +++ b/crates/ra_lsp_server/src/main_loop/subscriptions.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use ra_ide_api::FileId; | 3 | use ra_ide::FileId; |
4 | use rustc_hash::FxHashSet; | 4 | use rustc_hash::FxHashSet; |
5 | 5 | ||
6 | #[derive(Default, Debug)] | 6 | #[derive(Default, Debug)] |
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index 9bdea70c7..927449b45 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs | |||
@@ -9,7 +9,7 @@ use crossbeam_channel::{unbounded, Receiver}; | |||
9 | use lsp_server::ErrorCode; | 9 | use lsp_server::ErrorCode; |
10 | use lsp_types::Url; | 10 | use lsp_types::Url; |
11 | use parking_lot::RwLock; | 11 | use parking_lot::RwLock; |
12 | use ra_ide_api::{ | 12 | use ra_ide::{ |
13 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, | 13 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, |
14 | SourceRootId, | 14 | SourceRootId, |
15 | }; | 15 | }; |
diff --git a/docs/dev/README.md b/docs/dev/README.md index 0823ca09a..0f64d7e5f 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -14,7 +14,7 @@ To learn more about how rust-analyzer works, see | |||
14 | 14 | ||
15 | We also publish rustdoc docs to pages: | 15 | We also publish rustdoc docs to pages: |
16 | 16 | ||
17 | https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/ | 17 | https://rust-analyzer.github.io/rust-analyzer/ra_ide/ |
18 | 18 | ||
19 | Various organizational and process issues are discussed in this document. | 19 | Various organizational and process issues are discussed in this document. |
20 | 20 | ||
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 6fd396dee..629645757 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md | |||
@@ -106,7 +106,7 @@ guessing a HIR for a particular source position. | |||
106 | 106 | ||
107 | Underneath, HIR works on top of salsa, using a `HirDatabase` trait. | 107 | Underneath, HIR works on top of salsa, using a `HirDatabase` trait. |
108 | 108 | ||
109 | ### `crates/ra_ide_api` | 109 | ### `crates/ra_ide` |
110 | 110 | ||
111 | A stateful library for analyzing many Rust files as they change. `AnalysisHost` | 111 | A stateful library for analyzing many Rust files as they change. `AnalysisHost` |
112 | is a mutable entity (clojure's atom) which holds the current state, incorporates | 112 | is a mutable entity (clojure's atom) which holds the current state, incorporates |
@@ -124,11 +124,11 @@ offsets and strings as output. This works on top of rich code model powered by | |||
124 | 124 | ||
125 | ### `crates/ra_lsp_server` | 125 | ### `crates/ra_lsp_server` |
126 | 126 | ||
127 | An LSP implementation which wraps `ra_ide_api` into a language server protocol. | 127 | An LSP implementation which wraps `ra_ide` into a language server protocol. |
128 | 128 | ||
129 | ### `ra_vfs` | 129 | ### `ra_vfs` |
130 | 130 | ||
131 | Although `hir` and `ra_ide_api` don't do any IO, we need to be able to read | 131 | Although `hir` and `ra_ide` don't do any IO, we need to be able to read |
132 | files from disk at the end of the day. This is what `ra_vfs` does. It also | 132 | files from disk at the end of the day. This is what `ra_vfs` does. It also |
133 | manages overlays: "dirty" files in the editor, whose "true" contents is | 133 | manages overlays: "dirty" files in the editor, whose "true" contents is |
134 | different from data on disk. This is more or less the single really | 134 | different from data on disk. This is more or less the single really |
@@ -162,13 +162,13 @@ disk. For this reason, we try to avoid writing too many tests on this boundary: | |||
162 | in a statically typed language, it's hard to make an error in the protocol | 162 | in a statically typed language, it's hard to make an error in the protocol |
163 | itself if messages are themselves typed. | 163 | itself if messages are themselves typed. |
164 | 164 | ||
165 | The middle, and most important, boundary is `ra_ide_api`. Unlike | 165 | The middle, and most important, boundary is `ra_ide`. Unlike |
166 | `ra_lsp_server`, which exposes API, `ide_api` uses Rust API and is intended to | 166 | `ra_lsp_server`, which exposes API, `ide` uses Rust API and is intended to |
167 | use by various tools. Typical test creates an `AnalysisHost`, calls some | 167 | use by various tools. Typical test creates an `AnalysisHost`, calls some |
168 | `Analysis` functions and compares the results against expectation. | 168 | `Analysis` functions and compares the results against expectation. |
169 | 169 | ||
170 | The innermost and most elaborate boundary is `hir`. It has a much richer | 170 | The innermost and most elaborate boundary is `hir`. It has a much richer |
171 | vocabulary of types than `ide_api`, but the basic testing setup is the same: we | 171 | vocabulary of types than `ide`, but the basic testing setup is the same: we |
172 | create a database, run some queries, assert result. | 172 | create a database, run some queries, assert result. |
173 | 173 | ||
174 | For comparisons, we use [insta](https://github.com/mitsuhiko/insta/) library for | 174 | For comparisons, we use [insta](https://github.com/mitsuhiko/insta/) library for |
diff --git a/docs/dev/guide.md b/docs/dev/guide.md index abbe4c154..c163a74b3 100644 --- a/docs/dev/guide.md +++ b/docs/dev/guide.md | |||
@@ -40,8 +40,8 @@ terms of files and offsets, and **not** in terms of Rust concepts like structs, | |||
40 | traits, etc. The "typed" API with Rust specific types is slightly lower in the | 40 | traits, etc. The "typed" API with Rust specific types is slightly lower in the |
41 | stack, we'll talk about it later. | 41 | stack, we'll talk about it later. |
42 | 42 | ||
43 | [`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L265-L284 | 43 | [`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L265-L284 |
44 | [`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L291-L478 | 44 | [`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L291-L478 |
45 | 45 | ||
46 | The reason for this separation of `Analysis` and `AnalysisHost` is that we want to apply | 46 | The reason for this separation of `Analysis` and `AnalysisHost` is that we want to apply |
47 | changes "uniquely", but we might also want to fork an `Analysis` and send it to | 47 | changes "uniquely", but we might also want to fork an `Analysis` and send it to |
@@ -69,7 +69,7 @@ the `AnalysisHost::apply_change` method, which accepts a single argument, a | |||
69 | "transaction", so it suffices to study its methods to understand all of the | 69 | "transaction", so it suffices to study its methods to understand all of the |
70 | input data. | 70 | input data. |
71 | 71 | ||
72 | [`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L119-L167 | 72 | [`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L119-L167 |
73 | 73 | ||
74 | The `(add|change|remove)_file` methods control the set of the input files, where | 74 | The `(add|change|remove)_file` methods control the set of the input files, where |
75 | each file has an integer id (`FileId`, picked by the client), text (`String`) | 75 | each file has an integer id (`FileId`, picked by the client), text (`String`) |
@@ -253,7 +253,7 @@ All analyzer information is stored in a salsa database. `Analysis` and | |||
253 | `AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa | 253 | `AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa |
254 | database. | 254 | database. |
255 | 255 | ||
256 | [`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/db.rs#L88-L134 | 256 | [`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/db.rs#L88-L134 |
257 | 257 | ||
258 | Salsa input queries are defined in [`FilesDatabase`] (which is a part of | 258 | 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: |
@@ -565,11 +565,11 @@ the type to completion. | |||
565 | [schedule it on the threadpool]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428 | 565 | [schedule it on the threadpool]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428 |
566 | [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 | 566 | [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 |
567 | [the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps | 567 | [the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps |
568 | [ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L439-L444 | 568 | [ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L439-L444 |
569 | [completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L46-L62 | 569 | [completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion.rs#L46-L62 |
570 | [`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L14-L37 | 570 | [`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L14-L37 |
571 | ["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L72-L75 | 571 | ["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L72-L75 |
572 | [find an ancestor `fn` node]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L116-L120 | 572 | [find an ancestor `fn` node]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L116-L120 |
573 | [semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L123 | 573 | [semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L123 |
574 | [series of independent completion routines]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L52-L59 | 574 | [series of independent completion routines]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion.rs#L52-L59 |
575 | [`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/complete_dot.rs#L6-L22 | 575 | [`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/complete_dot.rs#L6-L22 |
diff --git a/editors/code/src/utils/terminateProcess.sh b/editors/code/src/utils/terminateProcess.sh index 2ec9e1c2e..2ec9e1c2e 100755..100644 --- a/editors/code/src/utils/terminateProcess.sh +++ b/editors/code/src/utils/terminateProcess.sh | |||
diff --git a/xtask/tests/tidy-tests/docs.rs b/xtask/tests/tidy-tests/docs.rs index e0653b460..8a005d6c4 100644 --- a/xtask/tests/tidy-tests/docs.rs +++ b/xtask/tests/tidy-tests/docs.rs | |||
@@ -74,7 +74,7 @@ fn no_docs_comments() { | |||
74 | "ra_db", | 74 | "ra_db", |
75 | "ra_hir", | 75 | "ra_hir", |
76 | "ra_hir_expand", | 76 | "ra_hir_expand", |
77 | "ra_ide_api", | 77 | "ra_ide", |
78 | "ra_lsp_server", | 78 | "ra_lsp_server", |
79 | "ra_mbe", | 79 | "ra_mbe", |
80 | "ra_parser", | 80 | "ra_parser", |