diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index e6b60f6906..a5545e7984 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -375,6 +375,8 @@ config_data! { /// How to render the size information in a memory layout hover. hover_memoryLayout_size: Option = "\"both\"", + /// How many fields of a struct to display when hovering a struct. + hover_show_structFields: Option = "null", /// How many associated items of a trait to display when hovering a trait. hover_show_traitAssocItems: Option = "null", @@ -1690,6 +1692,7 @@ impl Config { }, keywords: self.data.hover_documentation_keywords_enable, max_trait_assoc_items_count: self.data.hover_show_traitAssocItems, + max_struct_field_count: self.data.hover_show_structFields, } } diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index 5e782b7831..c4024f6d28 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -520,6 +520,11 @@ How to render the offset information in a memory layout hover. -- How to render the size information in a memory layout hover. -- +[[rust-analyzer.hover.show.structFields]]rust-analyzer.hover.show.structFields (default: `null`):: ++ +-- +How many fields of a struct to display when hovering a struct. +-- [[rust-analyzer.hover.show.traitAssocItems]]rust-analyzer.hover.show.traitAssocItems (default: `null`):: + -- diff --git a/editors/code/package.json b/editors/code/package.json index c34b8e25de..c3ea1ceeb6 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -1144,6 +1144,15 @@ } ] }, + "rust-analyzer.hover.show.structFields": { + "markdownDescription": "How many fields of a struct to display when hovering a struct.", + "default": null, + "type": [ + "null", + "integer" + ], + "minimum": 0 + }, "rust-analyzer.hover.show.traitAssocItems": { "markdownDescription": "How many associated items of a trait to display when hovering a trait.", "default": null,