gen-lsp-types 0.6.0

Library of Rust LSP types generated from the official metamodel
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
#[allow(clippy::wildcard_imports)]
use super::*;

/// A request to resolve the implementation locations of a symbol at a given text
/// document position. The request's parameter is of type [`TextDocumentPositionParams`]
/// the response is of type [`Definition`] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum ImplementationRequest {}
impl Request for ImplementationRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentImplementation;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = ImplementationParams;
    type Result = Option<ImplementationResponse>;
}

/// A request to resolve the type definition locations of a symbol at a given text
/// document position. The request's parameter is of type [`TextDocumentPositionParams`]
/// the response is of type [`Definition`] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum TypeDefinitionRequest {}
impl Request for TypeDefinitionRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentTypeDefinition;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = TypeDefinitionParams;
    type Result = Option<TypeDefinitionResponse>;
}

/// The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
#[derive(Debug)]
pub enum WorkspaceFoldersRequest {}
impl Request for WorkspaceFoldersRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceWorkspaceFolders;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ();
    type Result = Option<Vec<WorkspaceFolder>>;
}

/// The 'workspace/configuration' request is sent from the server to the client to fetch a certain
/// configuration setting.
///
/// This pull model replaces the old push model were the client signaled configuration change via an
/// event. If the server still needs to react to configuration changes (since the server caches the
/// result of `workspace/configuration` requests) the server should register for an empty configuration
/// change event and empty the cache if such an event is received.
#[derive(Debug)]
pub enum ConfigurationRequest {}
impl Request for ConfigurationRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceConfiguration;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ConfigurationParams;
    type Result = Vec<LspAny>;
}

/// A request to list all color symbols found in a given text document. The request's
/// parameter is of type [`DocumentColorParams`] the
/// response is of type [ColorInformation[]][ColorInformation] or a Thenable
/// that resolves to such.
#[derive(Debug)]
pub enum DocumentColorRequest {}
impl Request for DocumentColorRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentDocumentColor;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentColorParams;
    type Result = Option<Vec<ColorInformation>>;
}

/// A request to list all presentation for a color. The request's
/// parameter is of type [`ColorPresentationParams`] the
/// response is of type [ColorInformation[]][ColorInformation] or a Thenable
/// that resolves to such.
#[derive(Debug)]
pub enum ColorPresentationRequest {}
impl Request for ColorPresentationRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentColorPresentation;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = ColorPresentationParams;
    type Result = Option<Vec<ColorPresentation>>;
}

/// A request to provide folding ranges in a document. The request's
/// parameter is of type [`FoldingRangeParams`], the
/// response is of type [`FoldingRangeList`] or a Thenable
/// that resolves to such.
#[derive(Debug)]
pub enum FoldingRangeRequest {}
impl Request for FoldingRangeRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentFoldingRange;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = FoldingRangeParams;
    type Result = Option<Vec<FoldingRange>>;
}

/// @since 3.18.0
/// @proposed
#[derive(Debug)]
pub enum FoldingRangeRefreshRequest {}
impl Request for FoldingRangeRefreshRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceFoldingRangeRefresh;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ();
    type Result = ();
}

/// A request to resolve the type definition locations of a symbol at a given text
/// document position. The request's parameter is of type [`TextDocumentPositionParams`]
/// the response is of type [`Declaration`] or a typed array of [`DeclarationLink`]
/// or a Thenable that resolves to such.
#[derive(Debug)]
pub enum DeclarationRequest {}
impl Request for DeclarationRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentDeclaration;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DeclarationParams;
    type Result = Option<DeclarationResponse>;
}

/// A request to provide selection ranges in a document. The request's
/// parameter is of type [`SelectionRangeParams`], the
/// response is of type [SelectionRange[]][SelectionRange] or a Thenable
/// that resolves to such.
#[derive(Debug)]
pub enum SelectionRangeRequest {}
impl Request for SelectionRangeRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentSelectionRange;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = SelectionRangeParams;
    type Result = Option<Vec<SelectionRange>>;
}

