diff options
-rw-r--r-- | Cargo.lock | 40 | ||||
-rw-r--r-- | crates/ide/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ide/src/lib.rs | 8 | ||||
-rw-r--r-- | crates/ide_completion/Cargo.toml (renamed from crates/completion/Cargo.toml) | 2 | ||||
-rw-r--r-- | crates/ide_completion/src/completions.rs (renamed from crates/completion/src/completions.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/attribute.rs (renamed from crates/completion/src/completions/attribute.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/dot.rs (renamed from crates/completion/src/completions/dot.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/flyimport.rs (renamed from crates/completion/src/completions/flyimport.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/fn_param.rs (renamed from crates/completion/src/completions/fn_param.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/keyword.rs (renamed from crates/completion/src/completions/keyword.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/macro_in_item_position.rs (renamed from crates/completion/src/completions/macro_in_item_position.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/mod_.rs (renamed from crates/completion/src/completions/mod_.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/pattern.rs (renamed from crates/completion/src/completions/pattern.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/postfix.rs (renamed from crates/completion/src/completions/postfix.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/postfix/format_like.rs (renamed from crates/completion/src/completions/postfix/format_like.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/qualified_path.rs (renamed from crates/completion/src/completions/qualified_path.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/record.rs (renamed from crates/completion/src/completions/record.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/snippet.rs (renamed from crates/completion/src/completions/snippet.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/trait_impl.rs (renamed from crates/completion/src/completions/trait_impl.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/unqualified_path.rs (renamed from crates/completion/src/completions/unqualified_path.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/config.rs (renamed from crates/completion/src/config.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/context.rs (renamed from crates/completion/src/context.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/generated_lint_completions.rs (renamed from crates/completion/src/generated_lint_completions.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/item.rs (renamed from crates/completion/src/item.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/lib.rs (renamed from crates/completion/src/lib.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/patterns.rs (renamed from crates/completion/src/patterns.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render.rs (renamed from crates/completion/src/render.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render/builder_ext.rs (renamed from crates/completion/src/render/builder_ext.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render/const_.rs (renamed from crates/completion/src/render/const_.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render/enum_variant.rs (renamed from crates/completion/src/render/enum_variant.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render/function.rs (renamed from crates/completion/src/render/function.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render/macro_.rs (renamed from crates/completion/src/render/macro_.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render/pattern.rs (renamed from crates/completion/src/render/pattern.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/render/type_alias.rs (renamed from crates/completion/src/render/type_alias.rs) | 0 | ||||
-rw-r--r-- | crates/ide_completion/src/test_utils.rs (renamed from crates/completion/src/test_utils.rs) | 0 | ||||
-rw-r--r-- | xtask/src/codegen/gen_lint_completions.rs | 3 | ||||
-rw-r--r-- | xtask/tests/tidy.rs | 10 |
37 files changed, 33 insertions, 32 deletions
diff --git a/Cargo.lock b/Cargo.lock index ae25ad764..f672225c6 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -246,25 +246,6 @@ dependencies = [ | |||
246 | ] | 246 | ] |
247 | 247 | ||
248 | [[package]] | 248 | [[package]] |
249 | name = "completion" | ||
250 | version = "0.0.0" | ||
251 | dependencies = [ | ||
252 | "base_db", | ||
253 | "either", | ||
254 | "expect-test", | ||
255 | "hir", | ||
256 | "ide_db", | ||
257 | "itertools 0.10.0", | ||
258 | "log", | ||
259 | "profile", | ||
260 | "rustc-hash", | ||
261 | "stdx", | ||
262 | "syntax", | ||
263 | "test_utils", | ||
264 | "text_edit", | ||
265 | ] | ||
266 | |||
267 | [[package]] | ||
268 | name = "const_fn" | 249 | name = "const_fn" |
269 | version = "0.4.5" | 250 | version = "0.4.5" |
270 | source = "registry+https://github.com/rust-lang/crates.io-index" | 251 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -613,10 +594,10 @@ version = "0.0.0" | |||
613 | dependencies = [ | 594 | dependencies = [ |
614 | "assists", | 595 | "assists", |
615 | "cfg", | 596 | "cfg", |
616 | "completion", | ||
617 | "either", | 597 | "either", |
618 | "expect-test", | 598 | "expect-test", |
619 | "hir", | 599 | "hir", |
600 | "ide_completion", | ||
620 | "ide_db", | 601 | "ide_db", |
621 | "indexmap", | 602 | "indexmap", |
622 | "itertools 0.10.0", | 603 | "itertools 0.10.0", |
@@ -635,6 +616,25 @@ dependencies = [ | |||
635 | ] | 616 | ] |
636 | 617 | ||
637 | [[package]] | 618 | [[package]] |
619 | name = "ide_completion" | ||
620 | version = "0.0.0" | ||
621 | dependencies = [ | ||
622 | "base_db", | ||
623 | "either", | ||
624 | "expect-test", | ||
625 | "hir", | ||
626 | "ide_db", | ||
627 | "itertools 0.10.0", | ||
628 | "log", | ||
629 | "profile", | ||
630 | "rustc-hash", | ||
631 | "stdx", | ||
632 | "syntax", | ||
633 | "test_utils", | ||
634 | "text_edit", | ||
635 | ] | ||
636 | |||
637 | [[package]] | ||
638 | name = "ide_db" | 638 | name = "ide_db" |
639 | version = "0.0.0" | 639 | version = "0.0.0" |
640 | dependencies = [ | 640 | dependencies = [ |
diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index bb28cca4d..3cbe3a397 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml | |||
@@ -29,7 +29,7 @@ profile = { path = "../profile", version = "0.0.0" } | |||
29 | test_utils = { path = "../test_utils", version = "0.0.0" } | 29 | test_utils = { path = "../test_utils", version = "0.0.0" } |
30 | assists = { path = "../assists", version = "0.0.0" } | 30 | assists = { path = "../assists", version = "0.0.0" } |
31 | ssr = { path = "../ssr", version = "0.0.0" } | 31 | ssr = { path = "../ssr", version = "0.0.0" } |
32 | completion = { path = "../completion", version = "0.0.0" } | 32 | ide_completion = { path = "../ide_completion", version = "0.0.0" } |
33 | 33 | ||
34 | # ide should depend only on the top-level `hir` package. if you need | 34 | # ide should depend only on the top-level `hir` package. if you need |
35 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. | 35 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. |
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index a2c8db505..f47ec61fe 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -83,11 +83,11 @@ pub use crate::{ | |||
83 | }, | 83 | }, |
84 | }; | 84 | }; |
85 | pub use assists::{Assist, AssistConfig, AssistId, AssistKind}; | 85 | pub use assists::{Assist, AssistConfig, AssistId, AssistKind}; |
86 | pub use completion::{ | 86 | pub use hir::{Documentation, Semantics}; |
87 | pub use ide_completion::{ | ||
87 | CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, ImportEdit, | 88 | CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, ImportEdit, |
88 | InsertTextFormat, | 89 | InsertTextFormat, |
89 | }; | 90 | }; |
90 | pub use hir::{Documentation, Semantics}; | ||
91 | pub use ide_db::{ | 91 | pub use ide_db::{ |
92 | base_db::{ | 92 | base_db::{ |
93 | Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, | 93 | Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, |
@@ -468,7 +468,7 @@ impl Analysis { | |||
468 | config: &CompletionConfig, | 468 | config: &CompletionConfig, |
469 | position: FilePosition, | 469 | position: FilePosition, |
470 | ) -> Cancelable<Option<Vec<CompletionItem>>> { | 470 | ) -> Cancelable<Option<Vec<CompletionItem>>> { |
471 | self.with_db(|db| completion::completions(db, config, position).map(Into::into)) | 471 | self.with_db(|db| ide_completion::completions(db, config, position).map(Into::into)) |
472 | } | 472 | } |
473 | 473 | ||
474 | /// Resolves additional completion data at the position given. | 474 | /// Resolves additional completion data at the position given. |
@@ -482,7 +482,7 @@ impl Analysis { | |||
482 | ) -> Cancelable<Vec<TextEdit>> { | 482 | ) -> Cancelable<Vec<TextEdit>> { |
483 | Ok(self | 483 | Ok(self |
484 | .with_db(|db| { | 484 | .with_db(|db| { |
485 | completion::resolve_completion_edits( | 485 | ide_completion::resolve_completion_edits( |
486 | db, | 486 | db, |
487 | config, | 487 | config, |
488 | position, | 488 | position, |
diff --git a/crates/completion/Cargo.toml b/crates/ide_completion/Cargo.toml index 99a1bdd54..c09101ccb 100644 --- a/crates/completion/Cargo.toml +++ b/crates/ide_completion/Cargo.toml | |||
@@ -1,5 +1,5 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "completion" | 2 | name = "ide_completion" |
3 | version = "0.0.0" | 3 | version = "0.0.0" |
4 | description = "TBD" | 4 | description = "TBD" |
5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
diff --git a/crates/completion/src/completions.rs b/crates/ide_completion/src/completions.rs index 3b582ed07..3b582ed07 100644 --- a/crates/completion/src/completions.rs +++ b/crates/ide_completion/src/completions.rs | |||
diff --git a/crates/completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs index ab25a8c58..ab25a8c58 100644 --- a/crates/completion/src/completions/attribute.rs +++ b/crates/ide_completion/src/completions/attribute.rs | |||
diff --git a/crates/completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs index 0880a3830..0880a3830 100644 --- a/crates/completion/src/completions/dot.rs +++ b/crates/ide_completion/src/completions/dot.rs | |||
diff --git a/crates/completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs index c9f928483..c9f928483 100644 --- a/crates/completion/src/completions/flyimport.rs +++ b/crates/ide_completion/src/completions/flyimport.rs | |||
diff --git a/crates/completion/src/completions/fn_param.rs b/crates/ide_completion/src/completions/fn_param.rs index 38e33a93e..38e33a93e 100644 --- a/crates/completion/src/completions/fn_param.rs +++ b/crates/ide_completion/src/completions/fn_param.rs | |||
diff --git a/crates/completion/src/completions/keyword.rs b/crates/ide_completion/src/completions/keyword.rs index eb81f9765..eb81f9765 100644 --- a/crates/completion/src/completions/keyword.rs +++ b/crates/ide_completion/src/completions/keyword.rs | |||
diff --git a/crates/completion/src/completions/macro_in_item_position.rs b/crates/ide_completion/src/completions/macro_in_item_position.rs index 2be299ac2..2be299ac2 100644 --- a/crates/completion/src/completions/macro_in_item_position.rs +++ b/crates/ide_completion/src/completions/macro_in_item_position.rs | |||
diff --git a/crates/completion/src/completions/mod_.rs b/crates/ide_completion/src/completions/mod_.rs index 352fc7c77..352fc7c77 100644 --- a/crates/completion/src/completions/mod_.rs +++ b/crates/ide_completion/src/completions/mod_.rs | |||
diff --git a/crates/completion/src/completions/pattern.rs b/crates/ide_completion/src/completions/pattern.rs index 9282c3827..9282c3827 100644 --- a/crates/completion/src/completions/pattern.rs +++ b/crates/ide_completion/src/completions/pattern.rs | |||
diff --git a/crates/completion/src/completions/postfix.rs b/crates/ide_completion/src/completions/postfix.rs index 9c34ed0b6..9c34ed0b6 100644 --- a/crates/completion/src/completions/postfix.rs +++ b/crates/ide_completion/src/completions/postfix.rs | |||
diff --git a/crates/completion/src/completions/postfix/format_like.rs b/crates/ide_completion/src/completions/postfix/format_like.rs index 3afc63021..3afc63021 100644 --- a/crates/completion/src/completions/postfix/format_like.rs +++ b/crates/ide_completion/src/completions/postfix/format_like.rs | |||
diff --git a/crates/completion/src/completions/qualified_path.rs b/crates/ide_completion/src/completions/qualified_path.rs index 2afa6979e..2afa6979e 100644 --- a/crates/completion/src/completions/qualified_path.rs +++ b/crates/ide_completion/src/completions/qualified_path.rs | |||
diff --git a/crates/completion/src/completions/record.rs b/crates/ide_completion/src/completions/record.rs index 0a7927eb8..0a7927eb8 100644 --- a/crates/completion/src/completions/record.rs +++ b/crates/ide_completion/src/completions/record.rs | |||
diff --git a/crates/completion/src/completions/snippet.rs b/crates/ide_completion/src/completions/snippet.rs index df17a15c5..df17a15c5 100644 --- a/crates/completion/src/completions/snippet.rs +++ b/crates/ide_completion/src/completions/snippet.rs | |||
diff --git a/crates/completion/src/completions/trait_impl.rs b/crates/ide_completion/src/completions/trait_impl.rs index b999540b8..b999540b8 100644 --- a/crates/completion/src/completions/trait_impl.rs +++ b/crates/ide_completion/src/completions/trait_impl.rs | |||
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs index e9d0ff665..e9d0ff665 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/ide_completion/src/completions/unqualified_path.rs | |||
diff --git a/crates/completion/src/config.rs b/crates/ide_completion/src/config.rs index d70ed6c1c..d70ed6c1c 100644 --- a/crates/completion/src/config.rs +++ b/crates/ide_completion/src/config.rs | |||
diff --git a/crates/completion/src/context.rs b/crates/ide_completion/src/context.rs index 3db357855..3db357855 100644 --- a/crates/completion/src/context.rs +++ b/crates/ide_completion/src/context.rs | |||
diff --git a/crates/completion/src/generated_lint_completions.rs b/crates/ide_completion/src/generated_lint_completions.rs index 87df7f1c9..87df7f1c9 100644 --- a/crates/completion/src/generated_lint_completions.rs +++ b/crates/ide_completion/src/generated_lint_completions.rs | |||
diff --git a/crates/completion/src/item.rs b/crates/ide_completion/src/item.rs index 884711f11..884711f11 100644 --- a/crates/completion/src/item.rs +++ b/crates/ide_completion/src/item.rs | |||
diff --git a/crates/completion/src/lib.rs b/crates/ide_completion/src/lib.rs index db8bfbbc3..db8bfbbc3 100644 --- a/crates/completion/src/lib.rs +++ b/crates/ide_completion/src/lib.rs | |||
diff --git a/crates/completion/src/patterns.rs b/crates/ide_completion/src/patterns.rs index f3ce91dd1..f3ce91dd1 100644 --- a/crates/completion/src/patterns.rs +++ b/crates/ide_completion/src/patterns.rs | |||
diff --git a/crates/completion/src/render.rs b/crates/ide_completion/src/render.rs index eddaaa6f3..eddaaa6f3 100644 --- a/crates/completion/src/render.rs +++ b/crates/ide_completion/src/render.rs | |||
diff --git a/crates/completion/src/render/builder_ext.rs b/crates/ide_completion/src/render/builder_ext.rs index d053a988b..d053a988b 100644 --- a/crates/completion/src/render/builder_ext.rs +++ b/crates/ide_completion/src/render/builder_ext.rs | |||
diff --git a/crates/completion/src/render/const_.rs b/crates/ide_completion/src/render/const_.rs index 5010b642a..5010b642a 100644 --- a/crates/completion/src/render/const_.rs +++ b/crates/ide_completion/src/render/const_.rs | |||
diff --git a/crates/completion/src/render/enum_variant.rs b/crates/ide_completion/src/render/enum_variant.rs index 9214193b4..9214193b4 100644 --- a/crates/completion/src/render/enum_variant.rs +++ b/crates/ide_completion/src/render/enum_variant.rs | |||
diff --git a/crates/completion/src/render/function.rs b/crates/ide_completion/src/render/function.rs index e46e21d24..e46e21d24 100644 --- a/crates/completion/src/render/function.rs +++ b/crates/ide_completion/src/render/function.rs | |||
diff --git a/crates/completion/src/render/macro_.rs b/crates/ide_completion/src/render/macro_.rs index a4535786f..a4535786f 100644 --- a/crates/completion/src/render/macro_.rs +++ b/crates/ide_completion/src/render/macro_.rs | |||
diff --git a/crates/completion/src/render/pattern.rs b/crates/ide_completion/src/render/pattern.rs index 465dfe00c..465dfe00c 100644 --- a/crates/completion/src/render/pattern.rs +++ b/crates/ide_completion/src/render/pattern.rs | |||
diff --git a/crates/completion/src/render/type_alias.rs b/crates/ide_completion/src/render/type_alias.rs index bd97c3692..bd97c3692 100644 --- a/crates/completion/src/render/type_alias.rs +++ b/crates/ide_completion/src/render/type_alias.rs | |||
diff --git a/crates/completion/src/test_utils.rs b/crates/ide_completion/src/test_utils.rs index baff83305..baff83305 100644 --- a/crates/completion/src/test_utils.rs +++ b/crates/ide_completion/src/test_utils.rs | |||
diff --git a/xtask/src/codegen/gen_lint_completions.rs b/xtask/src/codegen/gen_lint_completions.rs index b97421217..25f770eaf 100644 --- a/xtask/src/codegen/gen_lint_completions.rs +++ b/xtask/src/codegen/gen_lint_completions.rs | |||
@@ -26,7 +26,8 @@ pub fn generate_lint_completions(mode: Mode) -> Result<()> { | |||
26 | }; | 26 | }; |
27 | let contents = reformat(ts.to_string().as_str())?; | 27 | let contents = reformat(ts.to_string().as_str())?; |
28 | 28 | ||
29 | let destination = project_root().join("crates/completion/src/generated_lint_completions.rs"); | 29 | let destination = |
30 | project_root().join("crates/ide_completion/src/generated_lint_completions.rs"); | ||
30 | update(destination.as_path(), &contents, mode)?; | 31 | update(destination.as_path(), &contents, mode)?; |
31 | run_rustfmt(mode)?; | 32 | run_rustfmt(mode)?; |
32 | 33 | ||
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index cb83e07fd..909c52afa 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs | |||
@@ -172,7 +172,7 @@ https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/#redo-after- | |||
172 | fn deny_clippy(path: &PathBuf, text: &String) { | 172 | fn deny_clippy(path: &PathBuf, text: &String) { |
173 | let ignore = &[ | 173 | let ignore = &[ |
174 | // The documentation in string literals may contain anything for its own purposes | 174 | // The documentation in string literals may contain anything for its own purposes |
175 | "completion/src/generated_lint_completions.rs", | 175 | "ide_completion/src/generated_lint_completions.rs", |
176 | ]; | 176 | ]; |
177 | if ignore.iter().any(|p| path.ends_with(p)) { | 177 | if ignore.iter().any(|p| path.ends_with(p)) { |
178 | return; | 178 | return; |
@@ -259,7 +259,7 @@ fn check_todo(path: &Path, text: &str) { | |||
259 | // `ast::make`. | 259 | // `ast::make`. |
260 | "ast/make.rs", | 260 | "ast/make.rs", |
261 | // The documentation in string literals may contain anything for its own purposes | 261 | // The documentation in string literals may contain anything for its own purposes |
262 | "completion/src/generated_lint_completions.rs", | 262 | "ide_completion/src/generated_lint_completions.rs", |
263 | ]; | 263 | ]; |
264 | if need_todo.iter().any(|p| path.ends_with(p)) { | 264 | if need_todo.iter().any(|p| path.ends_with(p)) { |
265 | return; | 265 | return; |
@@ -286,10 +286,10 @@ fn check_dbg(path: &Path, text: &str) { | |||
286 | // Assists to remove `dbg!()` | 286 | // Assists to remove `dbg!()` |
287 | "handlers/remove_dbg.rs", | 287 | "handlers/remove_dbg.rs", |
288 | // We have .dbg postfix | 288 | // We have .dbg postfix |
289 | "completion/src/completions/postfix.rs", | 289 | "ide_completion/src/completions/postfix.rs", |
290 | // The documentation in string literals may contain anything for its own purposes | 290 | // The documentation in string literals may contain anything for its own purposes |
291 | "completion/src/lib.rs", | 291 | "ide_completion/src/lib.rs", |
292 | "completion/src/generated_lint_completions.rs", | 292 | "ide_completion/src/generated_lint_completions.rs", |
293 | // test for doc test for remove_dbg | 293 | // test for doc test for remove_dbg |
294 | "src/tests/generated.rs", | 294 | "src/tests/generated.rs", |
295 | ]; | 295 | ]; |