6614: Improve autoimports on completion speed r=matklad a=SomeoneToIgnore Presumably closes https://github.com/rust-analyzer/rust-analyzer/issues/6594 May help https://github.com/rust-analyzer/rust-analyzer/issues/6612 * Ignore modules eaferly * Do less completion string rendering 6632: Pin cargo_metadata r=matklad a=kjeremy See: https://github.com/oli-obk/cargo_metadata/pull/142#issuecomment-733653275 Co-authored-by: Kirill Bulatov <mail4score@gmail.com> Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
commit
db6988d4e7
7 changed files with 117 additions and 35 deletions
|
|
@ -36,8 +36,15 @@ pub fn find_similar_imports<'a>(
|
|||
krate: Crate,
|
||||
name_to_import: &str,
|
||||
limit: usize,
|
||||
ignore_modules: bool,
|
||||
) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> {
|
||||
let _p = profile::span("find_similar_imports");
|
||||
|
||||
let mut external_query = import_map::Query::new(name_to_import).limit(limit);
|
||||
if ignore_modules {
|
||||
external_query = external_query.exclude_import_kind(import_map::ImportKind::Module);
|
||||
}
|
||||
|
||||
find_imports(
|
||||
sema,
|
||||
krate,
|
||||
|
|
@ -46,7 +53,7 @@ pub fn find_similar_imports<'a>(
|
|||
local_query.limit(limit);
|
||||
local_query
|
||||
},
|
||||
import_map::Query::new(name_to_import).limit(limit),
|
||||
external_query,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue