Skip to main content

gen_lsp_types/generated/
notifications.rs

1#[allow(clippy::wildcard_imports)]
2use super::*;
3
4/// The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
5/// folder configuration changes.
6#[derive(Debug)]
7pub enum DidChangeWorkspaceFoldersNotification {}
8impl Notification for DidChangeWorkspaceFoldersNotification {
9    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WorkspaceDidChangeWorkspaceFolders;
10    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
11    type Params = DidChangeWorkspaceFoldersParams;
12}
13
14/// The `window/workDoneProgress/cancel` notification is sent from  the client to the server to cancel a progress
15/// initiated on the server side.
16#[derive(Debug)]
17pub enum WorkDoneProgressCancelNotification {}
18impl Notification for WorkDoneProgressCancelNotification {
19    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WindowWorkDoneProgressCancel;
20    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
21    type Params = WorkDoneProgressCancelParams;
22}
23
24/// The did create files notification is sent from the client to the server when
25/// files were created from within the client.
26///
27/// @since 3.16.0
28#[derive(Debug)]
29pub enum DidCreateFilesNotification {}
30impl Notification for DidCreateFilesNotification {
31    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WorkspaceDidCreateFiles;
32    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
33    type Params = CreateFilesParams;
34}
35
36/// The did rename files notification is sent from the client to the server when
37/// files were renamed from within the client.
38///
39/// @since 3.16.0
40#[derive(Debug)]
41pub enum DidRenameFilesNotification {}
42impl Notification for DidRenameFilesNotification {
43    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WorkspaceDidRenameFiles;
44    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
45    type Params = RenameFilesParams;
46}
47
48/// The will delete files request is sent from the client to the server before files are actually
49/// deleted as long as the deletion is triggered from within the client.
50///
51/// @since 3.16.0
52#[derive(Debug)]
53pub enum DidDeleteFilesNotification {}
54impl Notification for DidDeleteFilesNotification {
55    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WorkspaceDidDeleteFiles;
56    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
57    type Params = DeleteFilesParams;
58}
59
60/// A notification sent when a notebook opens.
61///
62/// @since 3.17.0
63#[derive(Debug)]
64pub enum DidOpenNotebookDocumentNotification {}
65impl Notification for DidOpenNotebookDocumentNotification {
66    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::NotebookDocumentDidOpen;
67    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
68    type Params = DidOpenNotebookDocumentParams;
69}
70
71#[derive(Debug)]
72pub enum DidChangeNotebookDocumentNotification {}
73impl Notification for DidChangeNotebookDocumentNotification {
74    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::NotebookDocumentDidChange;
75    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
76    type Params = DidChangeNotebookDocumentParams;
77}
78
79/// A notification sent when a notebook document is saved.
80///
81/// @since 3.17.0
82#[derive(Debug)]
83pub enum DidSaveNotebookDocumentNotification {}
84impl Notification for DidSaveNotebookDocumentNotification {
85    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::NotebookDocumentDidSave;
86    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
87    type Params = DidSaveNotebookDocumentParams;
88}
89
90/// A notification sent when a notebook closes.
91///
92/// @since 3.17.0
93#[derive(Debug)]
94pub enum DidCloseNotebookDocumentNotification {}
95impl Notification for DidCloseNotebookDocumentNotification {
96    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::NotebookDocumentDidClose;
97    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
98    type Params = DidCloseNotebookDocumentParams;
99}
100
101/// The initialized notification is sent from the client to the
102/// server after the client is fully initialized and the server
103/// is allowed to send requests from the server to the client.
104#[derive(Debug)]
105pub enum InitializedNotification {}
106impl Notification for InitializedNotification {
107    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::Initialized;
108    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
109    type Params = InitializedParams;
110}
111
112/// The exit event is sent from the client to the server to
113/// ask the server to exit its process.
114#[derive(Debug)]
115pub enum ExitNotification {}
116impl Notification for ExitNotification {
117    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::Exit;
118    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
119    type Params = ();
120}
121
122/// The configuration change notification is sent from the client to the server
123/// when the client's configuration has changed. The notification contains
124/// the changed configuration as defined by the language client.
125#[derive(Debug)]
126pub enum DidChangeConfigurationNotification {}
127impl Notification for DidChangeConfigurationNotification {
128    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WorkspaceDidChangeConfiguration;
129    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
130    type Params = DidChangeConfigurationParams;
131}
132
133/// The show message notification is sent from a server to a client to ask
134/// the client to display a particular message in the user interface.
135#[derive(Debug)]
136pub enum ShowMessageNotification {}
137impl Notification for ShowMessageNotification {
138    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WindowShowMessage;
139    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
140    type Params = ShowMessageParams;
141}
142
143/// The log message notification is sent from the server to the client to ask
144/// the client to log a particular message.
145#[derive(Debug)]
146pub enum LogMessageNotification {}
147impl Notification for LogMessageNotification {
148    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WindowLogMessage;
149    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
150    type Params = LogMessageParams;
151}
152
153/// The telemetry event notification is sent from the server to the client to ask
154/// the client to log telemetry data.
155#[derive(Debug)]
156pub enum TelemetryEventNotification {}
157impl Notification for TelemetryEventNotification {
158    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::TelemetryEvent;
159    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
160    type Params = LspAny;
161}
162
163/// The document open notification is sent from the client to the server to signal
164/// newly opened text documents. The document's truth is now managed by the client
165/// and the server must not try to read the document's truth using the document's
166/// uri. Open in this sense means it is managed by the client. It doesn't necessarily
167/// mean that its content is presented in an editor. An open notification must not
168/// be sent more than once without a corresponding close notification send before.
169/// This means open and close notification must be balanced and the max open count
170/// is one.
171#[derive(Debug)]
172pub enum DidOpenTextDocumentNotification {}
173impl Notification for DidOpenTextDocumentNotification {
174    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::TextDocumentDidOpen;
175    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
176    type Params = DidOpenTextDocumentParams;
177}
178
179/// The document change notification is sent from the client to the server to signal
180/// changes to a text document.
181#[derive(Debug)]
182pub enum DidChangeTextDocumentNotification {}
183impl Notification for DidChangeTextDocumentNotification {
184    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::TextDocumentDidChange;
185    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
186    type Params = DidChangeTextDocumentParams;
187}
188
189/// The document close notification is sent from the client to the server when
190/// the document got closed in the client. The document's truth now exists where
191/// the document's uri points to (e.g. if the document's uri is a file uri the
192/// truth now exists on disk). As with the open notification the close notification
193/// is about managing the document's content. Receiving a close notification
194/// doesn't mean that the document was open in an editor before. A close
195/// notification requires a previous open notification to be sent.
196#[derive(Debug)]
197pub enum DidCloseTextDocumentNotification {}
198impl Notification for DidCloseTextDocumentNotification {
199    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::TextDocumentDidClose;
200    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
201    type Params = DidCloseTextDocumentParams;
202}
203
204/// The document save notification is sent from the client to the server when
205/// the document got saved in the client.
206#[derive(Debug)]
207pub enum DidSaveTextDocumentNotification {}
208impl Notification for DidSaveTextDocumentNotification {
209    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::TextDocumentDidSave;
210    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
211    type Params = DidSaveTextDocumentParams;
212}
213
214/// A document will save notification is sent from the client to the server before
215/// the document is actually saved.
216#[derive(Debug)]
217pub enum WillSaveTextDocumentNotification {}
218impl Notification for WillSaveTextDocumentNotification {
219    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::TextDocumentWillSave;
220    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
221    type Params = WillSaveTextDocumentParams;
222}
223
224/// The watched files notification is sent from the client to the server when
225/// the client detects changes to file watched by the language client.
226#[derive(Debug)]
227pub enum DidChangeWatchedFilesNotification {}
228impl Notification for DidChangeWatchedFilesNotification {
229    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::WorkspaceDidChangeWatchedFiles;
230    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
231    type Params = DidChangeWatchedFilesParams;
232}
233
234/// Diagnostics notification are sent from the server to the client to signal
235/// results of validation runs.
236#[derive(Debug)]
237pub enum PublishDiagnosticsNotification {}
238impl Notification for PublishDiagnosticsNotification {
239    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::TextDocumentPublishDiagnostics;
240    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
241    type Params = PublishDiagnosticsParams;
242}
243
244#[derive(Debug)]
245pub enum SetTraceNotification {}
246impl Notification for SetTraceNotification {
247    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::SetTrace;
248    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
249    type Params = SetTraceParams;
250}
251
252#[derive(Debug)]
253pub enum LogTraceNotification {}
254impl Notification for LogTraceNotification {
255    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::LogTrace;
256    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
257    type Params = LogTraceParams;
258}
259
260#[derive(Debug)]
261pub enum CancelNotification {}
262impl Notification for CancelNotification {
263    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::CancelRequest;
264    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::Both;
265    type Params = CancelParams;
266}
267
268#[derive(Debug)]
269pub enum ProgressNotification {}
270impl Notification for ProgressNotification {
271    const METHOD: LspNotificationMethod<'static> = LspNotificationMethod::Progress;
272    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::Both;
273    type Params = ProgressParams;
274}