diff options
27 files changed, 29 insertions, 70 deletions
diff --git a/Cargo.lock b/Cargo.lock index e7d1782cc..f50e9edd6 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -53,7 +53,6 @@ dependencies = [ | |||
53 | "either", | 53 | "either", |
54 | "hir", | 54 | "hir", |
55 | "ide_db", | 55 | "ide_db", |
56 | "ide_helpers", | ||
57 | "itertools", | 56 | "itertools", |
58 | "profile", | 57 | "profile", |
59 | "rustc-hash", | 58 | "rustc-hash", |
@@ -259,7 +258,6 @@ dependencies = [ | |||
259 | "expect-test", | 258 | "expect-test", |
260 | "hir", | 259 | "hir", |
261 | "ide_db", | 260 | "ide_db", |
262 | "ide_helpers", | ||
263 | "itertools", | 261 | "itertools", |
264 | "log", | 262 | "log", |
265 | "profile", | 263 | "profile", |
@@ -658,7 +656,6 @@ dependencies = [ | |||
658 | "expect-test", | 656 | "expect-test", |
659 | "hir", | 657 | "hir", |
660 | "ide_db", | 658 | "ide_db", |
661 | "ide_helpers", | ||
662 | "indexmap", | 659 | "indexmap", |
663 | "itertools", | 660 | "itertools", |
664 | "log", | 661 | "log", |
@@ -684,6 +681,7 @@ dependencies = [ | |||
684 | "expect-test", | 681 | "expect-test", |
685 | "fst", | 682 | "fst", |
686 | "hir", | 683 | "hir", |
684 | "itertools", | ||
687 | "log", | 685 | "log", |
688 | "once_cell", | 686 | "once_cell", |
689 | "profile", | 687 | "profile", |
@@ -696,19 +694,6 @@ dependencies = [ | |||
696 | ] | 694 | ] |
697 | 695 | ||
698 | [[package]] | 696 | [[package]] |
699 | name = "ide_helpers" | ||
700 | version = "0.0.0" | ||
701 | dependencies = [ | ||
702 | "either", | ||
703 | "hir", | ||
704 | "ide_db", | ||
705 | "itertools", | ||
706 | "profile", | ||
707 | "syntax", | ||
708 | "test_utils", | ||
709 | ] | ||
710 | |||
711 | [[package]] | ||
712 | name = "idna" | 697 | name = "idna" |
713 | version = "0.2.0" | 698 | version = "0.2.0" |
714 | source = "registry+https://github.com/rust-lang/crates.io-index" | 699 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -1376,7 +1361,6 @@ dependencies = [ | |||
1376 | "hir_ty", | 1361 | "hir_ty", |
1377 | "ide", | 1362 | "ide", |
1378 | "ide_db", | 1363 | "ide_db", |
1379 | "ide_helpers", | ||
1380 | "itertools", | 1364 | "itertools", |
1381 | "jod-thread", | 1365 | "jod-thread", |
1382 | "log", | 1366 | "log", |
diff --git a/crates/assists/Cargo.toml b/crates/assists/Cargo.toml index 91d9b6e3f..3fd8327d6 100644 --- a/crates/assists/Cargo.toml +++ b/crates/assists/Cargo.toml | |||
@@ -21,4 +21,3 @@ profile = { path = "../profile", version = "0.0.0" } | |||
21 | ide_db = { path = "../ide_db", version = "0.0.0" } | 21 | ide_db = { path = "../ide_db", version = "0.0.0" } |
22 | hir = { path = "../hir", version = "0.0.0" } | 22 | hir = { path = "../hir", version = "0.0.0" } |
23 | test_utils = { path = "../test_utils", version = "0.0.0" } | 23 | test_utils = { path = "../test_utils", version = "0.0.0" } |
24 | ide_helpers = { path = "../ide_helpers", version = "0.0.0" } | ||
diff --git a/crates/assists/src/assist_config.rs b/crates/assists/src/assist_config.rs index 6d9934e93..786224cfa 100644 --- a/crates/assists/src/assist_config.rs +++ b/crates/assists/src/assist_config.rs | |||
@@ -5,7 +5,7 @@ | |||
5 | //! assists if we are allowed to. | 5 | //! assists if we are allowed to. |
6 | 6 | ||
7 | use hir::PrefixKind; | 7 | use hir::PrefixKind; |
8 | use ide_helpers::insert_use::MergeBehaviour; | 8 | use ide_db::helpers::insert_use::MergeBehaviour; |
9 | 9 | ||
10 | use crate::AssistKind; | 10 | use crate::AssistKind; |
11 | 11 | ||
diff --git a/crates/assists/src/ast_transform.rs b/crates/assists/src/ast_transform.rs index 95b060599..66e4634b1 100644 --- a/crates/assists/src/ast_transform.rs +++ b/crates/assists/src/ast_transform.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! `AstTransformer`s are functions that replace nodes in an AST and can be easily combined. | 1 | //! `AstTransformer`s are functions that replace nodes in an AST and can be easily combined. |
2 | use hir::{HirDisplay, PathResolution, SemanticsScope}; | 2 | use hir::{HirDisplay, PathResolution, SemanticsScope}; |
3 | use ide_helpers::mod_path_to_ast; | 3 | use ide_db::helpers::mod_path_to_ast; |
4 | use rustc_hash::FxHashMap; | 4 | use rustc_hash::FxHashMap; |
5 | use syntax::{ | 5 | use syntax::{ |
6 | algo::SyntaxRewriter, | 6 | algo::SyntaxRewriter, |
diff --git a/crates/assists/src/handlers/auto_import.rs b/crates/assists/src/handlers/auto_import.rs index 0b2d508d5..bd5bba646 100644 --- a/crates/assists/src/handlers/auto_import.rs +++ b/crates/assists/src/handlers/auto_import.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ide_helpers::{ | 1 | use ide_db::helpers::{ |
2 | insert_use::{insert_use, ImportScope}, | 2 | insert_use::{insert_use, ImportScope}, |
3 | mod_path_to_ast, | 3 | mod_path_to_ast, |
4 | }; | 4 | }; |
diff --git a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs index fddd5354a..d85767b4e 100644 --- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs | |||
@@ -2,11 +2,11 @@ use std::iter; | |||
2 | 2 | ||
3 | use either::Either; | 3 | use either::Either; |
4 | use hir::{AsName, EnumVariant, Module, ModuleDef, Name}; | 4 | use hir::{AsName, EnumVariant, Module, ModuleDef, Name}; |
5 | use ide_db::{defs::Definition, search::Reference, RootDatabase}; | 5 | use ide_db::helpers::{ |
6 | use ide_helpers::{ | ||
7 | insert_use::{insert_use, ImportScope}, | 6 | insert_use::{insert_use, ImportScope}, |
8 | mod_path_to_ast, | 7 | mod_path_to_ast, |
9 | }; | 8 | }; |
9 | use ide_db::{defs::Definition, search::Reference, RootDatabase}; | ||
10 | use rustc_hash::{FxHashMap, FxHashSet}; | 10 | use rustc_hash::{FxHashMap, FxHashSet}; |
11 | use syntax::{ | 11 | use syntax::{ |
12 | algo::{find_node_at_offset, SyntaxRewriter}, | 12 | algo::{find_node_at_offset, SyntaxRewriter}, |
@@ -237,7 +237,7 @@ fn update_reference( | |||
237 | 237 | ||
238 | #[cfg(test)] | 238 | #[cfg(test)] |
239 | mod tests { | 239 | mod tests { |
240 | use ide_helpers::FamousDefs; | 240 | use ide_db::helpers::FamousDefs; |
241 | 241 | ||
242 | use crate::tests::{check_assist, check_assist_not_applicable}; | 242 | use crate::tests::{check_assist, check_assist_not_applicable}; |
243 | 243 | ||
diff --git a/crates/assists/src/handlers/fill_match_arms.rs b/crates/assists/src/handlers/fill_match_arms.rs index bd42e0f16..ef12ef0cf 100644 --- a/crates/assists/src/handlers/fill_match_arms.rs +++ b/crates/assists/src/handlers/fill_match_arms.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | use std::iter; | 1 | use std::iter; |
2 | 2 | ||
3 | use hir::{Adt, HasSource, ModuleDef, Semantics}; | 3 | use hir::{Adt, HasSource, ModuleDef, Semantics}; |
4 | use ide_db::helpers::{mod_path_to_ast, FamousDefs}; | ||
4 | use ide_db::RootDatabase; | 5 | use ide_db::RootDatabase; |
5 | use ide_helpers::{mod_path_to_ast, FamousDefs}; | ||
6 | use itertools::Itertools; | 6 | use itertools::Itertools; |
7 | use syntax::ast::{self, make, AstNode, MatchArm, NameOwner, Pat}; | 7 | use syntax::ast::{self, make, AstNode, MatchArm, NameOwner, Pat}; |
8 | use test_utils::mark; | 8 | use test_utils::mark; |
@@ -213,7 +213,7 @@ fn build_pat(db: &RootDatabase, module: hir::Module, var: hir::EnumVariant) -> O | |||
213 | 213 | ||
214 | #[cfg(test)] | 214 | #[cfg(test)] |
215 | mod tests { | 215 | mod tests { |
216 | use ide_helpers::FamousDefs; | 216 | use ide_db::helpers::FamousDefs; |
217 | use test_utils::mark; | 217 | use test_utils::mark; |
218 | 218 | ||
219 | use crate::tests::{check_assist, check_assist_not_applicable, check_assist_target}; | 219 | use crate::tests::{check_assist, check_assist_not_applicable, check_assist_target}; |
diff --git a/crates/assists/src/handlers/generate_from_impl_for_enum.rs b/crates/assists/src/handlers/generate_from_impl_for_enum.rs index 01b14d94d..3c374e5d9 100644 --- a/crates/assists/src/handlers/generate_from_impl_for_enum.rs +++ b/crates/assists/src/handlers/generate_from_impl_for_enum.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ide_db::helpers::FamousDefs; | ||
1 | use ide_db::RootDatabase; | 2 | use ide_db::RootDatabase; |
2 | use ide_helpers::FamousDefs; | ||
3 | use syntax::ast::{self, AstNode, NameOwner}; | 3 | use syntax::ast::{self, AstNode, NameOwner}; |
4 | use test_utils::mark; | 4 | use test_utils::mark; |
5 | 5 | ||
diff --git a/crates/assists/src/handlers/merge_imports.rs b/crates/assists/src/handlers/merge_imports.rs index 8207f0e6e..b7e853994 100644 --- a/crates/assists/src/handlers/merge_imports.rs +++ b/crates/assists/src/handlers/merge_imports.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ide_helpers::insert_use::{try_merge_imports, try_merge_trees, MergeBehaviour}; | 1 | use ide_db::helpers::insert_use::{try_merge_imports, try_merge_trees, MergeBehaviour}; |
2 | use syntax::{ | 2 | use syntax::{ |
3 | algo::{neighbor, SyntaxRewriter}, | 3 | algo::{neighbor, SyntaxRewriter}, |
4 | ast, AstNode, | 4 | ast, AstNode, |
diff --git a/crates/assists/src/handlers/qualify_path.rs b/crates/assists/src/handlers/qualify_path.rs index c0ee7ea0b..6f9810fe8 100644 --- a/crates/assists/src/handlers/qualify_path.rs +++ b/crates/assists/src/handlers/qualify_path.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | use std::iter; | 1 | use std::iter; |
2 | 2 | ||
3 | use hir::AsName; | 3 | use hir::AsName; |
4 | use ide_db::helpers::mod_path_to_ast; | ||
4 | use ide_db::RootDatabase; | 5 | use ide_db::RootDatabase; |
5 | use ide_helpers::mod_path_to_ast; | ||
6 | use syntax::{ | 6 | use syntax::{ |
7 | ast, | 7 | ast, |
8 | ast::{make, ArgListOwner}, | 8 | ast::{make, ArgListOwner}, |
diff --git a/crates/assists/src/handlers/replace_derive_with_manual_impl.rs b/crates/assists/src/handlers/replace_derive_with_manual_impl.rs index fe262377c..4d6a1956b 100644 --- a/crates/assists/src/handlers/replace_derive_with_manual_impl.rs +++ b/crates/assists/src/handlers/replace_derive_with_manual_impl.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ide_db::helpers::mod_path_to_ast; | ||
1 | use ide_db::imports_locator; | 2 | use ide_db::imports_locator; |
2 | use ide_helpers::mod_path_to_ast; | ||
3 | use itertools::Itertools; | 3 | use itertools::Itertools; |
4 | use syntax::{ | 4 | use syntax::{ |
5 | ast::{self, make, AstNode}, | 5 | ast::{self, make, AstNode}, |
diff --git a/crates/assists/src/handlers/replace_qualified_name_with_use.rs b/crates/assists/src/handlers/replace_qualified_name_with_use.rs index 5e5c41a6f..8bdf9eea5 100644 --- a/crates/assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/assists/src/handlers/replace_qualified_name_with_use.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ide_helpers::insert_use::{insert_use, ImportScope}; | 1 | use ide_db::helpers::insert_use::{insert_use, ImportScope}; |
2 | use syntax::{algo::SyntaxRewriter, ast, match_ast, AstNode, SyntaxNode}; | 2 | use syntax::{algo::SyntaxRewriter, ast, match_ast, AstNode, SyntaxNode}; |
3 | use test_utils::mark; | 3 | use test_utils::mark; |
4 | 4 | ||
diff --git a/crates/completion/Cargo.toml b/crates/completion/Cargo.toml index 102de33f8..35e169a28 100644 --- a/crates/completion/Cargo.toml +++ b/crates/completion/Cargo.toml | |||
@@ -22,7 +22,6 @@ base_db = { path = "../base_db", version = "0.0.0" } | |||
22 | ide_db = { path = "../ide_db", version = "0.0.0" } | 22 | ide_db = { path = "../ide_db", version = "0.0.0" } |
23 | profile = { path = "../profile", version = "0.0.0" } | 23 | profile = { path = "../profile", version = "0.0.0" } |
24 | test_utils = { path = "../test_utils", version = "0.0.0" } | 24 | test_utils = { path = "../test_utils", version = "0.0.0" } |
25 | ide_helpers = { path = "../ide_helpers", version = "0.0.0" } | ||
26 | 25 | ||
27 | # completions crate should depend only on the top-level `hir` package. if you need | 26 | # completions crate should depend only on the top-level `hir` package. if you need |
28 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. | 27 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. |
diff --git a/crates/completion/src/completions/record.rs b/crates/completion/src/completions/record.rs index 218a1923c..eaa44c97d 100644 --- a/crates/completion/src/completions/record.rs +++ b/crates/completion/src/completions/record.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | //! Complete fields in record literals and patterns. | 1 | //! Complete fields in record literals and patterns. |
2 | use ide_helpers::FamousDefs; | 2 | use ide_db::helpers::FamousDefs; |
3 | use syntax::ast::Expr; | 3 | use syntax::ast::Expr; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
@@ -46,7 +46,7 @@ pub(crate) fn complete_record(acc: &mut Completions, ctx: &CompletionContext) -> | |||
46 | #[cfg(test)] | 46 | #[cfg(test)] |
47 | mod tests { | 47 | mod tests { |
48 | use expect_test::{expect, Expect}; | 48 | use expect_test::{expect, Expect}; |
49 | use ide_helpers::FamousDefs; | 49 | use ide_db::helpers::FamousDefs; |
50 | 50 | ||
51 | use crate::{test_utils::completion_list, CompletionKind}; | 51 | use crate::{test_utils::completion_list, CompletionKind}; |
52 | 52 | ||
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index db5dbb7dd..81691cd7f 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | use either::Either; | 3 | use either::Either; |
4 | use hir::{Adt, ModuleDef, ScopeDef, Type}; | 4 | use hir::{Adt, ModuleDef, ScopeDef, Type}; |
5 | use ide_db::helpers::insert_use::ImportScope; | ||
5 | use ide_db::imports_locator; | 6 | use ide_db::imports_locator; |
6 | use ide_helpers::insert_use::ImportScope; | ||
7 | use syntax::AstNode; | 7 | use syntax::AstNode; |
8 | use test_utils::mark; | 8 | use test_utils::mark; |
9 | 9 | ||
diff --git a/crates/completion/src/config.rs b/crates/completion/src/config.rs index 1995b0754..654a76f7b 100644 --- a/crates/completion/src/config.rs +++ b/crates/completion/src/config.rs | |||
@@ -4,7 +4,7 @@ | |||
4 | //! module, and we use to statically check that we only produce snippet | 4 | //! module, and we use to statically check that we only produce snippet |
5 | //! completions if we are allowed to. | 5 | //! completions if we are allowed to. |
6 | 6 | ||
7 | use ide_helpers::insert_use::MergeBehaviour; | 7 | use ide_db::helpers::insert_use::MergeBehaviour; |
8 | 8 | ||
9 | #[derive(Clone, Debug, PartialEq, Eq)] | 9 | #[derive(Clone, Debug, PartialEq, Eq)] |
10 | pub struct CompletionConfig { | 10 | pub struct CompletionConfig { |
diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs index 3bfee1b3f..e85549fef 100644 --- a/crates/completion/src/item.rs +++ b/crates/completion/src/item.rs | |||
@@ -3,7 +3,7 @@ | |||
3 | use std::fmt; | 3 | use std::fmt; |
4 | 4 | ||
5 | use hir::{Documentation, ModPath, Mutability}; | 5 | use hir::{Documentation, ModPath, Mutability}; |
6 | use ide_helpers::{ | 6 | use ide_db::helpers::{ |
7 | insert_use::{self, ImportScope, MergeBehaviour}, | 7 | insert_use::{self, ImportScope, MergeBehaviour}, |
8 | mod_path_to_ast, | 8 | mod_path_to_ast, |
9 | }; | 9 | }; |
diff --git a/crates/completion/src/render.rs b/crates/completion/src/render.rs index e84aef0e4..504757a6a 100644 --- a/crates/completion/src/render.rs +++ b/crates/completion/src/render.rs | |||
@@ -10,8 +10,8 @@ pub(crate) mod type_alias; | |||
10 | mod builder_ext; | 10 | mod builder_ext; |
11 | 11 | ||
12 | use hir::{Documentation, HasAttrs, HirDisplay, ModPath, Mutability, ScopeDef, Type}; | 12 | use hir::{Documentation, HasAttrs, HirDisplay, ModPath, Mutability, ScopeDef, Type}; |
13 | use ide_db::helpers::insert_use::{ImportScope, MergeBehaviour}; | ||
13 | use ide_db::RootDatabase; | 14 | use ide_db::RootDatabase; |
14 | use ide_helpers::insert_use::{ImportScope, MergeBehaviour}; | ||
15 | use syntax::TextRange; | 15 | use syntax::TextRange; |
16 | use test_utils::mark; | 16 | use test_utils::mark; |
17 | 17 | ||
diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index 92d4e5e9f..4d483580d 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml | |||
@@ -24,7 +24,6 @@ stdx = { path = "../stdx", version = "0.0.0" } | |||
24 | syntax = { path = "../syntax", version = "0.0.0" } | 24 | syntax = { path = "../syntax", version = "0.0.0" } |
25 | text_edit = { path = "../text_edit", version = "0.0.0" } | 25 | text_edit = { path = "../text_edit", version = "0.0.0" } |
26 | ide_db = { path = "../ide_db", version = "0.0.0" } | 26 | ide_db = { path = "../ide_db", version = "0.0.0" } |
27 | ide_helpers = { path = "../ide_helpers", version = "0.0.0" } | ||
28 | cfg = { path = "../cfg", version = "0.0.0" } | 27 | cfg = { path = "../cfg", version = "0.0.0" } |
29 | profile = { path = "../profile", version = "0.0.0" } | 28 | profile = { path = "../profile", version = "0.0.0" } |
30 | test_utils = { path = "../test_utils", version = "0.0.0" } | 29 | test_utils = { path = "../test_utils", version = "0.0.0" } |
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 9c8bb7c45..65df7979c 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use either::Either; | 1 | use either::Either; |
2 | use hir::{known, Callable, HirDisplay, Semantics}; | 2 | use hir::{known, Callable, HirDisplay, Semantics}; |
3 | use ide_db::helpers::FamousDefs; | ||
3 | use ide_db::RootDatabase; | 4 | use ide_db::RootDatabase; |
4 | use ide_helpers::FamousDefs; | ||
5 | use stdx::to_lower_snake_case; | 5 | use stdx::to_lower_snake_case; |
6 | use syntax::{ | 6 | use syntax::{ |
7 | ast::{self, ArgListOwner, AstNode, NameOwner}, | 7 | ast::{self, ArgListOwner, AstNode, NameOwner}, |
@@ -428,7 +428,7 @@ fn get_callable(sema: &Semantics<RootDatabase>, expr: &ast::Expr) -> Option<hir: | |||
428 | #[cfg(test)] | 428 | #[cfg(test)] |
429 | mod tests { | 429 | mod tests { |
430 | use expect_test::{expect, Expect}; | 430 | use expect_test::{expect, Expect}; |
431 | use ide_helpers::FamousDefs; | 431 | use ide_db::helpers::FamousDefs; |
432 | use test_utils::extract_annotations; | 432 | use test_utils::extract_annotations; |
433 | 433 | ||
434 | use crate::{fixture, inlay_hints::InlayHintsConfig}; | 434 | use crate::{fixture, inlay_hints::InlayHintsConfig}; |
diff --git a/crates/ide_db/Cargo.toml b/crates/ide_db/Cargo.toml index 72a9212f1..0ad6e1000 100644 --- a/crates/ide_db/Cargo.toml +++ b/crates/ide_db/Cargo.toml | |||
@@ -18,7 +18,8 @@ rayon = "1.5.0" | |||
18 | fst = { version = "0.4", default-features = false } | 18 | fst = { version = "0.4", default-features = false } |
19 | rustc-hash = "1.1.0" | 19 | rustc-hash = "1.1.0" |
20 | once_cell = "1.3.1" | 20 | once_cell = "1.3.1" |
21 | either = "1.5.3" | 21 | either = "1.6.1" |
22 | itertools = "0.9.0" | ||
22 | 23 | ||
23 | stdx = { path = "../stdx", version = "0.0.0" } | 24 | stdx = { path = "../stdx", version = "0.0.0" } |
24 | syntax = { path = "../syntax", version = "0.0.0" } | 25 | syntax = { path = "../syntax", version = "0.0.0" } |
diff --git a/crates/ide_helpers/src/lib.rs b/crates/ide_db/src/helpers.rs index ad4404b19..d988588ff 100644 --- a/crates/ide_helpers/src/lib.rs +++ b/crates/ide_db/src/helpers.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! A module with ide helpers for high-level ide features. | 1 | //! A module with ide helpers for high-level ide features. |
2 | use crate::RootDatabase; | ||
2 | use hir::{Crate, Enum, Module, ScopeDef, Semantics, Trait}; | 3 | use hir::{Crate, Enum, Module, ScopeDef, Semantics, Trait}; |
3 | use ide_db::RootDatabase; | ||
4 | use syntax::ast::{self, make}; | 4 | use syntax::ast::{self, make}; |
5 | 5 | ||
6 | pub mod insert_use; | 6 | pub mod insert_use; |
diff --git a/crates/ide_helpers/src/insert_use.rs b/crates/ide_db/src/helpers/insert_use.rs index 795009eb1..67e800fad 100644 --- a/crates/ide_helpers/src/insert_use.rs +++ b/crates/ide_db/src/helpers/insert_use.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | //! Handle syntactic aspects of inserting a new `use`. | 1 | //! Handle syntactic aspects of inserting a new `use`. |
2 | use std::{cmp::Ordering, iter::successors}; | 2 | use std::{cmp::Ordering, iter::successors}; |
3 | 3 | ||
4 | use crate::RootDatabase; | ||
4 | use hir::Semantics; | 5 | use hir::Semantics; |
5 | use ide_db::RootDatabase; | ||
6 | use itertools::{EitherOrBoth, Itertools}; | 6 | use itertools::{EitherOrBoth, Itertools}; |
7 | use syntax::{ | 7 | use syntax::{ |
8 | algo::SyntaxRewriter, | 8 | algo::SyntaxRewriter, |
diff --git a/crates/ide_db/src/lib.rs b/crates/ide_db/src/lib.rs index 05139a651..fceaa089a 100644 --- a/crates/ide_db/src/lib.rs +++ b/crates/ide_db/src/lib.rs | |||
@@ -13,6 +13,7 @@ pub mod source_change; | |||
13 | pub mod ty_filter; | 13 | pub mod ty_filter; |
14 | pub mod traits; | 14 | pub mod traits; |
15 | pub mod call_info; | 15 | pub mod call_info; |
16 | pub mod helpers; | ||
16 | 17 | ||
17 | use std::{fmt, sync::Arc}; | 18 | use std::{fmt, sync::Arc}; |
18 | 19 | ||
diff --git a/crates/ide_helpers/Cargo.toml b/crates/ide_helpers/Cargo.toml deleted file mode 100644 index c5065b22b..000000000 --- a/crates/ide_helpers/Cargo.toml +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | [package] | ||
2 | name = "ide_helpers" | ||
3 | version = "0.0.0" | ||
4 | description = "A set of helper methods shared between various ide-level modules" | ||
5 | license = "MIT OR Apache-2.0" | ||
6 | authors = ["rust-analyzer developers"] | ||
7 | edition = "2018" | ||
8 | |||
9 | [lib] | ||
10 | doctest = false | ||
11 | |||
12 | [features] | ||
13 | wasm = [] | ||
14 | |||
15 | [dependencies] | ||
16 | either = "1.6.1" | ||
17 | itertools = "0.9.0" | ||
18 | |||
19 | syntax = { path = "../syntax", version = "0.0.0" } | ||
20 | ide_db = { path = "../ide_db", version = "0.0.0" } | ||
21 | hir = { path = "../hir", version = "0.0.0" } | ||
22 | profile = { path = "../profile", version = "0.0.0" } | ||
23 | test_utils = { path = "../test_utils", version = "0.0.0" } | ||
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 3afcd2eda..08559b53a 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -39,7 +39,7 @@ tracing-tree = { version = "0.1.4" } | |||
39 | stdx = { path = "../stdx", version = "0.0.0" } | 39 | stdx = { path = "../stdx", version = "0.0.0" } |
40 | flycheck = { path = "../flycheck", version = "0.0.0" } | 40 | flycheck = { path = "../flycheck", version = "0.0.0" } |
41 | ide = { path = "../ide", version = "0.0.0" } | 41 | ide = { path = "../ide", version = "0.0.0" } |
42 | ide_helpers = { path = "../ide_helpers", version = "0.0.0" } | 42 | ide_db = { path = "../ide_db", version = "0.0.0" } |
43 | profile = { path = "../profile", version = "0.0.0" } | 43 | profile = { path = "../profile", version = "0.0.0" } |
44 | project_model = { path = "../project_model", version = "0.0.0" } | 44 | project_model = { path = "../project_model", version = "0.0.0" } |
45 | syntax = { path = "../syntax", version = "0.0.0" } | 45 | syntax = { path = "../syntax", version = "0.0.0" } |
@@ -50,7 +50,6 @@ cfg = { path = "../cfg", version = "0.0.0" } | |||
50 | toolchain = { path = "../toolchain", version = "0.0.0" } | 50 | toolchain = { path = "../toolchain", version = "0.0.0" } |
51 | 51 | ||
52 | # This should only be used in CLI | 52 | # This should only be used in CLI |
53 | ide_db = { path = "../ide_db", version = "0.0.0" } | ||
54 | ssr = { path = "../ssr", version = "0.0.0" } | 53 | ssr = { path = "../ssr", version = "0.0.0" } |
55 | hir = { path = "../hir", version = "0.0.0" } | 54 | hir = { path = "../hir", version = "0.0.0" } |
56 | hir_def = { path = "../hir_def", version = "0.0.0" } | 55 | hir_def = { path = "../hir_def", version = "0.0.0" } |
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index d7b711f94..30299a465 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs | |||
@@ -12,7 +12,7 @@ use std::{convert::TryFrom, ffi::OsString, path::PathBuf}; | |||
12 | use flycheck::FlycheckConfig; | 12 | use flycheck::FlycheckConfig; |
13 | use hir::PrefixKind; | 13 | use hir::PrefixKind; |
14 | use ide::{AssistConfig, CompletionConfig, DiagnosticsConfig, HoverConfig, InlayHintsConfig}; | 14 | use ide::{AssistConfig, CompletionConfig, DiagnosticsConfig, HoverConfig, InlayHintsConfig}; |
15 | use ide_helpers::insert_use::MergeBehaviour; | 15 | use ide_db::helpers::insert_use::MergeBehaviour; |
16 | use lsp_types::{ClientCapabilities, MarkupKind}; | 16 | use lsp_types::{ClientCapabilities, MarkupKind}; |
17 | use project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest}; | 17 | use project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest}; |
18 | use rustc_hash::FxHashSet; | 18 | use rustc_hash::FxHashSet; |