Mountain/Environment/mod.rs
1#![allow(non_snake_case)]
2#![allow(unused_imports, unused_variables)]
3
4//! # Environment
5//!
6//! Dependency injection container that provides thread-safe access to
7//! all Mountain providers through trait-based lookups via the `Requires` trait.
8//!
9//! ```text
10//! Component -> Requires<T> -> MountainEnvironment -> Arc<dyn T>
11//! ```
12//!
13//! `MountainEnvironment` implements the `Environment` and `Requires` traits
14//! from the Common crate. It is constructed once during startup and shared
15//! as `Arc<MountainEnvironment>` across all subsystems. Provider trait
16//! implementations are generated by `ProviderTraitImplMacro` to keep
17//! boilerplate minimal.
18//!
19//! ## Provider Traits Implemented
20//!
21//! `CommandExecutor`, `ConfigurationProvider`, `CustomEditorProvider`,
22//! `DebugService`, `DiagnosticManager`, `DocumentProvider`,
23//! `FileSystemReader`/`Writer`, `FileWatcher`, `IPCProvider`,
24//! `KeybindingProvider`, `LanguageFeatureProviderRegistry`,
25//! `OutputChannelManager`, `SearchProvider`, `SecretProvider`,
26//! `SourceControlManagementProvider`, `StatusBarProvider`, `StorageProvider`,
27//! `SynchronizationProvider`, `TerminalProvider`, `TestController`,
28//! `TreeViewProvider`, `UserInterfaceProvider`, `WebviewProvider`,
29//! `WorkspaceProvider`, `WorkspaceEditApplier`, `ExtensionManagementService`.
30//!
31//! Providers use `CommonError` for error reporting. Trait resolution is
32//! compile-time, ensuring type safety with zero runtime overhead.
33
34/// Main dependency injection container struct implementing all provider traits.
35pub mod MountainEnvironment;
36
37/// Declarative macro that generates `Requires<dyn T>` impl blocks
38/// for each provider trait on `MountainEnvironment`. Invoked as
39/// `impl_provider!(CommandExecutor)` from the parent file.
40pub mod ProviderTraitImplMacro;
41
42/// `CommandExecutor` provider: runs shell commands in a managed subprocess.
43pub mod CommandProvider;
44
45/// `ConfigurationProvider`: reads, writes, and watches workspace configuration.
46pub mod ConfigurationProvider;
47
48/// `CustomEditorProvider`: registers and resolves custom editor contributions.
49pub mod CustomEditorProvider;
50
51/// `DebugService`: manages debug adapter protocol sessions.
52pub mod DebugProvider;
53
54/// `DiagnosticManager`: collects and publishes editor diagnostic markers.
55pub mod DiagnosticProvider;
56
57/// `DocumentProvider`: opens, closes, and tracks text document state.
58pub mod DocumentProvider;
59
60/// `FileSystemReader`/`Writer`: async file-system read and write operations.
61pub mod FileSystemProvider;
62
63/// `FileWatcher`: registers file-system watch patterns and delivers change
64/// events.
65pub mod FileWatcherProvider;
66
67/// `IPCProvider`: routes IPC messages between the frontend and backend.
68pub mod IPCProvider;
69
70/// `KeybindingProvider`: resolves keybinding contributions and chord sequences.
71pub mod KeybindingProvider;
72
73/// `LanguageFeatureProviderRegistry`: dispatches LSP-like language features.
74pub mod LanguageFeatureProvider;
75
76/// `OutputChannelManager`: creates and writes to named output channels.
77pub mod OutputProvider;
78
79/// `SearchProvider`: runs workspace-wide text and symbol searches.
80pub mod SearchProvider;
81
82/// `SecretProvider`: reads and writes secrets from the platform credential
83/// store.
84pub mod SecretProvider;
85
86/// `SourceControlManagementProvider`: exposes SCM repository state and actions.
87pub mod SourceControlManagementProvider;
88
89/// `StatusBarProvider`: creates and updates status bar items.
90pub mod StatusBarProvider;
91
92/// `StorageProvider`: persists extension and workspace state blobs.
93pub mod StorageProvider;
94
95/// `SynchronizationProvider`: coordinates cross-window state synchronization.
96pub mod SynchronizationProvider;
97
98/// `TerminalProvider`: creates and manages integrated terminal instances.
99pub mod TerminalProvider;
100
101/// `TestController`: registers test run profiles and reports test results.
102pub mod TestProvider;
103
104/// `TreeViewProvider`: supplies data for tree-view panel contributions.
105pub mod TreeViewProvider;
106
107/// `UserInterfaceProvider`: drives quick-pick, input-box, and notification UI.
108pub mod UserInterfaceProvider;
109
110/// `WebviewProvider`: creates and manages sandboxed webview panels.
111pub mod WebviewProvider;
112
113/// `WorkspaceProvider`: exposes workspace folders, trust state, and edits.
114pub mod WorkspaceProvider;
115
116/// Shared helpers used across multiple provider implementations.
117pub mod Utility;