Skip to content

Commit edac1b5

Browse files
committed
fix: adjust the limitation for ADTs' fields to 5
1 parent 0ec41cd commit edac1b5

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

crates/ide/src/hover/tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const HOVER_BASE_CONFIG: HoverConfig = HoverConfig {
1818
format: HoverDocFormat::Markdown,
1919
keywords: true,
2020
max_trait_assoc_items_count: None,
21-
max_adt_fields_or_variants_count: Some(10),
21+
max_adt_fields_or_variants_count: Some(5),
2222
};
2323

2424
fn check_hover_no_result(ra_fixture: &str) {
@@ -1018,7 +1018,7 @@ fn hover_record_struct_limit() {
10181018
#[test]
10191019
fn hover_enum_limit() {
10201020
check_hover_adt_fields_or_variants_limit(
1021-
Some(10),
1021+
Some(5),
10221022
r#"enum Foo$0 { A, B }"#,
10231023
expect![[r#"
10241024
*Foo*
@@ -1092,7 +1092,7 @@ fn hover_enum_limit() {
10921092
#[test]
10931093
fn hover_union_limit() {
10941094
check_hover_adt_fields_or_variants_limit(
1095-
Some(10),
1095+
Some(5),
10961096
r#"union Foo$0 { a: u32, b: i32 }"#,
10971097
expect![[r#"
10981098
*Foo*

crates/ide/src/static_index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl StaticIndex<'_> {
167167
keywords: true,
168168
format: crate::HoverDocFormat::Markdown,
169169
max_trait_assoc_items_count: None,
170-
max_adt_fields_or_variants_count: Some(10),
170+
max_adt_fields_or_variants_count: Some(5),
171171
};
172172
let tokens = tokens.filter(|token| {
173173
matches!(

crates/rust-analyzer/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ config_data! {
379379
hover_memoryLayout_size: Option<MemoryLayoutHoverRenderKindDef> = "\"both\"",
380380

381381
/// How many fields or variants of an ADT (struct, enum or union) to display when hovering on. Show none if empty.
382-
hover_show_adtFieldsOrVariants: Option<usize> = "10",
382+
hover_show_adtFieldsOrVariants: Option<usize> = "5",
383383
/// How many associated items of a trait to display when hovering a trait.
384384
hover_show_traitAssocItems: Option<usize> = "null",
385385

docs/user/generated_config.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ How to render the offset information in a memory layout hover.
526526
--
527527
How to render the size information in a memory layout hover.
528528
--
529-
[[rust-analyzer.hover.show.adtFieldsOrVariants]]rust-analyzer.hover.show.adtFieldsOrVariants (default: `10`)::
529+
[[rust-analyzer.hover.show.adtFieldsOrVariants]]rust-analyzer.hover.show.adtFieldsOrVariants (default: `5`)::
530530
+
531531
--
532532
How many fields or variants of an ADT (struct, enum or union) to display when hovering on. Show none if empty.

editors/code/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@
11541154
},
11551155
"rust-analyzer.hover.show.adtFieldsOrVariants": {
11561156
"markdownDescription": "How many fields or variants of an ADT (struct, enum or union) to display when hovering on. Show none if empty.",
1157-
"default": 10,
1157+
"default": 5,
11581158
"type": [
11591159
"null",
11601160
"integer"

0 commit comments

Comments
 (0)