/// The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
/// reporting from the server.
#[derive(Debug)]
pub enum WorkDoneProgressCreateRequest {}
impl Request for WorkDoneProgressCreateRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WindowWorkDoneProgressCreate;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = WorkDoneProgressCreateParams;
    type Result = ();
}

/// A request to result a `CallHierarchyItem` in a document at a given position.
/// Can be used as an input to an incoming or outgoing call hierarchy.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum CallHierarchyPrepareRequest {}
impl Request for CallHierarchyPrepareRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentPrepareCallHierarchy;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CallHierarchyPrepareParams;
    type Result = Option<Vec<CallHierarchyItem>>;
}

/// A request to resolve the incoming calls for a given `CallHierarchyItem`.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum CallHierarchyIncomingCallsRequest {}
impl Request for CallHierarchyIncomingCallsRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::CallHierarchyIncomingCalls;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CallHierarchyIncomingCallsParams;
    type Result = Option<Vec<CallHierarchyIncomingCall>>;
}

/// A request to resolve the outgoing calls for a given `CallHierarchyItem`.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum CallHierarchyOutgoingCallsRequest {}
impl Request for CallHierarchyOutgoingCallsRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::CallHierarchyOutgoingCalls;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CallHierarchyOutgoingCallsParams;
    type Result = Option<Vec<CallHierarchyOutgoingCall>>;
}

/// @since 3.16.0
#[derive(Debug)]
pub enum SemanticTokensRequest {}
impl Request for SemanticTokensRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentSemanticTokensFull;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = SemanticTokensParams;
    type Result = Option<SemanticTokens>;
}

/// @since 3.16.0
#[derive(Debug)]
pub enum SemanticTokensDeltaRequest {}
impl Request for SemanticTokensDeltaRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentSemanticTokensFullDelta;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = SemanticTokensDeltaParams;
    type Result = Option<SemanticTokensDeltaResponse>;
}

/// @since 3.16.0
#[derive(Debug)]
pub enum SemanticTokensRangeRequest {}
impl Request for SemanticTokensRangeRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentSemanticTokensRange;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = SemanticTokensRangeParams;
    type Result = Option<SemanticTokens>;
}

/// @since 3.16.0
#[derive(Debug)]
pub enum SemanticTokensRefreshRequest {}
impl Request for SemanticTokensRefreshRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceSemanticTokensRefresh;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ();
    type Result = ();
}

/// A request to show a document. This request might open an
/// external program depending on the value of the URI to open.
/// For example a request to open `https://code.visualstudio.com/`
/// will very likely open the URI in a WEB browser.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum ShowDocumentRequest {}
impl Request for ShowDocumentRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WindowShowDocument;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ShowDocumentParams;
    type Result = ShowDocumentResult;
}

/// A request to provide ranges that can be edited together.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum LinkedEditingRangeRequest {}
impl Request for LinkedEditingRangeRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentLinkedEditingRange;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = LinkedEditingRangeParams;
    type Result = Option<LinkedEditingRanges>;
}

/// The will create files request is sent from the client to the server before files are actually
/// created as long as the creation is triggered from within the client.
///
/// The request can return a `WorkspaceEdit` which will be applied to workspace before the
/// files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file
/// to be created.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum WillCreateFilesRequest {}
impl Request for WillCreateFilesRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceWillCreateFiles;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CreateFilesParams;
    type Result = Option<WorkspaceEdit>;
}

/// The will rename files request is sent from the client to the server before files are actually
/// renamed as long as the rename is triggered from within the client.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum WillRenameFilesRequest {}
impl Request for WillRenameFilesRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceWillRenameFiles;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = RenameFilesParams;
    type Result = Option<WorkspaceEdit>;
}

