mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 04:23:25 +00:00
rename completion -> ide_completion
We don't have completion-related PRs in flight, so lets do it
This commit is contained in:
parent
6334ce866a
commit
3db64a400c
37 changed files with 33 additions and 32 deletions
40
Cargo.lock
generated
40
Cargo.lock
generated
|
@ -245,25 +245,6 @@ dependencies = [
|
||||||
"cc",
|
"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]]
|
[[package]]
|
||||||
name = "const_fn"
|
name = "const_fn"
|
||||||
version = "0.4.5"
|
version = "0.4.5"
|
||||||
|
@ -613,10 +594,10 @@ version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assists",
|
"assists",
|
||||||
"cfg",
|
"cfg",
|
||||||
"completion",
|
|
||||||
"either",
|
"either",
|
||||||
"expect-test",
|
"expect-test",
|
||||||
"hir",
|
"hir",
|
||||||
|
"ide_completion",
|
||||||
"ide_db",
|
"ide_db",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"itertools 0.10.0",
|
"itertools 0.10.0",
|
||||||
|
@ -634,6 +615,25 @@ dependencies = [
|
||||||
"url",
|
"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]]
|
[[package]]
|
||||||
name = "ide_db"
|
name = "ide_db"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
|
@ -29,7 +29,7 @@ profile = { path = "../profile", version = "0.0.0" }
|
||||||
test_utils = { path = "../test_utils", version = "0.0.0" }
|
test_utils = { path = "../test_utils", version = "0.0.0" }
|
||||||
assists = { path = "../assists", version = "0.0.0" }
|
assists = { path = "../assists", version = "0.0.0" }
|
||||||
ssr = { path = "../ssr", 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
|
# ide should depend only on the top-level `hir` package. if you need
|
||||||
# something from some `hir_xxx` subpackage, reexport the API via `hir`.
|
# something from some `hir_xxx` subpackage, reexport the API via `hir`.
|
||||||
|
|
|
@ -83,11 +83,11 @@ pub use crate::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
pub use assists::{Assist, AssistConfig, AssistId, AssistKind};
|
pub use assists::{Assist, AssistConfig, AssistId, AssistKind};
|
||||||
pub use completion::{
|
pub use hir::{Documentation, Semantics};
|
||||||
|
pub use ide_completion::{
|
||||||
CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, ImportEdit,
|
CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, ImportEdit,
|
||||||
InsertTextFormat,
|
InsertTextFormat,
|
||||||
};
|
};
|
||||||
pub use hir::{Documentation, Semantics};
|
|
||||||
pub use ide_db::{
|
pub use ide_db::{
|
||||||
base_db::{
|
base_db::{
|
||||||
Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange,
|
Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange,
|
||||||
|
@ -468,7 +468,7 @@ impl Analysis {
|
||||||
config: &CompletionConfig,
|
config: &CompletionConfig,
|
||||||
position: FilePosition,
|
position: FilePosition,
|
||||||
) -> Cancelable<Option<Vec<CompletionItem>>> {
|
) -> 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.
|
/// Resolves additional completion data at the position given.
|
||||||
|
@ -482,7 +482,7 @@ impl Analysis {
|
||||||
) -> Cancelable<Vec<TextEdit>> {
|
) -> Cancelable<Vec<TextEdit>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.with_db(|db| {
|
.with_db(|db| {
|
||||||
completion::resolve_completion_edits(
|
ide_completion::resolve_completion_edits(
|
||||||
db,
|
db,
|
||||||
config,
|
config,
|
||||||
position,
|
position,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "completion"
|
name = "ide_completion"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
|
@ -26,7 +26,8 @@ pub fn generate_lint_completions(mode: Mode) -> Result<()> {
|
||||||
};
|
};
|
||||||
let contents = reformat(ts.to_string().as_str())?;
|
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)?;
|
update(destination.as_path(), &contents, mode)?;
|
||||||
run_rustfmt(mode)?;
|
run_rustfmt(mode)?;
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
fn deny_clippy(path: &PathBuf, text: &String) {
|
||||||
let ignore = &[
|
let ignore = &[
|
||||||
// The documentation in string literals may contain anything for its own purposes
|
// 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)) {
|
if ignore.iter().any(|p| path.ends_with(p)) {
|
||||||
return;
|
return;
|
||||||
|
@ -259,7 +259,7 @@ fn check_todo(path: &Path, text: &str) {
|
||||||
// `ast::make`.
|
// `ast::make`.
|
||||||
"ast/make.rs",
|
"ast/make.rs",
|
||||||
// The documentation in string literals may contain anything for its own purposes
|
// 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)) {
|
if need_todo.iter().any(|p| path.ends_with(p)) {
|
||||||
return;
|
return;
|
||||||
|
@ -286,10 +286,10 @@ fn check_dbg(path: &Path, text: &str) {
|
||||||
// Assists to remove `dbg!()`
|
// Assists to remove `dbg!()`
|
||||||
"handlers/remove_dbg.rs",
|
"handlers/remove_dbg.rs",
|
||||||
// We have .dbg postfix
|
// 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
|
// The documentation in string literals may contain anything for its own purposes
|
||||||
"completion/src/lib.rs",
|
"ide_completion/src/lib.rs",
|
||||||
"completion/src/generated_lint_completions.rs",
|
"ide_completion/src/generated_lint_completions.rs",
|
||||||
// test for doc test for remove_dbg
|
// test for doc test for remove_dbg
|
||||||
"src/tests/generated.rs",
|
"src/tests/generated.rs",
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue