Mountain/ApplicationState/State/FeatureState/
State.rs1use super::{
39 Debug::DebugState::DebugState,
40 Decorations::DecorationsState::DecorationsState,
41 Diagnostics::DiagnosticsState::DiagnosticsState,
42 Documents::DocumentState::DocumentState,
43 Keybindings::KeybindingState::KeybindingState,
44 LifecyclePhase::LifecyclePhaseState::LifecyclePhaseState,
45 Markers::MarkerState::MarkerState,
46 NavigationHistory::NavigationHistoryState::NavigationHistoryState,
47 OutputChannels::OutputChannelState::OutputChannelState,
48 Terminals::TerminalState::TerminalState,
49 TreeViews::TreeViewState::TreeViewState,
50 Webviews::WebviewState::WebviewState,
51 WorkingCopy::WorkingCopyState::WorkingCopyState,
52};
53use crate::dev_log;
54
55#[derive(Clone)]
57pub struct State {
58 pub Debug:DebugState,
60
61 pub Decorations:DecorationsState,
64
65 pub Diagnostics:DiagnosticsState,
67
68 pub Documents:DocumentState,
70
71 pub Keybindings:KeybindingState,
73
74 pub Lifecycle:LifecyclePhaseState,
76
77 pub NavigationHistory:NavigationHistoryState,
79
80 pub Markers:MarkerState,
82
83 pub OutputChannels:OutputChannelState,
85
86 pub Terminals:TerminalState,
88
89 pub TreeViews:TreeViewState,
91
92 pub Webviews:WebviewState,
94
95 pub WorkingCopy:WorkingCopyState,
97}
98
99impl Default for State {
100 fn default() -> Self {
101 dev_log!("lifecycle", "[FeatureState::State] Initializing default feature state...");
102
103 Self {
104 Debug:Default::default(),
105
106 Decorations:Default::default(),
107
108 Diagnostics:Default::default(),
109
110 Documents:Default::default(),
111
112 Keybindings:Default::default(),
113
114 Lifecycle:Default::default(),
115
116 Markers:Default::default(),
117
118 NavigationHistory:Default::default(),
119
120 OutputChannels:Default::default(),
121
122 Terminals:Default::default(),
123
124 TreeViews:Default::default(),
125
126 Webviews:Default::default(),
127
128 WorkingCopy:Default::default(),
129 }
130 }
131}
132
133impl State {
134 pub fn GetNextTerminalIdentifier(&self) -> u64 { self.Terminals.GetNextTerminalIdentifier() }
136
137 pub fn GetNextSourceControlManagementProviderHandle(&self) -> u32 {
139 self.Markers.GetNextSourceControlManagementProviderHandle()
140 }
141}