/// The did delete files notification is sent from the client to the server when
/// files were deleted from within the client.
///
/// @since 3.16.0
#[derive(Debug)]
pub enum WillDeleteFilesRequest {}
impl Request for WillDeleteFilesRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceWillDeleteFiles;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DeleteFilesParams;
    type Result = Option<WorkspaceEdit>;
}

/// A request to get the moniker of a symbol at a given text document position.
/// The request parameter is of type [`TextDocumentPositionParams`].
/// The response is of type [Moniker[]][Moniker] or `null`.
#[derive(Debug)]
pub enum MonikerRequest {}
impl Request for MonikerRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentMoniker;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = MonikerParams;
    type Result = Option<Vec<Moniker>>;
}

/// A request to result a `TypeHierarchyItem` in a document at a given position.
/// Can be used as an input to a subtypes or supertypes type hierarchy.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum TypeHierarchyPrepareRequest {}
impl Request for TypeHierarchyPrepareRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentPrepareTypeHierarchy;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = TypeHierarchyPrepareParams;
    type Result = Option<Vec<TypeHierarchyItem>>;
}

/// A request to resolve the supertypes for a given `TypeHierarchyItem`.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum TypeHierarchySupertypesRequest {}
impl Request for TypeHierarchySupertypesRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TypeHierarchySupertypes;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = TypeHierarchySupertypesParams;
    type Result = Option<Vec<TypeHierarchyItem>>;
}

/// A request to resolve the subtypes for a given `TypeHierarchyItem`.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum TypeHierarchySubtypesRequest {}
impl Request for TypeHierarchySubtypesRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TypeHierarchySubtypes;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = TypeHierarchySubtypesParams;
    type Result = Option<Vec<TypeHierarchyItem>>;
}

/// A request to provide inline values in a document. The request's parameter is of
/// type [`InlineValueParams`], the response is of type
/// [InlineValue[]][InlineValue] or a Thenable that resolves to such.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum InlineValueRequest {}
impl Request for InlineValueRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentInlineValue;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = InlineValueParams;
    type Result = Option<Vec<InlineValue>>;
}

/// @since 3.17.0
#[derive(Debug)]
pub enum InlineValueRefreshRequest {}
impl Request for InlineValueRefreshRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceInlineValueRefresh;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ();
    type Result = ();
}

/// A request to provide inlay hints in a document. The request's parameter is of
/// type [`InlayHintsParams`], the response is of type
/// [InlayHint[]][InlayHint] or a Thenable that resolves to such.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum InlayHintRequest {}
impl Request for InlayHintRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentInlayHint;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = InlayHintParams;
    type Result = Option<Vec<InlayHint>>;
}

/// A request to resolve additional properties for an inlay hint.
/// The request's parameter is of type [`InlayHint`], the response is
/// of type [`InlayHint`] or a Thenable that resolves to such.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum InlayHintResolveRequest {}
impl Request for InlayHintResolveRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::InlayHintResolve;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = InlayHint;
    type Result = InlayHint;
}

/// @since 3.17.0
#[derive(Debug)]
pub enum InlayHintRefreshRequest {}
impl Request for InlayHintRefreshRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceInlayHintRefresh;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ();
    type Result = ();
}

/// The document diagnostic request definition.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum DocumentDiagnosticRequest {}
impl Request for DocumentDiagnosticRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentDiagnostic;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentDiagnosticParams;
    type Result = DocumentDiagnosticReport;
}

/// The workspace diagnostic request definition.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum WorkspaceDiagnosticRequest {}
impl Request for WorkspaceDiagnosticRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceDiagnostic;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = WorkspaceDiagnosticParams;
    type Result = WorkspaceDiagnosticReport;
}

/// The diagnostic refresh request definition.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum DiagnosticRefreshRequest {}
impl Request for DiagnosticRefreshRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceDiagnosticRefresh;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ();
    type Result = ();
}

