aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ide_db/Cargo.toml (renamed from crates/ra_ide_db/Cargo.toml)10
-rw-r--r--crates/ide_db/src/change.rs (renamed from crates/ra_ide_db/src/change.rs)0
-rw-r--r--crates/ide_db/src/defs.rs (renamed from crates/ra_ide_db/src/defs.rs)0
-rw-r--r--crates/ide_db/src/imports_locator.rs (renamed from crates/ra_ide_db/src/imports_locator.rs)0
-rw-r--r--crates/ide_db/src/lib.rs (renamed from crates/ra_ide_db/src/lib.rs)0
-rw-r--r--crates/ide_db/src/line_index.rs (renamed from crates/ra_ide_db/src/line_index.rs)0
-rw-r--r--crates/ide_db/src/search.rs (renamed from crates/ra_ide_db/src/search.rs)0
-rw-r--r--crates/ide_db/src/source_change.rs (renamed from crates/ra_ide_db/src/source_change.rs)0
-rw-r--r--crates/ide_db/src/symbol_index.rs (renamed from crates/ra_ide_db/src/symbol_index.rs)0
-rw-r--r--crates/ide_db/src/wasm_shims.rs (renamed from crates/ra_ide_db/src/wasm_shims.rs)0
-rw-r--r--crates/ra_assists/Cargo.toml2
-rw-r--r--crates/ra_assists/src/assist_context.rs2
-rw-r--r--crates/ra_assists/src/handlers/add_turbo_fish.rs2
-rw-r--r--crates/ra_assists/src/handlers/auto_import.rs2
-rw-r--r--crates/ra_assists/src/handlers/expand_glob_import.rs2
-rw-r--r--crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs2
-rw-r--r--crates/ra_assists/src/handlers/fill_match_arms.rs2
-rw-r--r--crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs2
-rw-r--r--crates/ra_assists/src/handlers/inline_local_variable.rs2
-rw-r--r--crates/ra_assists/src/handlers/reorder_fields.rs2
-rw-r--r--crates/ra_assists/src/lib.rs2
-rw-r--r--crates/ra_assists/src/tests.rs2
-rw-r--r--crates/ra_assists/src/utils.rs2
-rw-r--r--crates/ra_ide/Cargo.toml2
-rw-r--r--crates/ra_ide/src/call_hierarchy.rs2
-rw-r--r--crates/ra_ide/src/call_info.rs2
-rw-r--r--crates/ra_ide/src/completion.rs2
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs2
-rw-r--r--crates/ra_ide/src/diagnostics.rs2
-rw-r--r--crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs2
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs2
-rw-r--r--crates/ra_ide/src/expand_macro.rs2
-rw-r--r--crates/ra_ide/src/extend_selection.rs2
-rw-r--r--crates/ra_ide/src/goto_definition.rs2
-rw-r--r--crates/ra_ide/src/goto_implementation.rs2
-rw-r--r--crates/ra_ide/src/goto_type_definition.rs2
-rw-r--r--crates/ra_ide/src/hover.rs4
-rw-r--r--crates/ra_ide/src/inlay_hints.rs2
-rw-r--r--crates/ra_ide/src/lib.rs6
-rw-r--r--crates/ra_ide/src/parent_module.rs2
-rw-r--r--crates/ra_ide/src/references.rs4
-rw-r--r--crates/ra_ide/src/references/rename.rs2
-rw-r--r--crates/ra_ide/src/runnables.rs2
-rw-r--r--crates/ra_ide/src/ssr.rs2
-rw-r--r--crates/ra_ide/src/status.rs4
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs2
-rw-r--r--crates/ra_ide/src/syntax_tree.rs2
-rw-r--r--crates/ra_ide/src/typing.rs2
-rw-r--r--crates/ra_ide/src/typing/on_enter.rs2
-rw-r--r--crates/ra_ssr/Cargo.toml2
-rw-r--r--crates/ra_ssr/src/lib.rs10
-rw-r--r--crates/ra_ssr/src/matching.rs8
-rw-r--r--crates/ra_ssr/src/nester.rs10
-rw-r--r--crates/ra_ssr/src/resolving.rs2
-rw-r--r--crates/ra_ssr/src/search.rs4
-rw-r--r--crates/ra_ssr/src/tests.rs8
-rw-r--r--crates/rust-analyzer/Cargo.toml2
-rw-r--r--crates/rust-analyzer/src/cli/ssr.rs2
58 files changed, 70 insertions, 76 deletions
diff --git a/crates/ra_ide_db/Cargo.toml b/crates/ide_db/Cargo.toml
index eda257a3a..885212162 100644
--- a/crates/ra_ide_db/Cargo.toml
+++ b/crates/ide_db/Cargo.toml
@@ -1,9 +1,9 @@
1[package] 1[package]
2edition = "2018" 2name = "ide_db"
3name = "ra_ide_db" 3version = "0.0.0"
4version = "0.1.0"
5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0" 4license = "MIT OR Apache-2.0"
5authors = ["rust-analyzer developers"]
6edition = "2018"
7 7
8[lib] 8[lib]
9doctest = false 9doctest = false
@@ -20,13 +20,11 @@ once_cell = "1.3.1"
20either = "1.5.3" 20either = "1.5.3"
21 21
22stdx = { path = "../stdx" } 22stdx = { path = "../stdx" }
23
24syntax = { path = "../syntax" } 23syntax = { path = "../syntax" }
25text_edit = { path = "../text_edit" } 24text_edit = { path = "../text_edit" }
26base_db = { path = "../base_db" } 25base_db = { path = "../base_db" }
27profile = { path = "../profile" } 26profile = { path = "../profile" }
28test_utils = { path = "../test_utils" } 27test_utils = { path = "../test_utils" }
29
30# ra_ide should depend only on the top-level `hir` package. if you need 28# ra_ide should depend only on the top-level `hir` package. if you need
31# something from some `hir_xxx` subpackage, reexport the API via `hir`. 29# something from some `hir_xxx` subpackage, reexport the API via `hir`.
32hir = { path = "../hir" } 30hir = { path = "../hir" }
diff --git a/crates/ra_ide_db/src/change.rs b/crates/ide_db/src/change.rs
index 8b4fd7ab8..8b4fd7ab8 100644
--- a/crates/ra_ide_db/src/change.rs
+++ b/crates/ide_db/src/change.rs
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ide_db/src/defs.rs
index 7b5d6ac49..7b5d6ac49 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ide_db/src/defs.rs
diff --git a/crates/ra_ide_db/src/imports_locator.rs b/crates/ide_db/src/imports_locator.rs
index 1d0c20291..1d0c20291 100644
--- a/crates/ra_ide_db/src/imports_locator.rs
+++ b/crates/ide_db/src/imports_locator.rs
diff --git a/crates/ra_ide_db/src/lib.rs b/crates/ide_db/src/lib.rs
index fd474cd0f..fd474cd0f 100644
--- a/crates/ra_ide_db/src/lib.rs
+++ b/crates/ide_db/src/lib.rs
diff --git a/crates/ra_ide_db/src/line_index.rs b/crates/ide_db/src/line_index.rs
index a381f7fb8..a381f7fb8 100644
--- a/crates/ra_ide_db/src/line_index.rs
+++ b/crates/ide_db/src/line_index.rs
diff --git a/crates/ra_ide_db/src/search.rs b/crates/ide_db/src/search.rs
index b9360bf12..b9360bf12 100644
--- a/crates/ra_ide_db/src/search.rs
+++ b/crates/ide_db/src/search.rs
diff --git a/crates/ra_ide_db/src/source_change.rs b/crates/ide_db/src/source_change.rs
index f1590ec66..f1590ec66 100644
--- a/crates/ra_ide_db/src/source_change.rs
+++ b/crates/ide_db/src/source_change.rs
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ide_db/src/symbol_index.rs
index 654df898e..654df898e 100644
--- a/crates/ra_ide_db/src/symbol_index.rs
+++ b/crates/ide_db/src/symbol_index.rs
diff --git a/crates/ra_ide_db/src/wasm_shims.rs b/crates/ide_db/src/wasm_shims.rs
index 7af9f9d9b..7af9f9d9b 100644
--- a/crates/ra_ide_db/src/wasm_shims.rs
+++ b/crates/ide_db/src/wasm_shims.rs
diff --git a/crates/ra_assists/Cargo.toml b/crates/ra_assists/Cargo.toml
index cacc063da..19e7591f7 100644
--- a/crates/ra_assists/Cargo.toml
+++ b/crates/ra_assists/Cargo.toml
@@ -19,6 +19,6 @@ syntax = { path = "../syntax" }
19text_edit = { path = "../text_edit" } 19text_edit = { path = "../text_edit" }
20profile = { path = "../profile" } 20profile = { path = "../profile" }
21base_db = { path = "../base_db" } 21base_db = { path = "../base_db" }
22ra_ide_db = { path = "../ra_ide_db" } 22ide_db = { path = "../ide_db" }
23hir = { path = "../hir" } 23hir = { path = "../hir" }
24test_utils = { path = "../test_utils" } 24test_utils = { path = "../test_utils" }
diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs
index 2fdce037f..79574b9ac 100644
--- a/crates/ra_assists/src/assist_context.rs
+++ b/crates/ra_assists/src/assist_context.rs
@@ -5,7 +5,7 @@ use std::mem;
5use algo::find_covering_element; 5use algo::find_covering_element;
6use base_db::{FileId, FileRange}; 6use base_db::{FileId, FileRange};
7use hir::Semantics; 7use hir::Semantics;
8use ra_ide_db::{ 8use ide_db::{
9 source_change::{SourceChange, SourceFileEdit}, 9 source_change::{SourceChange, SourceFileEdit},
10 RootDatabase, 10 RootDatabase,
11}; 11};
diff --git a/crates/ra_assists/src/handlers/add_turbo_fish.rs b/crates/ra_assists/src/handlers/add_turbo_fish.rs
index 8c7ffae3d..f4f997d8e 100644
--- a/crates/ra_assists/src/handlers/add_turbo_fish.rs
+++ b/crates/ra_assists/src/handlers/add_turbo_fish.rs
@@ -1,4 +1,4 @@
1use ra_ide_db::defs::{classify_name_ref, Definition, NameRefClass}; 1use ide_db::defs::{classify_name_ref, Definition, NameRefClass};
2use syntax::{ast, AstNode, SyntaxKind, T}; 2use syntax::{ast, AstNode, SyntaxKind, T};
3use test_utils::mark; 3use test_utils::mark;
4 4
diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs
index e19b197d9..cce789972 100644
--- a/crates/ra_assists/src/handlers/auto_import.rs
+++ b/crates/ra_assists/src/handlers/auto_import.rs
@@ -5,7 +5,7 @@ use hir::{
5 AsAssocItem, AssocItemContainer, ModPath, Module, ModuleDef, PathResolution, Semantics, Trait, 5 AsAssocItem, AssocItemContainer, ModPath, Module, ModuleDef, PathResolution, Semantics, Trait,
6 Type, 6 Type,
7}; 7};
8use ra_ide_db::{imports_locator, RootDatabase}; 8use ide_db::{imports_locator, RootDatabase};
9use rustc_hash::FxHashSet; 9use rustc_hash::FxHashSet;
10use syntax::{ 10use syntax::{
11 ast::{self, AstNode}, 11 ast::{self, AstNode},
diff --git a/crates/ra_assists/src/handlers/expand_glob_import.rs b/crates/ra_assists/src/handlers/expand_glob_import.rs
index cf34ffaf7..f690ec343 100644
--- a/crates/ra_assists/src/handlers/expand_glob_import.rs
+++ b/crates/ra_assists/src/handlers/expand_glob_import.rs
@@ -1,5 +1,5 @@
1use hir::{AssocItem, MacroDef, ModuleDef, Name, PathResolution, ScopeDef, SemanticsScope}; 1use hir::{AssocItem, MacroDef, ModuleDef, Name, PathResolution, ScopeDef, SemanticsScope};
2use ra_ide_db::{ 2use ide_db::{
3 defs::{classify_name_ref, Definition, NameRefClass}, 3 defs::{classify_name_ref, Definition, NameRefClass},
4 RootDatabase, 4 RootDatabase,
5}; 5};
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 52fbc540e..4bcdae7ba 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,6 +1,6 @@
1use base_db::FileId; 1use base_db::FileId;
2use hir::{EnumVariant, Module, ModuleDef, Name}; 2use hir::{EnumVariant, Module, ModuleDef, Name};
3use ra_ide_db::{defs::Definition, search::Reference, RootDatabase}; 3use ide_db::{defs::Definition, search::Reference, RootDatabase};
4use rustc_hash::FxHashSet; 4use rustc_hash::FxHashSet;
5use syntax::{ 5use syntax::{
6 algo::find_node_at_offset, 6 algo::find_node_at_offset,
diff --git a/crates/ra_assists/src/handlers/fill_match_arms.rs b/crates/ra_assists/src/handlers/fill_match_arms.rs
index 8f6660637..3d9bdb2bf 100644
--- a/crates/ra_assists/src/handlers/fill_match_arms.rs
+++ b/crates/ra_assists/src/handlers/fill_match_arms.rs
@@ -1,8 +1,8 @@
1use std::iter; 1use std::iter;
2 2
3use hir::{Adt, HasSource, ModuleDef, Semantics}; 3use hir::{Adt, HasSource, ModuleDef, Semantics};
4use ide_db::RootDatabase;
4use itertools::Itertools; 5use itertools::Itertools;
5use ra_ide_db::RootDatabase;
6use syntax::ast::{self, make, AstNode, MatchArm, NameOwner, Pat}; 6use syntax::ast::{self, make, AstNode, MatchArm, NameOwner, Pat};
7use test_utils::mark; 7use test_utils::mark;
8 8
diff --git a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs
index 302b6b67d..7f04b9572 100644
--- a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs
+++ b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs
@@ -1,4 +1,4 @@
1use ra_ide_db::RootDatabase; 1use ide_db::RootDatabase;
2use syntax::ast::{self, AstNode, NameOwner}; 2use syntax::ast::{self, AstNode, NameOwner};
3use test_utils::mark; 3use test_utils::mark;
4 4
diff --git a/crates/ra_assists/src/handlers/inline_local_variable.rs b/crates/ra_assists/src/handlers/inline_local_variable.rs
index 531592320..2b52b333b 100644
--- a/crates/ra_assists/src/handlers/inline_local_variable.rs
+++ b/crates/ra_assists/src/handlers/inline_local_variable.rs
@@ -1,4 +1,4 @@
1use ra_ide_db::defs::Definition; 1use ide_db::defs::Definition;
2use syntax::{ 2use syntax::{
3 ast::{self, AstNode, AstToken}, 3 ast::{self, AstNode, AstToken},
4 TextRange, 4 TextRange,
diff --git a/crates/ra_assists/src/handlers/reorder_fields.rs b/crates/ra_assists/src/handlers/reorder_fields.rs
index 013720dfc..527f457a7 100644
--- a/crates/ra_assists/src/handlers/reorder_fields.rs
+++ b/crates/ra_assists/src/handlers/reorder_fields.rs
@@ -2,7 +2,7 @@ use itertools::Itertools;
2use rustc_hash::FxHashMap; 2use rustc_hash::FxHashMap;
3 3
4use hir::{Adt, ModuleDef, PathResolution, Semantics, Struct}; 4use hir::{Adt, ModuleDef, PathResolution, Semantics, Struct};
5use ra_ide_db::RootDatabase; 5use ide_db::RootDatabase;
6use syntax::{algo, ast, match_ast, AstNode, SyntaxKind, SyntaxKind::*, SyntaxNode}; 6use syntax::{algo, ast, match_ast, AstNode, SyntaxKind, SyntaxKind::*, SyntaxNode};
7 7
8use crate::{AssistContext, AssistId, AssistKind, Assists}; 8use crate::{AssistContext, AssistId, AssistKind, Assists};
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs
index 5d062b88b..f0cf35caf 100644
--- a/crates/ra_assists/src/lib.rs
+++ b/crates/ra_assists/src/lib.rs
@@ -19,7 +19,7 @@ pub mod ast_transform;
19 19
20use base_db::FileRange; 20use base_db::FileRange;
21use hir::Semantics; 21use hir::Semantics;
22use ra_ide_db::{source_change::SourceChange, RootDatabase}; 22use ide_db::{source_change::SourceChange, RootDatabase};
23use syntax::TextRange; 23use syntax::TextRange;
24 24
25pub(crate) use crate::assist_context::{AssistContext, Assists}; 25pub(crate) use crate::assist_context::{AssistContext, Assists};
diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs
index 75d973688..ba1fb543b 100644
--- a/crates/ra_assists/src/tests.rs
+++ b/crates/ra_assists/src/tests.rs
@@ -2,7 +2,7 @@ mod generated;
2 2
3use base_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt}; 3use base_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt};
4use hir::Semantics; 4use hir::Semantics;
5use ra_ide_db::RootDatabase; 5use ide_db::RootDatabase;
6use syntax::TextRange; 6use syntax::TextRange;
7use test_utils::{assert_eq_text, extract_offset, extract_range}; 7use test_utils::{assert_eq_text, extract_offset, extract_range};
8 8
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs
index a20453dd8..84ccacafe 100644
--- a/crates/ra_assists/src/utils.rs
+++ b/crates/ra_assists/src/utils.rs
@@ -4,8 +4,8 @@ pub(crate) mod insert_use;
4use std::{iter, ops}; 4use std::{iter, ops};
5 5
6use hir::{Adt, Crate, Enum, ScopeDef, Semantics, Trait, Type}; 6use hir::{Adt, Crate, Enum, ScopeDef, Semantics, Trait, Type};
7use ide_db::RootDatabase;
7use itertools::Itertools; 8use itertools::Itertools;
8use ra_ide_db::RootDatabase;
9use rustc_hash::FxHashSet; 9use rustc_hash::FxHashSet;
10use syntax::{ 10use syntax::{
11 ast::{self, make, NameOwner}, 11 ast::{self, make, NameOwner},
diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml
index a701cdf1d..e25aad6cf 100644
--- a/crates/ra_ide/Cargo.toml
+++ b/crates/ra_ide/Cargo.toml
@@ -24,7 +24,7 @@ stdx = { path = "../stdx" }
24syntax = { path = "../syntax" } 24syntax = { path = "../syntax" }
25text_edit = { path = "../text_edit" } 25text_edit = { path = "../text_edit" }
26base_db = { path = "../base_db" } 26base_db = { path = "../base_db" }
27ra_ide_db = { path = "../ra_ide_db" } 27ide_db = { path = "../ide_db" }
28cfg = { path = "../cfg" } 28cfg = { path = "../cfg" }
29profile = { path = "../profile" } 29profile = { path = "../profile" }
30test_utils = { path = "../test_utils" } 30test_utils = { path = "../test_utils" }
diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ra_ide/src/call_hierarchy.rs
index 3578b8d3c..58e26b94c 100644
--- a/crates/ra_ide/src/call_hierarchy.rs
+++ b/crates/ra_ide/src/call_hierarchy.rs
@@ -3,7 +3,7 @@
3use indexmap::IndexMap; 3use indexmap::IndexMap;
4 4
5use hir::Semantics; 5use hir::Semantics;
6use ra_ide_db::RootDatabase; 6use ide_db::RootDatabase;
7use syntax::{ast, match_ast, AstNode, TextRange}; 7use syntax::{ast, match_ast, AstNode, TextRange};
8 8
9use crate::{ 9use crate::{
diff --git a/crates/ra_ide/src/call_info.rs b/crates/ra_ide/src/call_info.rs
index 703cbc6b4..86abd2d8c 100644
--- a/crates/ra_ide/src/call_info.rs
+++ b/crates/ra_ide/src/call_info.rs
@@ -1,7 +1,7 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2use either::Either; 2use either::Either;
3use hir::{Docs, HirDisplay, Semantics, Type}; 3use hir::{Docs, HirDisplay, Semantics, Type};
4use ra_ide_db::RootDatabase; 4use ide_db::RootDatabase;
5use stdx::format_to; 5use stdx::format_to;
6use syntax::{ 6use syntax::{
7 ast::{self, ArgListOwner}, 7 ast::{self, ArgListOwner},
diff --git a/crates/ra_ide/src/completion.rs b/crates/ra_ide/src/completion.rs
index 68ac05e4c..7fb4d687e 100644
--- a/crates/ra_ide/src/completion.rs
+++ b/crates/ra_ide/src/completion.rs
@@ -19,7 +19,7 @@ mod complete_postfix;
19mod complete_macro_in_item_position; 19mod complete_macro_in_item_position;
20mod complete_trait_impl; 20mod complete_trait_impl;
21 21
22use ra_ide_db::RootDatabase; 22use ide_db::RootDatabase;
23 23
24use crate::{ 24use crate::{
25 completion::{ 25 completion::{
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index 0e0a201d0..047ecd9d7 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -2,7 +2,7 @@
2 2
3use base_db::SourceDatabase; 3use base_db::SourceDatabase;
4use hir::{Semantics, SemanticsScope, Type}; 4use hir::{Semantics, SemanticsScope, Type};
5use ra_ide_db::RootDatabase; 5use ide_db::RootDatabase;
6use syntax::{ 6use syntax::{
7 algo::{find_covering_element, find_node_at_offset}, 7 algo::{find_covering_element, find_node_at_offset},
8 ast, match_ast, AstNode, NodeOrToken, 8 ast, match_ast, AstNode, NodeOrToken,
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs
index 4e59e3a48..a3ec98178 100644
--- a/crates/ra_ide/src/diagnostics.rs
+++ b/crates/ra_ide/src/diagnostics.rs
@@ -8,8 +8,8 @@ use std::cell::RefCell;
8 8
9use base_db::SourceDatabase; 9use base_db::SourceDatabase;
10use hir::{diagnostics::DiagnosticSinkBuilder, Semantics}; 10use hir::{diagnostics::DiagnosticSinkBuilder, Semantics};
11use ide_db::RootDatabase;
11use itertools::Itertools; 12use itertools::Itertools;
12use ra_ide_db::RootDatabase;
13use syntax::{ 13use syntax::{
14 ast::{self, AstNode}, 14 ast::{self, AstNode},
15 SyntaxNode, TextRange, T, 15 SyntaxNode, TextRange, T,
diff --git a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs b/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
index 7e126d7a6..85b46c995 100644
--- a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
+++ b/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
@@ -8,7 +8,7 @@ use hir::{
8 diagnostics::{Diagnostic, MissingFields, MissingOkInTailExpr, NoSuchField, UnresolvedModule}, 8 diagnostics::{Diagnostic, MissingFields, MissingOkInTailExpr, NoSuchField, UnresolvedModule},
9 HasSource, HirDisplay, Semantics, VariantDef, 9 HasSource, HirDisplay, Semantics, VariantDef,
10}; 10};
11use ra_ide_db::{ 11use ide_db::{
12 source_change::{FileSystemEdit, SourceFileEdit}, 12 source_change::{FileSystemEdit, SourceFileEdit},
13 RootDatabase, 13 RootDatabase,
14}; 14};
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs
index 09ec3f65e..e77106177 100644
--- a/crates/ra_ide/src/display/navigation_target.rs
+++ b/crates/ra_ide/src/display/navigation_target.rs
@@ -3,7 +3,7 @@
3use base_db::{FileId, SourceDatabase}; 3use base_db::{FileId, SourceDatabase};
4use either::Either; 4use either::Either;
5use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource}; 5use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource};
6use ra_ide_db::{defs::Definition, RootDatabase}; 6use ide_db::{defs::Definition, RootDatabase};
7use syntax::{ 7use syntax::{
8 ast::{self, DocCommentsOwner, NameOwner}, 8 ast::{self, DocCommentsOwner, NameOwner},
9 match_ast, AstNode, SmolStr, 9 match_ast, AstNode, SmolStr,
diff --git a/crates/ra_ide/src/expand_macro.rs b/crates/ra_ide/src/expand_macro.rs
index c25e068d6..31455709d 100644
--- a/crates/ra_ide/src/expand_macro.rs
+++ b/crates/ra_ide/src/expand_macro.rs
@@ -1,5 +1,5 @@
1use hir::Semantics; 1use hir::Semantics;
2use ra_ide_db::RootDatabase; 2use ide_db::RootDatabase;
3use syntax::{ 3use syntax::{
4 algo::{find_node_at_offset, SyntaxRewriter}, 4 algo::{find_node_at_offset, SyntaxRewriter},
5 ast, AstNode, NodeOrToken, SyntaxKind, 5 ast, AstNode, NodeOrToken, SyntaxKind,
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs
index f30df2bff..34563a026 100644
--- a/crates/ra_ide/src/extend_selection.rs
+++ b/crates/ra_ide/src/extend_selection.rs
@@ -1,7 +1,7 @@
1use std::iter::successors; 1use std::iter::successors;
2 2
3use hir::Semantics; 3use hir::Semantics;
4use ra_ide_db::RootDatabase; 4use ide_db::RootDatabase;
5use syntax::{ 5use syntax::{
6 algo::{self, find_covering_element, skip_trivia_token}, 6 algo::{self, find_covering_element, skip_trivia_token},
7 ast::{self, AstNode, AstToken}, 7 ast::{self, AstNode, AstToken},
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs
index b93d116bf..15e9b7fad 100644
--- a/crates/ra_ide/src/goto_definition.rs
+++ b/crates/ra_ide/src/goto_definition.rs
@@ -1,5 +1,5 @@
1use hir::Semantics; 1use hir::Semantics;
2use ra_ide_db::{ 2use ide_db::{
3 defs::{classify_name, classify_name_ref}, 3 defs::{classify_name, classify_name_ref},
4 symbol_index, RootDatabase, 4 symbol_index, RootDatabase,
5}; 5};
diff --git a/crates/ra_ide/src/goto_implementation.rs b/crates/ra_ide/src/goto_implementation.rs
index 6dc2ccfd0..f503f4ec5 100644
--- a/crates/ra_ide/src/goto_implementation.rs
+++ b/crates/ra_ide/src/goto_implementation.rs
@@ -1,5 +1,5 @@
1use hir::{Crate, ImplDef, Semantics}; 1use hir::{Crate, ImplDef, Semantics};
2use ra_ide_db::RootDatabase; 2use ide_db::RootDatabase;
3use syntax::{algo::find_node_at_offset, ast, AstNode}; 3use syntax::{algo::find_node_at_offset, ast, AstNode};
4 4
5use crate::{display::ToNav, FilePosition, NavigationTarget, RangeInfo}; 5use crate::{display::ToNav, FilePosition, NavigationTarget, RangeInfo};
diff --git a/crates/ra_ide/src/goto_type_definition.rs b/crates/ra_ide/src/goto_type_definition.rs
index 8017ca58c..4a151b150 100644
--- a/crates/ra_ide/src/goto_type_definition.rs
+++ b/crates/ra_ide/src/goto_type_definition.rs
@@ -1,4 +1,4 @@
1use ra_ide_db::RootDatabase; 1use ide_db::RootDatabase;
2use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset, T}; 2use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset, T};
3 3
4use crate::{display::ToNav, FilePosition, NavigationTarget, RangeInfo}; 4use crate::{display::ToNav, FilePosition, NavigationTarget, RangeInfo};
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index a74087f87..331aa4db0 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -3,11 +3,11 @@ use hir::{
3 Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay, 3 Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay,
4 Module, ModuleDef, ModuleSource, Semantics, 4 Module, ModuleDef, ModuleSource, Semantics,
5}; 5};
6use itertools::Itertools; 6use ide_db::{
7use ra_ide_db::{
8 defs::{classify_name, classify_name_ref, Definition}, 7 defs::{classify_name, classify_name_ref, Definition},
9 RootDatabase, 8 RootDatabase,
10}; 9};
10use itertools::Itertools;
11use stdx::format_to; 11use stdx::format_to;
12use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset, T}; 12use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset, T};
13use test_utils::mark; 13use test_utils::mark;
diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs
index 81fe274ad..002adf915 100644
--- a/crates/ra_ide/src/inlay_hints.rs
+++ b/crates/ra_ide/src/inlay_hints.rs
@@ -1,5 +1,5 @@
1use hir::{Adt, Callable, HirDisplay, Semantics, Type}; 1use hir::{Adt, Callable, HirDisplay, Semantics, Type};
2use ra_ide_db::RootDatabase; 2use ide_db::RootDatabase;
3use stdx::to_lower_snake_case; 3use stdx::to_lower_snake_case;
4use syntax::{ 4use syntax::{
5 ast::{self, ArgListOwner, AstNode}, 5 ast::{self, ArgListOwner, AstNode},
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 0d14c823a..66a234fff 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -52,7 +52,7 @@ use base_db::{
52 CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, 52 CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath,
53}; 53};
54use cfg::CfgOptions; 54use cfg::CfgOptions;
55use ra_ide_db::{ 55use ide_db::{
56 symbol_index::{self, FileSymbol}, 56 symbol_index::{self, FileSymbol},
57 LineIndexDatabase, 57 LineIndexDatabase,
58}; 58};
@@ -86,8 +86,7 @@ pub use base_db::{
86 SourceRootId, 86 SourceRootId,
87}; 87};
88pub use hir::{Documentation, Semantics}; 88pub use hir::{Documentation, Semantics};
89pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist}; 89pub use ide_db::{
90pub use ra_ide_db::{
91 change::AnalysisChange, 90 change::AnalysisChange,
92 line_index::{LineCol, LineIndex}, 91 line_index::{LineCol, LineIndex},
93 search::SearchScope, 92 search::SearchScope,
@@ -95,6 +94,7 @@ pub use ra_ide_db::{
95 symbol_index::Query, 94 symbol_index::Query,
96 RootDatabase, 95 RootDatabase,
97}; 96};
97pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
98pub use ra_ssr::SsrError; 98pub use ra_ssr::SsrError;
99pub use text_edit::{Indel, TextEdit}; 99pub use text_edit::{Indel, TextEdit};
100 100
diff --git a/crates/ra_ide/src/parent_module.rs b/crates/ra_ide/src/parent_module.rs
index 8439e1d5d..59ed2967c 100644
--- a/crates/ra_ide/src/parent_module.rs
+++ b/crates/ra_ide/src/parent_module.rs
@@ -1,6 +1,6 @@
1use base_db::{CrateId, FileId, FilePosition}; 1use base_db::{CrateId, FileId, FilePosition};
2use hir::Semantics; 2use hir::Semantics;
3use ra_ide_db::RootDatabase; 3use ide_db::RootDatabase;
4use syntax::{ 4use syntax::{
5 algo::find_node_at_offset, 5 algo::find_node_at_offset,
6 ast::{self, AstNode}, 6 ast::{self, AstNode},
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index e89dca869..0a76ec6b4 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -12,7 +12,7 @@
12mod rename; 12mod rename;
13 13
14use hir::Semantics; 14use hir::Semantics;
15use ra_ide_db::{ 15use ide_db::{
16 defs::{classify_name, classify_name_ref, Definition}, 16 defs::{classify_name, classify_name_ref, Definition},
17 search::SearchScope, 17 search::SearchScope,
18 RootDatabase, 18 RootDatabase,
@@ -27,7 +27,7 @@ use crate::{display::TryToNav, FilePosition, FileRange, NavigationTarget, RangeI
27 27
28pub(crate) use self::rename::rename; 28pub(crate) use self::rename::rename;
29 29
30pub use ra_ide_db::search::{Reference, ReferenceAccess, ReferenceKind}; 30pub use ide_db::search::{Reference, ReferenceAccess, ReferenceKind};
31 31
32#[derive(Debug, Clone)] 32#[derive(Debug, Clone)]
33pub struct ReferenceSearchResult { 33pub struct ReferenceSearchResult {
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs
index 5697b9d87..d73dc9cd0 100644
--- a/crates/ra_ide/src/references/rename.rs
+++ b/crates/ra_ide/src/references/rename.rs
@@ -2,7 +2,7 @@
2 2
3use base_db::SourceDatabaseExt; 3use base_db::SourceDatabaseExt;
4use hir::{Module, ModuleDef, ModuleSource, Semantics}; 4use hir::{Module, ModuleDef, ModuleSource, Semantics};
5use ra_ide_db::{ 5use 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,
8}; 8};
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs
index fb40762cf..c3e07c8de 100644
--- a/crates/ra_ide/src/runnables.rs
+++ b/crates/ra_ide/src/runnables.rs
@@ -2,8 +2,8 @@ use std::fmt;
2 2
3use cfg::CfgExpr; 3use cfg::CfgExpr;
4use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics}; 4use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics};
5use ide_db::RootDatabase;
5use itertools::Itertools; 6use itertools::Itertools;
6use ra_ide_db::RootDatabase;
7use syntax::{ 7use syntax::{
8 ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner}, 8 ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner},
9 match_ast, SyntaxNode, 9 match_ast, SyntaxNode,
diff --git a/crates/ra_ide/src/ssr.rs b/crates/ra_ide/src/ssr.rs
index 97b82b70e..a8a704192 100644
--- a/crates/ra_ide/src/ssr.rs
+++ b/crates/ra_ide/src/ssr.rs
@@ -1,5 +1,5 @@
1use base_db::{FilePosition, FileRange}; 1use base_db::{FilePosition, FileRange};
2use ra_ide_db::RootDatabase; 2use ide_db::RootDatabase;
3 3
4use crate::SourceFileEdit; 4use crate::SourceFileEdit;
5use ra_ssr::{MatchFinder, SsrError, SsrRule}; 5use ra_ssr::{MatchFinder, SsrError, SsrRule};
diff --git a/crates/ra_ide/src/status.rs b/crates/ra_ide/src/status.rs
index 869c74acc..c23708181 100644
--- a/crates/ra_ide/src/status.rs
+++ b/crates/ra_ide/src/status.rs
@@ -5,11 +5,11 @@ use base_db::{
5 FileTextQuery, SourceRootId, 5 FileTextQuery, SourceRootId,
6}; 6};
7use hir::MacroFile; 7use hir::MacroFile;
8use profile::{memory_usage, Bytes}; 8use ide_db::{
9use ra_ide_db::{
10 symbol_index::{LibrarySymbolsQuery, SymbolIndex}, 9 symbol_index::{LibrarySymbolsQuery, SymbolIndex},
11 RootDatabase, 10 RootDatabase,
12}; 11};
12use profile::{memory_usage, Bytes};
13use rustc_hash::FxHashMap; 13use rustc_hash::FxHashMap;
14use syntax::{ast, Parse, SyntaxNode}; 14use syntax::{ast, Parse, SyntaxNode};
15 15
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index 4b41ceb1d..5d7c7e8d0 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -5,7 +5,7 @@ mod injection;
5mod tests; 5mod tests;
6 6
7use hir::{Name, Semantics, VariantDef}; 7use hir::{Name, Semantics, VariantDef};
8use ra_ide_db::{ 8use ide_db::{
9 defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass}, 9 defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass},
10 RootDatabase, 10 RootDatabase,
11}; 11};
diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs
index 17daf06b6..f80044959 100644
--- a/crates/ra_ide/src/syntax_tree.rs
+++ b/crates/ra_ide/src/syntax_tree.rs
@@ -1,5 +1,5 @@
1use base_db::{FileId, SourceDatabase}; 1use base_db::{FileId, SourceDatabase};
2use ra_ide_db::RootDatabase; 2use ide_db::RootDatabase;
3use syntax::{ 3use syntax::{
4 algo, AstNode, NodeOrToken, SourceFile, 4 algo, AstNode, NodeOrToken, SourceFile,
5 SyntaxKind::{RAW_STRING, STRING}, 5 SyntaxKind::{RAW_STRING, STRING},
diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs
index 75f2a6b60..899ce5f26 100644
--- a/crates/ra_ide/src/typing.rs
+++ b/crates/ra_ide/src/typing.rs
@@ -16,7 +16,7 @@
16mod on_enter; 16mod on_enter;
17 17
18use base_db::{FilePosition, SourceDatabase}; 18use base_db::{FilePosition, SourceDatabase};
19use ra_ide_db::{source_change::SourceFileEdit, RootDatabase}; 19use ide_db::{source_change::SourceFileEdit, RootDatabase};
20use syntax::{ 20use syntax::{
21 algo::find_node_at_offset, 21 algo::find_node_at_offset,
22 ast::{self, edit::IndentLevel, AstToken}, 22 ast::{self, edit::IndentLevel, AstToken},
diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ra_ide/src/typing/on_enter.rs
index 193930659..f7d46146c 100644
--- a/crates/ra_ide/src/typing/on_enter.rs
+++ b/crates/ra_ide/src/typing/on_enter.rs
@@ -2,7 +2,7 @@
2//! comments, but should handle indent some time in the future as well. 2//! comments, but should handle indent some time in the future as well.
3 3
4use base_db::{FilePosition, SourceDatabase}; 4use base_db::{FilePosition, SourceDatabase};
5use ra_ide_db::RootDatabase; 5use ide_db::RootDatabase;
6use syntax::{ 6use syntax::{
7 ast::{self, AstToken}, 7 ast::{self, AstToken},
8 AstNode, SmolStr, SourceFile, 8 AstNode, SmolStr, SourceFile,
diff --git a/crates/ra_ssr/Cargo.toml b/crates/ra_ssr/Cargo.toml
index bed4bbdf1..4d22a8a98 100644
--- a/crates/ra_ssr/Cargo.toml
+++ b/crates/ra_ssr/Cargo.toml
@@ -14,7 +14,7 @@ doctest = false
14text_edit = { path = "../text_edit" } 14text_edit = { path = "../text_edit" }
15syntax = { path = "../syntax" } 15syntax = { path = "../syntax" }
16base_db = { path = "../base_db" } 16base_db = { path = "../base_db" }
17ra_ide_db = { path = "../ra_ide_db" } 17ide_db = { path = "../ide_db" }
18hir = { path = "../hir" } 18hir = { path = "../hir" }
19rustc-hash = "1.1.0" 19rustc-hash = "1.1.0"
20test_utils = { path = "../test_utils" } 20test_utils = { path = "../test_utils" }
diff --git a/crates/ra_ssr/src/lib.rs b/crates/ra_ssr/src/lib.rs
index 6725582e4..b4e35107e 100644
--- a/crates/ra_ssr/src/lib.rs
+++ b/crates/ra_ssr/src/lib.rs
@@ -20,7 +20,7 @@ pub use crate::matching::Match;
20use crate::matching::MatchFailureReason; 20use crate::matching::MatchFailureReason;
21use base_db::{FileId, FilePosition, FileRange}; 21use base_db::{FileId, FilePosition, FileRange};
22use hir::Semantics; 22use hir::Semantics;
23use ra_ide_db::source_change::SourceFileEdit; 23use ide_db::source_change::SourceFileEdit;
24use resolving::ResolvedRule; 24use resolving::ResolvedRule;
25use rustc_hash::FxHashMap; 25use rustc_hash::FxHashMap;
26use syntax::{ast, AstNode, SyntaxNode, TextRange}; 26use syntax::{ast, AstNode, SyntaxNode, TextRange};
@@ -49,7 +49,7 @@ pub struct SsrMatches {
49/// Searches a crate for pattern matches and possibly replaces them with something else. 49/// Searches a crate for pattern matches and possibly replaces them with something else.
50pub struct MatchFinder<'db> { 50pub struct MatchFinder<'db> {
51 /// Our source of information about the user's code. 51 /// Our source of information about the user's code.
52 sema: Semantics<'db, ra_ide_db::RootDatabase>, 52 sema: Semantics<'db, ide_db::RootDatabase>,
53 rules: Vec<ResolvedRule>, 53 rules: Vec<ResolvedRule>,
54 resolution_scope: resolving::ResolutionScope<'db>, 54 resolution_scope: resolving::ResolutionScope<'db>,
55 restrict_ranges: Vec<FileRange>, 55 restrict_ranges: Vec<FileRange>,
@@ -59,7 +59,7 @@ impl<'db> MatchFinder<'db> {
59 /// Constructs a new instance where names will be looked up as if they appeared at 59 /// Constructs a new instance where names will be looked up as if they appeared at
60 /// `lookup_context`. 60 /// `lookup_context`.
61 pub fn in_context( 61 pub fn in_context(
62 db: &'db ra_ide_db::RootDatabase, 62 db: &'db ide_db::RootDatabase,
63 lookup_context: FilePosition, 63 lookup_context: FilePosition,
64 mut restrict_ranges: Vec<FileRange>, 64 mut restrict_ranges: Vec<FileRange>,
65 ) -> MatchFinder<'db> { 65 ) -> MatchFinder<'db> {
@@ -70,9 +70,9 @@ impl<'db> MatchFinder<'db> {
70 } 70 }
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 ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
74 use base_db::SourceDatabaseExt; 74 use base_db::SourceDatabaseExt;
75 use ra_ide_db::symbol_index::SymbolsDatabase; 75 use 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()
78 .iter() 78 .iter()
diff --git a/crates/ra_ssr/src/matching.rs b/crates/ra_ssr/src/matching.rs
index e81a87c47..ffc7202ae 100644
--- a/crates/ra_ssr/src/matching.rs
+++ b/crates/ra_ssr/src/matching.rs
@@ -92,7 +92,7 @@ pub(crate) fn get_match(
92 rule: &ResolvedRule, 92 rule: &ResolvedRule,
93 code: &SyntaxNode, 93 code: &SyntaxNode,
94 restrict_range: &Option<FileRange>, 94 restrict_range: &Option<FileRange>,
95 sema: &Semantics<ra_ide_db::RootDatabase>, 95 sema: &Semantics<ide_db::RootDatabase>,
96) -> Result<Match, MatchFailed> { 96) -> Result<Match, MatchFailed> {
97 record_match_fails_reasons_scope(debug_active, || { 97 record_match_fails_reasons_scope(debug_active, || {
98 Matcher::try_match(rule, code, restrict_range, sema) 98 Matcher::try_match(rule, code, restrict_range, sema)
@@ -101,7 +101,7 @@ pub(crate) fn get_match(
101 101
102/// Checks if our search pattern matches a particular node of the AST. 102/// Checks if our search pattern matches a particular node of the AST.
103struct Matcher<'db, 'sema> { 103struct Matcher<'db, 'sema> {
104 sema: &'sema Semantics<'db, ra_ide_db::RootDatabase>, 104 sema: &'sema Semantics<'db, ide_db::RootDatabase>,
105 /// If any placeholders come from anywhere outside of this range, then the match will be 105 /// If any placeholders come from anywhere outside of this range, then the match will be
106 /// rejected. 106 /// rejected.
107 restrict_range: Option<FileRange>, 107 restrict_range: Option<FileRange>,
@@ -123,7 +123,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
123 rule: &ResolvedRule, 123 rule: &ResolvedRule,
124 code: &SyntaxNode, 124 code: &SyntaxNode,
125 restrict_range: &Option<FileRange>, 125 restrict_range: &Option<FileRange>,
126 sema: &'sema Semantics<'db, ra_ide_db::RootDatabase>, 126 sema: &'sema Semantics<'db, ide_db::RootDatabase>,
127 ) -> Result<Match, MatchFailed> { 127 ) -> Result<Match, MatchFailed> {
128 let match_state = Matcher { sema, restrict_range: restrict_range.clone(), rule }; 128 let match_state = Matcher { sema, restrict_range: restrict_range.clone(), rule };
129 // First pass at matching, where we check that node types and idents match. 129 // First pass at matching, where we check that node types and idents match.
@@ -606,7 +606,7 @@ impl Match {
606 fn render_template_paths( 606 fn render_template_paths(
607 &mut self, 607 &mut self,
608 template: &ResolvedPattern, 608 template: &ResolvedPattern,
609 sema: &Semantics<ra_ide_db::RootDatabase>, 609 sema: &Semantics<ide_db::RootDatabase>,
610 ) -> Result<(), MatchFailed> { 610 ) -> Result<(), MatchFailed> {
611 let module = sema 611 let module = sema
612 .scope(&self.matched_node) 612 .scope(&self.matched_node)
diff --git a/crates/ra_ssr/src/nester.rs b/crates/ra_ssr/src/nester.rs
index 8be570d3c..6ac355dfc 100644
--- a/crates/ra_ssr/src/nester.rs
+++ b/crates/ra_ssr/src/nester.rs
@@ -13,7 +13,7 @@ use syntax::SyntaxNode;
13 13
14pub(crate) fn nest_and_remove_collisions( 14pub(crate) fn nest_and_remove_collisions(
15 mut matches: Vec<Match>, 15 mut matches: Vec<Match>,
16 sema: &hir::Semantics<ra_ide_db::RootDatabase>, 16 sema: &hir::Semantics<ide_db::RootDatabase>,
17) -> SsrMatches { 17) -> SsrMatches {
18 // We sort the matches by depth then by rule index. Sorting by depth means that by the time we 18 // We sort the matches by depth then by rule index. Sorting by depth means that by the time we
19 // see a match, any parent matches or conflicting matches will have already been seen. Sorting 19 // see a match, any parent matches or conflicting matches will have already been seen. Sorting
@@ -36,7 +36,7 @@ impl MatchCollector {
36 /// Attempts to add `m` to matches. If it conflicts with an existing match, it is discarded. If 36 /// Attempts to add `m` to matches. If it conflicts with an existing match, it is discarded. If
37 /// it is entirely within the a placeholder of an existing match, then it is added as a child 37 /// it is entirely within the a placeholder of an existing match, then it is added as a child
38 /// match of the existing match. 38 /// match of the existing match.
39 fn add_match(&mut self, m: Match, sema: &hir::Semantics<ra_ide_db::RootDatabase>) { 39 fn add_match(&mut self, m: Match, sema: &hir::Semantics<ide_db::RootDatabase>) {
40 let matched_node = m.matched_node.clone(); 40 let matched_node = m.matched_node.clone();
41 if let Some(existing) = self.matches_by_node.get_mut(&matched_node) { 41 if let Some(existing) = self.matches_by_node.get_mut(&matched_node) {
42 try_add_sub_match(m, existing, sema); 42 try_add_sub_match(m, existing, sema);
@@ -53,11 +53,7 @@ impl MatchCollector {
53} 53}
54 54
55/// Attempts to add `m` as a sub-match of `existing`. 55/// Attempts to add `m` as a sub-match of `existing`.
56fn try_add_sub_match( 56fn try_add_sub_match(m: Match, existing: &mut Match, sema: &hir::Semantics<ide_db::RootDatabase>) {
57 m: Match,
58 existing: &mut Match,
59 sema: &hir::Semantics<ra_ide_db::RootDatabase>,
60) {
61 for p in existing.placeholder_values.values_mut() { 57 for p in existing.placeholder_values.values_mut() {
62 // Note, no need to check if p.range.file is equal to m.range.file, since we 58 // Note, no need to check if p.range.file is equal to m.range.file, since we
63 // already know we're within `existing`. 59 // already know we're within `existing`.
diff --git a/crates/ra_ssr/src/resolving.rs b/crates/ra_ssr/src/resolving.rs
index dac09bae8..020fd7994 100644
--- a/crates/ra_ssr/src/resolving.rs
+++ b/crates/ra_ssr/src/resolving.rs
@@ -187,7 +187,7 @@ impl Resolver<'_, '_> {
187 187
188impl<'db> ResolutionScope<'db> { 188impl<'db> ResolutionScope<'db> {
189 pub(crate) fn new( 189 pub(crate) fn new(
190 sema: &hir::Semantics<'db, ra_ide_db::RootDatabase>, 190 sema: &hir::Semantics<'db, ide_db::RootDatabase>,
191 resolve_context: FilePosition, 191 resolve_context: FilePosition,
192 ) -> ResolutionScope<'db> { 192 ) -> ResolutionScope<'db> {
193 use syntax::ast::AstNode; 193 use syntax::ast::AstNode;
diff --git a/crates/ra_ssr/src/search.rs b/crates/ra_ssr/src/search.rs
index 434953fb4..8509cfa4d 100644
--- a/crates/ra_ssr/src/search.rs
+++ b/crates/ra_ssr/src/search.rs
@@ -6,7 +6,7 @@ use crate::{
6 Match, MatchFinder, 6 Match, MatchFinder,
7}; 7};
8use base_db::{FileId, FileRange}; 8use base_db::{FileId, FileRange};
9use ra_ide_db::{ 9use ide_db::{
10 defs::Definition, 10 defs::Definition,
11 search::{Reference, SearchScope}, 11 search::{Reference, SearchScope},
12}; 12};
@@ -146,7 +146,7 @@ impl<'db> MatchFinder<'db> {
146 if self.restrict_ranges.is_empty() { 146 if self.restrict_ranges.is_empty() {
147 // Unrestricted search. 147 // Unrestricted search.
148 use base_db::SourceDatabaseExt; 148 use base_db::SourceDatabaseExt;
149 use ra_ide_db::symbol_index::SymbolsDatabase; 149 use 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);
152 for file_id in sr.iter() { 152 for file_id in sr.iter() {
diff --git a/crates/ra_ssr/src/tests.rs b/crates/ra_ssr/src/tests.rs
index 54c3da9db..0d0a00090 100644
--- a/crates/ra_ssr/src/tests.rs
+++ b/crates/ra_ssr/src/tests.rs
@@ -61,13 +61,13 @@ fn parser_undefined_placeholder_in_replacement() {
61 61
62/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be 62/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be
63/// the start of the file. If there's a second cursor marker, then we'll return a single range. 63/// the start of the file. If there's a second cursor marker, then we'll return a single range.
64pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) { 64pub(crate) fn single_file(code: &str) -> (ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
65 use base_db::fixture::WithFixture; 65 use base_db::fixture::WithFixture;
66 use ra_ide_db::symbol_index::SymbolsDatabase; 66 use 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 ide_db::RootDatabase::with_range_or_offset(code)
69 } else { 69 } else {
70 let (db, file_id) = ra_ide_db::RootDatabase::with_single_file(code); 70 let (db, file_id) = ide_db::RootDatabase::with_single_file(code);
71 (db, file_id, RangeOrOffset::Offset(0.into())) 71 (db, file_id, RangeOrOffset::Offset(0.into()))
72 }; 72 };
73 let selections; 73 let selections;
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index c0257e9c8..da8c09c09 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -47,7 +47,7 @@ toolchain = { path = "../toolchain" }
47 47
48# This should only be used in CLI 48# This should only be used in CLI
49base_db = { path = "../base_db" } 49base_db = { path = "../base_db" }
50ra_ide_db = { path = "../ra_ide_db" } 50ide_db = { path = "../ide_db" }
51ra_ssr = { path = "../ra_ssr" } 51ra_ssr = { path = "../ra_ssr" }
52hir = { path = "../hir" } 52hir = { path = "../hir" }
53hir_def = { path = "../hir_def" } 53hir_def = { path = "../hir_def" }
diff --git a/crates/rust-analyzer/src/cli/ssr.rs b/crates/rust-analyzer/src/cli/ssr.rs
index 08788fb41..1357a93e1 100644
--- a/crates/rust-analyzer/src/cli/ssr.rs
+++ b/crates/rust-analyzer/src/cli/ssr.rs
@@ -27,7 +27,7 @@ pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> {
27/// for much else. 27/// for much else.
28pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> { 28pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> {
29 use base_db::SourceDatabaseExt; 29 use base_db::SourceDatabaseExt;
30 use ra_ide_db::symbol_index::SymbolsDatabase; 30 use 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();
33 let mut match_finder = MatchFinder::at_first_file(db)?; 33 let mut match_finder = MatchFinder::at_first_file(db)?;