Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ee2dd93

Browse files
committed
Don't trigger adjustment hints in all inlay hint tests
1 parent d841ad1 commit ee2dd93

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

crates/ide/src/inlay_hints.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -861,23 +861,23 @@ fn binding_mode_hints(
861861
tooltip: Some(InlayTooltip::String("Inferred binding mode".into())),
862862
});
863863
});
864-
// match pat {
865-
// ast::Pat::IdentPat(pat) if pat.ref_token().is_none() && pat.mut_token().is_none() => {
866-
// let bm = sema.binding_mode_of_pat(pat)?;
867-
// let bm = match bm {
868-
// hir::BindingMode::Move => return None,
869-
// hir::BindingMode::Ref(Mutability::Mut) => "ref mut",
870-
// hir::BindingMode::Ref(Mutability::Shared) => "ref",
871-
// };
872-
// acc.push(InlayHint {
873-
// range,
874-
// kind: InlayKind::BindingModeHint,
875-
// label: bm.to_string().into(),
876-
// tooltip: Some(InlayTooltip::String("Inferred binding mode".into())),
877-
// });
878-
// }
879-
// _ => (),
880-
// }
864+
match pat {
865+
ast::Pat::IdentPat(pat) if pat.ref_token().is_none() && pat.mut_token().is_none() => {
866+
let bm = sema.binding_mode_of_pat(pat)?;
867+
let bm = match bm {
868+
hir::BindingMode::Move => return None,
869+
hir::BindingMode::Ref(Mutability::Mut) => "ref mut",
870+
hir::BindingMode::Ref(Mutability::Shared) => "ref",
871+
};
872+
acc.push(InlayHint {
873+
range,
874+
kind: InlayKind::BindingModeHint,
875+
label: bm.to_string().into(),
876+
tooltip: Some(InlayTooltip::String("Inferred binding mode".into())),
877+
});
878+
}
879+
_ => (),
880+
}
881881

882882
Some(())
883883
}
@@ -1306,7 +1306,7 @@ mod tests {
13061306
chaining_hints: false,
13071307
lifetime_elision_hints: LifetimeElisionHints::Never,
13081308
closure_return_type_hints: ClosureReturnTypeHints::Never,
1309-
adjustment_hints: AdjustmentHints::Always,
1309+
adjustment_hints: AdjustmentHints::Never,
13101310
binding_mode_hints: false,
13111311
hide_named_constructor_hints: false,
13121312
hide_closure_initialization_hints: false,
@@ -1318,7 +1318,6 @@ mod tests {
13181318
type_hints: true,
13191319
parameter_hints: true,
13201320
chaining_hints: true,
1321-
adjustment_hints: AdjustmentHints::Always,
13221321
closure_return_type_hints: ClosureReturnTypeHints::WithBlock,
13231322
binding_mode_hints: true,
13241323
lifetime_elision_hints: LifetimeElisionHints::Always,

0 commit comments

Comments
 (0)