Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/inlay_hints/placeholders.rs')
| -rw-r--r-- | crates/ide/src/inlay_hints/placeholders.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/crates/ide/src/inlay_hints/placeholders.rs b/crates/ide/src/inlay_hints/placeholders.rs index 96d2c17c03..e535b92a57 100644 --- a/crates/ide/src/inlay_hints/placeholders.rs +++ b/crates/ide/src/inlay_hints/placeholders.rs @@ -20,7 +20,7 @@ pub(super) fn type_hints( display_target: DisplayTarget, placeholder: InferType, ) -> Option<()> { - if !config.type_hints { + if !config.type_hints || config.hide_inferred_type_hints { return None; } @@ -73,4 +73,22 @@ fn foo() { "#, ); } + + #[test] + fn hide_inferred_types() { + check_with_config( + InlayHintsConfig { + type_hints: true, + hide_inferred_type_hints: true, + ..DISABLED_CONFIG + }, + r#" +struct S<T>(T); + +fn foo() { + let t: (_, _, [_; _]) = (1_u32, S(2), [false] as _); +} + "#, + ); + } } |