mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Auto merge of #17021 - roife:add-hover-limits-for-adts, r=Veykril
Support hovering limits for adts Fix #17009 1. Currently, r-a supports limiting the number of struct fields displayed when hovering. This PR extends it to support enum variants and union fields. Since the display of these three (ADTs) is similar, this PR extends 'hover_show_structFields' to 'hover_show_adtFieldsOrVariants'. 2. This PR also resolved the problem that the layout of ADT was not restricted by display limitations when hovering on the Self type. 3. Additionally, this PR changes the default value of display limitations to `10` (instead of the original `null`), which helps users discover this feature.
This commit is contained in:
commit
65eda41e65
8 changed files with 567 additions and 101 deletions
|
@ -33,7 +33,8 @@ pub struct HoverConfig {
|
|||
pub keywords: bool,
|
||||
pub format: HoverDocFormat,
|
||||
pub max_trait_assoc_items_count: Option<usize>,
|
||||
pub max_struct_field_count: Option<usize>,
|
||||
pub max_fields_count: Option<usize>,
|
||||
pub max_enum_variants_count: Option<usize>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue