Add collapse functionality to outline entries (#33490)

partly Closes #23075 

Release Notes:

- Now provides collapse and enables functionality to outline entries
- Add a new expand_outlines_with_depth setting to customize how deep the
tree is expanded by when a file is opened

part 2 is in #34164 

**Visual examples**

![image](https://github.com/user-attachments/assets/5dcdb83b-6e3e-4bfd-8ef4-76ae2ce4d3e6)

![image](https://github.com/user-attachments/assets/7b786a5a-1a8c-4f34-aaa5-4a8d0afa9668)

![image](https://github.com/user-attachments/assets/1817be06-ac71-4480-8f17-0bd862e913c8)
This commit is contained in:
Nicolas Rodriguez 2025-07-23 20:52:44 +02:00 committed by GitHub
parent 9863c8a44e
commit be0d9eecb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 826 additions and 49 deletions

View file

@ -691,7 +691,10 @@
// 5. Never show the scrollbar:
// "never"
"show": null
}
},
// Default depth to expand outline items in the current file.
// Set to 0 to collapse all items that have children, 1 or higher to collapse items at that depth or deeper.
"expand_outlines_with_depth": 100
},
"collaboration_panel": {
// Whether to show the collaboration panel button in the status bar.

File diff suppressed because it is too large Load diff

View file

@ -31,6 +31,7 @@ pub struct OutlinePanelSettings {
pub auto_reveal_entries: bool,
pub auto_fold_dirs: bool,
pub scrollbar: ScrollbarSettings,
pub expand_outlines_with_depth: usize,
}
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
@ -105,6 +106,13 @@ pub struct OutlinePanelSettingsContent {
pub indent_guides: Option<IndentGuidesSettingsContent>,
/// Scrollbar-related settings
pub scrollbar: Option<ScrollbarSettingsContent>,
/// Default depth to expand outline items in the current file.
/// The default depth to which outline entries are expanded on reveal.
/// - Set to 0 to collapse all items that have children
/// - Set to 1 or higher to collapse items at that depth or deeper
///
/// Default: 100
pub expand_outlines_with_depth: Option<usize>,
}
impl Settings for OutlinePanelSettings {