mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
Remove limit from symbol_index::Query
This commit is contained in:
parent
0af780ea3e
commit
2666349392
8 changed files with 10 additions and 29 deletions
|
|
@ -333,7 +333,6 @@ fn path_applicable_imports(
|
|||
//
|
||||
// see also an ignored test under FIXME comment in the qualify_path.rs module
|
||||
AssocSearchMode::Exclude,
|
||||
Some(DEFAULT_QUERY_SEARCH_LIMIT.inner()),
|
||||
)
|
||||
.filter_map(|item| {
|
||||
let mod_path = mod_path(item)?;
|
||||
|
|
@ -347,7 +346,6 @@ fn path_applicable_imports(
|
|||
current_crate,
|
||||
path_candidate.name.clone(),
|
||||
AssocSearchMode::Include,
|
||||
Some(DEFAULT_QUERY_SEARCH_LIMIT.inner()),
|
||||
)
|
||||
.filter_map(|item| import_for_item(sema.db, mod_path, &qualifier, item))
|
||||
.take(DEFAULT_QUERY_SEARCH_LIMIT.inner())
|
||||
|
|
@ -507,7 +505,6 @@ fn trait_applicable_items(
|
|||
current_crate,
|
||||
trait_candidate.assoc_item_name.clone(),
|
||||
AssocSearchMode::AssocItemsOnly,
|
||||
Some(DEFAULT_QUERY_SEARCH_LIMIT.inner()),
|
||||
)
|
||||
.filter_map(|input| item_as_assoc(db, input))
|
||||
.filter_map(|assoc| {
|
||||
|
|
|
|||
|
|
@ -19,20 +19,18 @@ pub fn items_with_name<'a>(
|
|||
krate: Crate,
|
||||
name: NameToImport,
|
||||
assoc_item_search: AssocSearchMode,
|
||||
local_limit: Option<usize>,
|
||||
) -> impl Iterator<Item = ItemInNs> + 'a {
|
||||
let _p = profile::span("items_with_name").detail(|| {
|
||||
format!(
|
||||
"Name: {}, crate: {:?}, assoc items: {:?}, limit: {:?}",
|
||||
"Name: {}, crate: {:?}, assoc items: {:?}",
|
||||
name.text(),
|
||||
assoc_item_search,
|
||||
krate.display_name(sema.db).map(|name| name.to_string()),
|
||||
local_limit,
|
||||
)
|
||||
});
|
||||
|
||||
let prefix = matches!(name, NameToImport::Prefix(..));
|
||||
let (mut local_query, external_query) = match name {
|
||||
let (local_query, external_query) = match name {
|
||||
NameToImport::Prefix(exact_name, case_sensitive)
|
||||
| NameToImport::Exact(exact_name, case_sensitive) => {
|
||||
let mut local_query = symbol_index::Query::new(exact_name.clone());
|
||||
|
|
@ -70,10 +68,6 @@ pub fn items_with_name<'a>(
|
|||
}
|
||||
};
|
||||
|
||||
if let Some(limit) = local_limit {
|
||||
local_query.limit(limit);
|
||||
}
|
||||
|
||||
find_items(sema, krate, local_query, external_query)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ pub struct Query {
|
|||
mode: SearchMode,
|
||||
assoc_mode: AssocSearchMode,
|
||||
case_sensitive: bool,
|
||||
limit: usize,
|
||||
}
|
||||
|
||||
impl Query {
|
||||
|
|
@ -74,7 +73,6 @@ impl Query {
|
|||
mode: SearchMode::Fuzzy,
|
||||
assoc_mode: AssocSearchMode::Include,
|
||||
case_sensitive: false,
|
||||
limit: usize::max_value(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,10 +104,6 @@ impl Query {
|
|||
pub fn case_sensitive(&mut self) {
|
||||
self.case_sensitive = true;
|
||||
}
|
||||
|
||||
pub fn limit(&mut self, limit: usize) {
|
||||
self.limit = limit
|
||||
}
|
||||
}
|
||||
|
||||
#[salsa::query_group(SymbolsDatabaseStorage)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue