Common/IPC/DTO/
ProxyTarget.rs

1//! # ProxyTarget DTO
2//!
3//! Defines the `ProxyTarget` enum for identifying the target service or
4//! context for an RPC message, mirroring the `MainContext`/`ExtHostContext`
5//! pattern from VS Code.
6
7/// An enum that provides strongly-typed identifiers for all services that can
8/// be communicated with across the IPC boundary.
9///
10/// This is used to construct fully qualified RPC method names, ensuring that a
11/// message sent from one process is routed to the correct service
12/// implementation in the other.
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
14pub enum ProxyTarget {
15	// --- For ExtHost -> MainThread calls (Cocoon -> Mountain) ---
16	MainThreadCommands,
17
18	MainThreadConfiguration,
19
20	MainThreadDiagnostics,
21
22	MainThreadDocuments,
23
24	MainThreadExtensionEnablement,
25
26	MainThreadFileSystem,
27
28	MainThreadLanguageFeatures,
29
30	MainThreadLanguages,
31
32	MainThreadOutputService,
33
34	MainThreadSecrets,
35
36	MainThreadStorage,
37
38	MainThreadTerminalService,
39
40	MainThreadWindow,
41
42	MainThreadWebViews,
43
44	MainThreadTelemetry,
45
46	MainThreadWorkSpace,
47
48	MainThreadStatusBar,
49
50	MainThreadSourceControlManagement,
51
52	MainThreadTesting,
53
54	MainThreadDebugService,
55
56	MainThreadTaskService,
57
58	MainThreadCustomEditors,
59
60	MainThreadTreeView,
61
62	// --- For MainThread -> ExtHost calls (Mountain -> Cocoon) ---
63	ExtHostCommands,
64
65	ExtHostConfiguration,
66
67	ExtHostDiagnostics,
68
69	ExtHostDocuments,
70
71	ExtHostExtensionService,
72
73	ExtHostFileSystemInfo,
74
75	ExtHostLanguageFeatures,
76
77	ExtHostLanguages,
78
79	ExtHostOutputService,
80
81	ExtHostStorage,
82
83	ExtHostTerminalService,
84
85	ExtHostEnvironment,
86
87	ExtHostWebViews,
88
89	ExtHostTelemetry,
90
91	ExtHostChatProvider,
92
93	ExtHostExtensionEnablement,
94
95	ExtHostCustomEditors,
96
97	ExtHostQuickInput,
98
99	ExtHostMessageService,
100
101	ExtHostDialogs,
102
103	ExtHostAuthentication,
104
105	ExtHostDebugService,
106
107	ExtHostTaskService,
108
109	ExtHostManagedSockets,
110
111	ExtHostTreeView,
112
113	ExtHostStatusBar,
114
115	ExtHostSourceControlManagement,
116
117	ExtHostTesting,
118
119	ExtHostDebug,
120}
121
122impl ProxyTarget {
123	/// Returns a string prefix representing the target, used in constructing
124	/// fully qualified RPC method names (e.g.
125	/// `MainThreadCommands$ExecuteCommand`).
126	pub fn GetTargetPrefix(&self) -> String { format!("{:?}", self) }
127}