Skip to content

Commit 3825d8b

Browse files
committed
Increase search depth to account for more granual steps
1 parent b4f3eb4 commit 3825d8b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

crates/hir/src/term_search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub struct TermSearchConfig {
238238

239239
impl Default for TermSearchConfig {
240240
fn default() -> Self {
241-
Self { enable_borrowcheck: true, many_alternatives_threshold: 1, fuel: 400 }
241+
Self { enable_borrowcheck: true, many_alternatives_threshold: 1, fuel: 1200 }
242242
}
243243
}
244244

crates/hir/src/term_search/tactics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ pub(super) fn impl_method<'a, DB: HirDatabase>(
448448
AssocItem::Function(f) => Some((imp, ty, f)),
449449
_ => None,
450450
})
451+
.filter(|_| should_continue())
451452
.filter_map(move |(imp, ty, it)| {
452453
let fn_generics = GenericDef::from(it);
453454
let imp_generics = GenericDef::from(imp);
@@ -636,6 +637,7 @@ pub(super) fn impl_static_method<'a, DB: HirDatabase>(
636637
AssocItem::Function(f) => Some((imp, ty, f)),
637638
_ => None,
638639
})
640+
.filter(|_| should_continue())
639641
.filter_map(move |(imp, ty, it)| {
640642
let fn_generics = GenericDef::from(it);
641643
let imp_generics = GenericDef::from(imp);

crates/rust-analyzer/src/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ config_data! {
341341
assist_emitMustUse: bool = false,
342342
/// Placeholder expression to use for missing expressions in assists.
343343
assist_expressionFillDefault: ExprFillDefaultDef = ExprFillDefaultDef::Todo,
344-
/// Term search fuel in "units of work" for assists (Defaults to 400).
345-
assist_termSearch_fuel: usize = 400,
344+
/// Term search fuel in "units of work" for assists (Defaults to 1800).
345+
assist_termSearch_fuel: usize = 1800,
346346

347347
/// Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import styles consistent per file.
348348
imports_granularity_enforce: bool = false,
@@ -426,8 +426,8 @@ config_data! {
426426
}"#).unwrap(),
427427
/// Whether to enable term search based snippets like `Some(foo.bar().baz())`.
428428
completion_termSearch_enable: bool = false,
429-
/// Term search fuel in "units of work" for autocompletion (Defaults to 200).
430-
completion_termSearch_fuel: usize = 200,
429+
/// Term search fuel in "units of work" for autocompletion (Defaults to 1000).
430+
completion_termSearch_fuel: usize = 1000,
431431

432432
/// Controls file watching implementation.
433433
files_watcher: FilesWatcherDef = FilesWatcherDef::Client,

0 commit comments

Comments
 (0)