/// A request to provide inline completions in a document. The request's parameter is of
/// type [`InlineCompletionParams`], the response is of type
/// [InlineCompletion[]][InlineCompletion] or a Thenable that resolves to such.
///
/// @since 3.18.0
/// @proposed
#[derive(Debug)]
pub enum InlineCompletionRequest {}
impl Request for InlineCompletionRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentInlineCompletion;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = InlineCompletionParams;
    type Result = Option<InlineCompletionResponse>;
}

/// The `workspace/textDocumentContent` request is sent from the client to the
/// server to request the content of a text document.
///
/// @since 3.18.0
/// @proposed
#[derive(Debug)]
pub enum TextDocumentContentRequest {}
impl Request for TextDocumentContentRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceTextDocumentContent;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = TextDocumentContentParams;
    type Result = TextDocumentContentResult;
}

/// The `workspace/textDocumentContent` request is sent from the server to the client to refresh
/// the content of a specific text document.
///
/// @since 3.18.0
/// @proposed
#[derive(Debug)]
pub enum TextDocumentContentRefreshRequest {}
impl Request for TextDocumentContentRefreshRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceTextDocumentContentRefresh;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = TextDocumentContentRefreshParams;
    type Result = ();
}

/// The `client/registerCapability` request is sent from the server to the client to register a new capability
/// handler on the client side.
#[derive(Debug)]
pub enum RegistrationRequest {}
impl Request for RegistrationRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::ClientRegisterCapability;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = RegistrationParams;
    type Result = ();
}

/// The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability
/// handler on the client side.
#[derive(Debug)]
pub enum UnregistrationRequest {}
impl Request for UnregistrationRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::ClientUnregisterCapability;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = UnregistrationParams;
    type Result = ();
}

/// The initialize request is sent from the client to the server.
/// It is sent once as the request after starting up the server.
/// The requests parameter is of type [`InitializeParams`]
/// the response if of type [`InitializeResult`] of a Thenable that
/// resolves to such.
#[derive(Debug)]
pub enum InitializeRequest {}
impl Request for InitializeRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::Initialize;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = InitializeParams;
    type Result = InitializeResult;
}

/// A shutdown request is sent from the client to the server.
/// It is sent once when the client decides to shutdown the
/// server. The only notification that is sent after a shutdown request
/// is the exit event.
#[derive(Debug)]
pub enum ShutdownRequest {}
impl Request for ShutdownRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::Shutdown;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = ();
    type Result = ();
}

/// The show message request is sent from the server to the client to show a message
/// and a set of options actions to the user.
#[derive(Debug)]
pub enum ShowMessageRequest {}
impl Request for ShowMessageRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WindowShowMessageRequest;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ShowMessageRequestParams;
    type Result = Option<MessageActionItem>;
}

/// A document will save request is sent from the client to the server before
/// the document is actually saved. The request can return an array of TextEdits
/// which will be applied to the text document before it is saved. Please note that
/// clients might drop results if computing the text edits took too long or if a
/// server constantly fails on this request. This is done to keep the save fast and
/// reliable.
#[derive(Debug)]
pub enum WillSaveTextDocumentWaitUntilRequest {}
impl Request for WillSaveTextDocumentWaitUntilRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentWillSaveWaitUntil;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = WillSaveTextDocumentParams;
    type Result = Option<Vec<TextEdit>>;
}

/// Request to request completion at a given text document position. The request's
/// parameter is of type [`TextDocumentPosition`] the response
/// is of type [CompletionItem[]][CompletionItem] or [`CompletionList`]
/// or a Thenable that resolves to such.
///
/// The request can delay the computation of the [`detail`][`CompletionItem::detail`]
/// and [`documentation`][`CompletionItem::documentation`] properties to the `completionItem/resolve`
/// request. However, properties that are needed for the initial sorting and filtering, like `sortText`,
/// `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
#[derive(Debug)]
pub enum CompletionRequest {}
impl Request for CompletionRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentCompletion;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CompletionParams;
    type Result = Option<CompletionResponse>;
}

