Unnamed repository; edit this file 'description' to name the repository.
check arg_idx >= n_params only if arg_idx >= n_required_params
| -rw-r--r-- | crates/ide-completion/src/completions/type.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide-completion/src/completions/type.rs b/crates/ide-completion/src/completions/type.rs index b2d5b6f5bd..0469d34951 100644 --- a/crates/ide-completion/src/completions/type.rs +++ b/crates/ide-completion/src/completions/type.rs @@ -181,12 +181,12 @@ pub(crate) fn complete_type_path( acc.add_type_alias_with_eq(ctx, alias); } }); - } - let n_params = - trait_.type_or_const_param_count(ctx.sema.db, false); - if arg_idx >= n_params { - return; // only show assoc types + let n_params = + trait_.type_or_const_param_count(ctx.sema.db, false); + if arg_idx >= n_params { + return; // only show assoc types + } } } } |