minor: correct typos

This commit is contained in:
Young-Flash 2024-01-30 21:43:43 +08:00
parent 7219414e81
commit db9fd370ee
23 changed files with 40 additions and 40 deletions

View file

@ -31,7 +31,7 @@ pub(crate) fn complete_dot(
}
let is_field_access = matches!(dot_access.kind, DotAccessKind::Field { .. });
let is_method_acces_with_parens =
let is_method_access_with_parens =
matches!(dot_access.kind, DotAccessKind::Method { has_parens: true });
complete_fields(
@ -41,7 +41,7 @@ pub(crate) fn complete_dot(
|acc, field, ty| acc.add_field(ctx, dot_access, None, field, &ty),
|acc, field, ty| acc.add_tuple_field(ctx, None, field, &ty),
is_field_access,
is_method_acces_with_parens,
is_method_access_with_parens,
);
complete_methods(ctx, receiver_ty, |func| acc.add_method(ctx, dot_access, func, None, None));
@ -114,14 +114,14 @@ fn complete_fields(
mut named_field: impl FnMut(&mut Completions, hir::Field, hir::Type),
mut tuple_index: impl FnMut(&mut Completions, usize, hir::Type),
is_field_access: bool,
is_method_acess_with_parens: bool,
is_method_access_with_parens: bool,
) {
let mut seen_names = FxHashSet::default();
for receiver in receiver.autoderef(ctx.db) {
for (field, ty) in receiver.fields(ctx.db) {
if seen_names.insert(field.name(ctx.db))
&& (is_field_access
|| (is_method_acess_with_parens && (ty.is_fn() || ty.is_closure())))
|| (is_method_access_with_parens && (ty.is_fn() || ty.is_closure())))
{
named_field(acc, field, ty);
}
@ -131,7 +131,7 @@ fn complete_fields(
// already seen without inserting into the hashset.
if !seen_names.contains(&hir::Name::new_tuple_field(i))
&& (is_field_access
|| (is_method_acess_with_parens && (ty.is_fn() || ty.is_closure())))
|| (is_method_access_with_parens && (ty.is_fn() || ty.is_closure())))
{
// Tuple fields are always public (tuple struct fields are handled above).
tuple_index(acc, i, ty);

View file

@ -105,7 +105,7 @@ fn func(param0 @ (param1, param2): (i32, i32)) {
fn completes_all_the_things_in_fn_body() {
check(
r#"
use non_existant::Unresolved;
use non_existent::Unresolved;
mod qualified { pub enum Enum { Variant } }
impl Unit {
@ -170,7 +170,7 @@ impl Unit {
);
check(
r#"
use non_existant::Unresolved;
use non_existent::Unresolved;
mod qualified { pub enum Enum { Variant } }
impl Unit {