From 520ff62f4e030c45c68207f8abc7bfea072a6e8d Mon Sep 17 00:00:00 2001 From: Jake Heinz Date: Sat, 13 Nov 2021 23:39:34 +0000 Subject: [PATCH] flip the default --- crates/ide/src/inlay_hints.rs | 36 +++++++++++++++--------------- crates/rust-analyzer/src/config.rs | 2 +- docs/user/generated_config.adoc | 2 +- editors/code/package.json | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 79c2475ee89..f3c5dce7c38 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -540,7 +540,7 @@ mod tests { type_hints: true, parameter_hints: true, chaining_hints: true, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }; @@ -556,7 +556,7 @@ mod tests { parameter_hints: true, type_hints: false, chaining_hints: false, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, ra_fixture, @@ -570,7 +570,7 @@ mod tests { parameter_hints: false, type_hints: true, chaining_hints: false, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, ra_fixture, @@ -584,7 +584,7 @@ mod tests { parameter_hints: false, type_hints: false, chaining_hints: true, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, ra_fixture, @@ -615,7 +615,7 @@ mod tests { type_hints: false, parameter_hints: false, chaining_hints: false, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, r#" @@ -1321,7 +1321,14 @@ fn main() { #[test] fn skip_constructor_type_hints() { - check_types( + check_with_config( + InlayHintsConfig { + type_hints: true, + parameter_hints: true, + chaining_hints: true, + hide_named_constructor_hints: true, + max_length: None, + }, r#" //- minicore: try use core::ops::ControlFlow; @@ -1363,14 +1370,7 @@ fn fallible() -> ControlFlow<()> { #[test] fn shows_constructor_type_hints_when_enabled() { - check_with_config( - InlayHintsConfig { - type_hints: true, - parameter_hints: true, - chaining_hints: true, - hide_named_constructor_hints: false, - max_length: None, - }, + check_types( r#" //- minicore: try use core::ops::ControlFlow; @@ -1470,7 +1470,7 @@ fn main() { parameter_hints: false, type_hints: false, chaining_hints: true, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, r#" @@ -1527,7 +1527,7 @@ fn main() { parameter_hints: false, type_hints: false, chaining_hints: true, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, r#" @@ -1572,7 +1572,7 @@ fn main() { parameter_hints: false, type_hints: false, chaining_hints: true, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, r#" @@ -1618,7 +1618,7 @@ fn main() { parameter_hints: false, type_hints: false, chaining_hints: true, - hide_named_constructor_hints: true, + hide_named_constructor_hints: false, max_length: None, }, r#" diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index f2078d86958..6a72c4e3261 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -204,7 +204,7 @@ config_data! { /// Whether to show inlay type hints for variables. inlayHints_typeHints: bool = "true", /// Whether to hide inlay hints for constructors. - inlayHints_hideNamedConstructorHints: bool = "true", + inlayHints_hideNamedConstructorHints: bool = "false", /// Join lines inserts else between consecutive ifs. joinLines_joinElseIf: bool = "true", diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index d6af6f738c5..c7bb1bf6420 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -308,7 +308,7 @@ site. -- Whether to show inlay type hints for variables. -- -[[rust-analyzer.inlayHints.hideNamedConstructorHints]]rust-analyzer.inlayHints.hideNamedConstructorHints (default: `true`):: +[[rust-analyzer.inlayHints.hideNamedConstructorHints]]rust-analyzer.inlayHints.hideNamedConstructorHints (default: `false`):: + -- Whether to hide inlay hints for constructors. diff --git a/editors/code/package.json b/editors/code/package.json index 888c9dccf33..e1cbe8ba640 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -754,7 +754,7 @@ }, "rust-analyzer.inlayHints.hideNamedConstructorHints": { "markdownDescription": "Whether to hide inlay hints for constructors.", - "default": true, + "default": false, "type": "boolean" }, "rust-analyzer.joinLines.joinElseIf": {