/// Request to resolve additional information for a given completion item.The request's
/// parameter is of type [`CompletionItem`] the response
/// is of type [`CompletionItem`] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum CompletionResolveRequest {}
impl Request for CompletionResolveRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::CompletionItemResolve;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CompletionItem;
    type Result = CompletionItem;
}

/// Request to request hover information at a given text document position. The request's
/// parameter is of type [`TextDocumentPosition`] the response is of
/// type [`Hover`] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum HoverRequest {}
impl Request for HoverRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentHover;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = HoverParams;
    type Result = Option<Hover>;
}

#[derive(Debug)]
pub enum SignatureHelpRequest {}
impl Request for SignatureHelpRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentSignatureHelp;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = SignatureHelpParams;
    type Result = Option<SignatureHelp>;
}

/// A request to resolve the definition location of a symbol at a given text
/// document position. The request's parameter is of type [`TextDocumentPosition`]
/// the response is of either type [`Definition`] or a typed array of
/// [`DefinitionLink`] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum DefinitionRequest {}
impl Request for DefinitionRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentDefinition;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DefinitionParams;
    type Result = Option<DefinitionResponse>;
}

/// A request to resolve project-wide references for the symbol denoted
/// by the given text document position. The request's parameter is of
/// type [`ReferenceParams`] the response is of type
/// [Location[]][Location] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum ReferencesRequest {}
impl Request for ReferencesRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentReferences;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = ReferenceParams;
    type Result = Option<Vec<Location>>;
}

/// Request to resolve a [`DocumentHighlight`] for a given
/// text document position. The request's parameter is of type [`TextDocumentPosition`]
/// the request response is an array of type [`DocumentHighlight`]
/// or a Thenable that resolves to such.
#[derive(Debug)]
pub enum DocumentHighlightRequest {}
impl Request for DocumentHighlightRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentDocumentHighlight;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentHighlightParams;
    type Result = Option<Vec<DocumentHighlight>>;
}

/// A request to list all symbols found in a given text document. The request's
/// parameter is of type [`TextDocumentIdentifier`] the
/// response is of type [SymbolInformation[]][SymbolInformation] or a Thenable
/// that resolves to such.
#[derive(Debug)]
pub enum DocumentSymbolRequest {}
impl Request for DocumentSymbolRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentDocumentSymbol;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentSymbolParams;
    type Result = Option<DocumentSymbolResponse>;
}

/// A request to provide commands for the given text document and range.
#[derive(Debug)]
pub enum CodeActionRequest {}
impl Request for CodeActionRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentCodeAction;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CodeActionParams;
    type Result = Option<Vec<CodeActionResponse>>;
}

/// Request to resolve additional information for a given code action.The request's
/// parameter is of type [`CodeAction`] the response
/// is of type [`CodeAction`] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum CodeActionResolveRequest {}
impl Request for CodeActionResolveRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::CodeActionResolve;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CodeAction;
    type Result = CodeAction;
}

/// A request to list project-wide symbols matching the query string given
/// by the [`WorkspaceSymbolParams`]. The response is
/// of type [SymbolInformation[]][SymbolInformation] or a Thenable that
/// resolves to such.
///
/// @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients
///  need to advertise support for WorkspaceSymbols via the client capability
///  `workspace.symbol.resolveSupport`.
///
#[derive(Debug)]
pub enum WorkspaceSymbolRequest {}
impl Request for WorkspaceSymbolRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceSymbol;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = WorkspaceSymbolParams;
    type Result = Option<WorkspaceSymbolResponse>;
}

/// A request to resolve the range inside the workspace
/// symbol's location.
///
/// @since 3.17.0
#[derive(Debug)]
pub enum WorkspaceSymbolResolveRequest {}
impl Request for WorkspaceSymbolResolveRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceSymbolResolve;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = WorkspaceSymbol;
    type Result = WorkspaceSymbol;
}

