rename completion -> ide_completion

We don't have completion-related PRs in flight, so lets do it
This commit is contained in:
Aleksey Kladov 2021-02-17 17:53:31 +03:00
parent 6334ce866a
commit 3db64a400c
37 changed files with 33 additions and 32 deletions

40
Cargo.lock generated
View file

@ -245,25 +245,6 @@ dependencies = [
"cc",
]
[[package]]
name = "completion"
version = "0.0.0"
dependencies = [
"base_db",
"either",
"expect-test",
"hir",
"ide_db",
"itertools 0.10.0",
"log",
"profile",
"rustc-hash",
"stdx",
"syntax",
"test_utils",
"text_edit",
]
[[package]]
name = "const_fn"
version = "0.4.5"
@ -613,10 +594,10 @@ version = "0.0.0"
dependencies = [
"assists",
"cfg",
"completion",
"either",
"expect-test",
"hir",
"ide_completion",
"ide_db",
"indexmap",
"itertools 0.10.0",
@ -634,6 +615,25 @@ dependencies = [
"url",
]
[[package]]
name = "ide_completion"
version = "0.0.0"
dependencies = [
"base_db",
"either",
"expect-test",
"hir",
"ide_db",
"itertools 0.10.0",
"log",
"profile",
"rustc-hash",
"stdx",
"syntax",
"test_utils",
"text_edit",
]
[[package]]
name = "ide_db"
version = "0.0.0"

View file

@ -29,7 +29,7 @@ profile = { path = "../profile", version = "0.0.0" }
test_utils = { path = "../test_utils", version = "0.0.0" }
assists = { path = "../assists", version = "0.0.0" }
ssr = { path = "../ssr", version = "0.0.0" }
completion = { path = "../completion", version = "0.0.0" }
ide_completion = { path = "../ide_completion", version = "0.0.0" }
# ide should depend only on the top-level `hir` package. if you need
# something from some `hir_xxx` subpackage, reexport the API via `hir`.

View file

@ -83,11 +83,11 @@ pub use crate::{
},
};
pub use assists::{Assist, AssistConfig, AssistId, AssistKind};
pub use completion::{
pub use hir::{Documentation, Semantics};
pub use ide_completion::{
CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, ImportEdit,
InsertTextFormat,
};
pub use hir::{Documentation, Semantics};
pub use ide_db::{
base_db::{
Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange,
@ -468,7 +468,7 @@ impl Analysis {
config: &CompletionConfig,
position: FilePosition,
) -> Cancelable<Option<Vec<CompletionItem>>> {
self.with_db(|db| completion::completions(db, config, position).map(Into::into))
self.with_db(|db| ide_completion::completions(db, config, position).map(Into::into))
}
/// Resolves additional completion data at the position given.
@ -482,7 +482,7 @@ impl Analysis {
) -> Cancelable<Vec<TextEdit>> {
Ok(self
.with_db(|db| {
completion::resolve_completion_edits(
ide_completion::resolve_completion_edits(
db,
config,
position,

View file

@ -1,5 +1,5 @@
[package]
name = "completion"
name = "ide_completion"
version = "0.0.0"
description = "TBD"
license = "MIT OR Apache-2.0"

View file

@ -26,7 +26,8 @@ pub fn generate_lint_completions(mode: Mode) -> Result<()> {
};
let contents = reformat(ts.to_string().as_str())?;
let destination = project_root().join("crates/completion/src/generated_lint_completions.rs");
let destination =
project_root().join("crates/ide_completion/src/generated_lint_completions.rs");
update(destination.as_path(), &contents, mode)?;
run_rustfmt(mode)?;

View file

@ -172,7 +172,7 @@ https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/#redo-after-
fn deny_clippy(path: &PathBuf, text: &String) {
let ignore = &[
// The documentation in string literals may contain anything for its own purposes
"completion/src/generated_lint_completions.rs",
"ide_completion/src/generated_lint_completions.rs",
];
if ignore.iter().any(|p| path.ends_with(p)) {
return;
@ -259,7 +259,7 @@ fn check_todo(path: &Path, text: &str) {
// `ast::make`.
"ast/make.rs",
// The documentation in string literals may contain anything for its own purposes
"completion/src/generated_lint_completions.rs",
"ide_completion/src/generated_lint_completions.rs",
];
if need_todo.iter().any(|p| path.ends_with(p)) {
return;
@ -286,10 +286,10 @@ fn check_dbg(path: &Path, text: &str) {
// Assists to remove `dbg!()`
"handlers/remove_dbg.rs",
// We have .dbg postfix
"completion/src/completions/postfix.rs",
"ide_completion/src/completions/postfix.rs",
// The documentation in string literals may contain anything for its own purposes
"completion/src/lib.rs",
"completion/src/generated_lint_completions.rs",
"ide_completion/src/lib.rs",
"ide_completion/src/generated_lint_completions.rs",
// test for doc test for remove_dbg
"src/tests/generated.rs",
];