/// A request to provide code lens for the given text document.
#[derive(Debug)]
pub enum CodeLensRequest {}
impl Request for CodeLensRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentCodeLens;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CodeLensParams;
    type Result = Option<Vec<CodeLens>>;
}

/// A request to resolve a command for a given code lens.
#[derive(Debug)]
pub enum CodeLensResolveRequest {}
impl Request for CodeLensResolveRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::CodeLensResolve;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = CodeLens;
    type Result = CodeLens;
}

/// A request to refresh all code actions
///
/// @since 3.16.0
#[derive(Debug)]
pub enum CodeLensRefreshRequest {}
impl Request for CodeLensRefreshRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceCodeLensRefresh;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ();
    type Result = ();
}

/// A request to provide document links
#[derive(Debug)]
pub enum DocumentLinkRequest {}
impl Request for DocumentLinkRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentDocumentLink;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentLinkParams;
    type Result = Option<Vec<DocumentLink>>;
}

/// Request to resolve additional information for a given document link. The request's
/// parameter is of type [`DocumentLink`] the response
/// is of type [`DocumentLink`] or a Thenable that resolves to such.
#[derive(Debug)]
pub enum DocumentLinkResolveRequest {}
impl Request for DocumentLinkResolveRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::DocumentLinkResolve;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentLink;
    type Result = DocumentLink;
}

/// A request to format a whole document.
#[derive(Debug)]
pub enum DocumentFormattingRequest {}
impl Request for DocumentFormattingRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentFormatting;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentFormattingParams;
    type Result = Option<Vec<TextEdit>>;
}

/// A request to format a range in a document.
#[derive(Debug)]
pub enum DocumentRangeFormattingRequest {}
impl Request for DocumentRangeFormattingRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentRangeFormatting;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentRangeFormattingParams;
    type Result = Option<Vec<TextEdit>>;
}

/// A request to format ranges in a document.
///
/// @since 3.18.0
/// @proposed
#[derive(Debug)]
pub enum DocumentRangesFormattingRequest {}
impl Request for DocumentRangesFormattingRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentRangesFormatting;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentRangesFormattingParams;
    type Result = Option<Vec<TextEdit>>;
}

/// A request to format a document on type.
#[derive(Debug)]
pub enum DocumentOnTypeFormattingRequest {}
impl Request for DocumentOnTypeFormattingRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentOnTypeFormatting;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = DocumentOnTypeFormattingParams;
    type Result = Option<Vec<TextEdit>>;
}

/// A request to rename a symbol.
#[derive(Debug)]
pub enum RenameRequest {}
impl Request for RenameRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentRename;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = RenameParams;
    type Result = Option<WorkspaceEdit>;
}

/// A request to test and perform the setup necessary for a rename.
///
/// @since 3.16 - support for default behavior
#[derive(Debug)]
pub enum PrepareRenameRequest {}
impl Request for PrepareRenameRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::TextDocumentPrepareRename;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = PrepareRenameParams;
    type Result = Option<PrepareRenameResult>;
}

/// A request send from the client to the server to execute a command. The request might return
/// a workspace edit which the client will apply to the workspace.
#[derive(Debug)]
pub enum ExecuteCommandRequest {}
impl Request for ExecuteCommandRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceExecuteCommand;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ClientToServer;
    type Params = ExecuteCommandParams;
    type Result = Option<LspAny>;
}

/// A request sent from the server to the client to modified certain resources.
#[derive(Debug)]
pub enum ApplyWorkspaceEditRequest {}
impl Request for ApplyWorkspaceEditRequest {
    const METHOD: LspRequestMethod<'static> = LspRequestMethod::WorkspaceApplyEdit;
    const MESSAGE_DIRECTION: MessageDirection = MessageDirection::ServerToClient;
    type Params = ApplyWorkspaceEditParams;
    type Result = ApplyWorkspaceEditResult;
}