1use super::*;
2
3use serde::{de::DeserializeOwned, Serialize};
4
5pub trait Request {
6 type Params: DeserializeOwned + Serialize;
7 type Result: DeserializeOwned + Serialize;
8 const METHOD: &'static str;
9}
10
11#[macro_export]
12macro_rules! lsp_request {
13 ("initialize") => {
14 $crate::request::Initialize
15 };
16 ("shutdown") => {
17 $crate::request::Shutdown
18 };
19
20 ("window/showMessageRequest") => {
21 $crate::request::ShowMessageRequest
22 };
23
24 ("client/registerCapability") => {
25 $crate::request::RegisterCapability
26 };
27 ("client/unregisterCapability") => {
28 $crate::request::UnregisterCapability
29 };
30
31 ("workspace/symbol") => {
32 $crate::request::WorkspaceSymbolRequest
33 };
34 ("workspaceSymbol/resolve") => {
35 $crate::request::WorkspaceSymbolResolve
36 };
37 ("workspace/executeCommand") => {
38 $crate::request::ExecuteCommand
39 };
40
41 ("textDocument/willSaveWaitUntil") => {
42 $crate::request::WillSaveWaitUntil
43 };
44
45 ("textDocument/completion") => {
46 $crate::request::Completion
47 };
48 ("completionItem/resolve") => {
49 $crate::request::ResolveCompletionItem
50 };
51 ("textDocument/hover") => {
52 $crate::request::HoverRequest
53 };
54 ("textDocument/signatureHelp") => {
55 $crate::request::SignatureHelpRequest
56 };
57 ("textDocument/declaration") => {
58 $crate::request::GotoDeclaration
59 };
60 ("textDocument/definition") => {
61 $crate::request::GotoDefinition
62 };
63 ("textDocument/references") => {
64 $crate::request::References
65 };
66 ("textDocument/documentHighlight") => {
67 $crate::request::DocumentHighlightRequest
68 };
69 ("textDocument/documentSymbol") => {
70 $crate::request::DocumentSymbolRequest
71 };
72 ("textDocument/codeAction") => {
73 $crate::request::CodeActionRequest
74 };
75 ("textDocument/codeLens") => {
76 $crate::request::CodeLensRequest
77 };
78 ("codeLens/resolve") => {
79 $crate::request::CodeLensResolve
80 };
81 ("textDocument/documentLink") => {
82 $crate::request::DocumentLinkRequest
83 };
84 ("documentLink/resolve") => {
85 $crate::request::DocumentLinkResolve
86 };
87 ("workspace/applyEdit") => {
88 $crate::request::ApplyWorkspaceEdit
89 };
90 ("textDocument/rangeFormatting") => {
91 $crate::request::RangeFormatting
92 };
93 ("textDocument/onTypeFormatting") => {
94 $crate::request::OnTypeFormatting
95 };
96 ("textDocument/formatting") => {
97 $crate::request::Formatting
98 };
99 ("textDocument/rename") => {
100 $crate::request::Rename
101 };
102 ("textDocument/documentColor") => {
103 $crate::request::DocumentColor
104 };
105 ("textDocument/colorPresentation") => {
106 $crate::request::ColorPresentationRequest
107 };
108 ("textDocument/foldingRange") => {
109 $crate::request::FoldingRangeRequest
110 };
111 ("textDocument/prepareRename") => {
112 $crate::request::PrepareRenameRequest
113 };
114 ("textDocument/implementation") => {
115 $crate::request::GotoImplementation
116 };
117 ("textDocument/typeDefinition") => {
118 $crate::request::GotoTypeDefinition
119 };
120 ("textDocument/selectionRange") => {
121 $crate::request::SelectionRangeRequest
122 };
123 ("workspace/workspaceFolders") => {
124 $crate::request::WorkspaceFoldersRequest
125 };
126 ("workspace/configuration") => {
127 $crate::request::WorkspaceConfiguration
128 };
129 ("window/workDoneProgress/create") => {
130 $crate::request::WorkDoneProgressCreate
131 };
132 ("callHierarchy/incomingCalls") => {
133 $crate::request::CallHierarchyIncomingCalls
134 };
135 ("callHierarchy/outgoingCalls") => {
136 $crate::request::CallHierarchyOutgoingCalls
137 };
138 ("textDocument/moniker") => {
139 $crate::request::MonikerRequest
140 };
141 ("textDocument/linkedEditingRange") => {
142 $crate::request::LinkedEditingRange
143 };
144 ("textDocument/prepareCallHierarchy") => {
145 $crate::request::CallHierarchyPrepare
146 };
147 ("textDocument/prepareTypeHierarchy") => {
148 $crate::request::TypeHierarchyPrepare
149 };
150 ("textDocument/semanticTokens/full") => {
151 $crate::request::SemanticTokensFullRequest
152 };
153 ("textDocument/semanticTokens/full/delta") => {
154 $crate::request::SemanticTokensFullDeltaRequest
155 };
156 ("textDocument/semanticTokens/range") => {
157 $crate::request::SemanticTokensRangeRequest
158 };
159 ("textDocument/inlayHint") => {
160 $crate::request::InlayHintRequest
161 };
162 ("textDocument/inlineValue") => {
163 $crate::request::InlineValueRequest
164 };
165 ("textDocument/diagnostic") => {
166 $crate::request::DocumentDiagnosticRequest
167 };
168 ("workspace/diagnostic") => {
169 $crate::request::WorkspaceDiagnosticRequest
170 };
171 ("workspace/diagnostic/refresh") => {
172 $crate::request::WorkspaceDiagnosticRefresh
173 };
174 ("typeHierarchy/supertypes") => {
175 $crate::request::TypeHierarchySupertypes
176 };
177 ("typeHierarchy/subtypes") => {
178 $crate::request::TypeHierarchySubtypes
179 };
180 ("workspace/willCreateFiles") => {
181 $crate::request::WillCreateFiles
182 };
183 ("workspace/willRenameFiles") => {
184 $crate::request::WillRenameFiles
185 };
186 ("workspace/willDeleteFiles") => {
187 $crate::request::WillDeleteFiles
188 };
189 ("workspace/semanticTokens/refresh") => {
190 $crate::request::SemanticTokensRefresh
191 };
192 ("workspace/codeLens/refresh") => {
193 $crate::request::CodeLensRefresh
194 };
195 ("workspace/inlayHint/refresh") => {
196 $crate::request::InlayHintRefreshRequest
197 };
198 ("workspace/inlineValue/refresh") => {
199 $crate::request::InlineValueRefreshRequest
200 };
201 ("codeAction/resolve") => {
202 $crate::request::CodeActionResolveRequest
203 };
204 ("inlayHint/resolve") => {
205 $crate::request::InlayHintResolveRequest
206 };
207 ("window/showDocument") => {
208 $crate::request::ShowDocument
209 };
210}
211
212#[derive(Debug)]
218pub enum Initialize {}
219
220impl Request for Initialize {
221 type Params = InitializeParams;
222 type Result = InitializeResult;
223 const METHOD: &'static str = "initialize";
224}
225
226#[derive(Debug)]
230pub enum Shutdown {}
231
232impl Request for Shutdown {
233 type Params = ();
234 type Result = ();
235 const METHOD: &'static str = "shutdown";
236}
237
238#[derive(Debug)]
242pub enum ShowMessageRequest {}
243
244impl Request for ShowMessageRequest {
245 type Params = ShowMessageRequestParams;
246 type Result = Option<MessageActionItem>;
247 const METHOD: &'static str = "window/showMessageRequest";
248}
249
250#[derive(Debug)]
254pub enum RegisterCapability {}
255
256impl Request for RegisterCapability {
257 type Params = RegistrationParams;
258 type Result = ();
259 const METHOD: &'static str = "client/registerCapability";
260}
261
262#[derive(Debug)]
265pub enum UnregisterCapability {}
266
267impl Request for UnregisterCapability {
268 type Params = UnregistrationParams;
269 type Result = ();
270 const METHOD: &'static str = "client/unregisterCapability";
271}
272
273#[derive(Debug)]
284pub enum Completion {}
285
286impl Request for Completion {
287 type Params = CompletionParams;
288 type Result = Option<CompletionResponse>;
289 const METHOD: &'static str = "textDocument/completion";
290}
291
292#[derive(Debug)]
294pub enum ResolveCompletionItem {}
295
296impl Request for ResolveCompletionItem {
297 type Params = CompletionItem;
298 type Result = CompletionItem;
299 const METHOD: &'static str = "completionItem/resolve";
300}
301
302#[derive(Debug)]
305pub enum HoverRequest {}
306
307impl Request for HoverRequest {
308 type Params = HoverParams;
309 type Result = Option<Hover>;
310 const METHOD: &'static str = "textDocument/hover";
311}
312
313#[derive(Debug)]
316pub enum SignatureHelpRequest {}
317
318impl Request for SignatureHelpRequest {
319 type Params = SignatureHelpParams;
320 type Result = Option<SignatureHelp>;
321 const METHOD: &'static str = "textDocument/signatureHelp";
322}
323
324#[derive(Debug)]
325pub enum GotoDeclaration {}
326pub type GotoDeclarationParams = GotoDefinitionParams;
327pub type GotoDeclarationResponse = GotoDefinitionResponse;
328
329impl Request for GotoDeclaration {
332 type Params = GotoDeclarationParams;
333 type Result = Option<GotoDeclarationResponse>;
334 const METHOD: &'static str = "textDocument/declaration";
335}
336
337#[derive(Debug)]
340pub enum GotoDefinition {}
341
342impl Request for GotoDefinition {
343 type Params = GotoDefinitionParams;
344 type Result = Option<GotoDefinitionResponse>;
345 const METHOD: &'static str = "textDocument/definition";
346}
347
348#[derive(Debug)]
351pub enum References {}
352
353impl Request for References {
354 type Params = ReferenceParams;
355 type Result = Option<Vec<Location>>;
356 const METHOD: &'static str = "textDocument/references";
357}
358
359#[derive(Debug)]
363pub enum GotoTypeDefinition {}
364
365pub type GotoTypeDefinitionParams = GotoDefinitionParams;
366pub type GotoTypeDefinitionResponse = GotoDefinitionResponse;
367
368impl Request for GotoTypeDefinition {
369 type Params = GotoTypeDefinitionParams;
370 type Result = Option<GotoTypeDefinitionResponse>;
371 const METHOD: &'static str = "textDocument/typeDefinition";
372}
373
374#[derive(Debug)]
378pub enum GotoImplementation {}
379
380pub type GotoImplementationParams = GotoTypeDefinitionParams;
381pub type GotoImplementationResponse = GotoDefinitionResponse;
382
383impl Request for GotoImplementation {
384 type Params = GotoImplementationParams;
385 type Result = Option<GotoImplementationResponse>;
386 const METHOD: &'static str = "textDocument/implementation";
387}
388
389#[derive(Debug)]
397pub enum DocumentHighlightRequest {}
398
399impl Request for DocumentHighlightRequest {
400 type Params = DocumentHighlightParams;
401 type Result = Option<Vec<DocumentHighlight>>;
402 const METHOD: &'static str = "textDocument/documentHighlight";
403}
404
405#[derive(Debug)]
408pub enum DocumentSymbolRequest {}
409
410impl Request for DocumentSymbolRequest {
411 type Params = DocumentSymbolParams;
412 type Result = Option<DocumentSymbolResponse>;
413 const METHOD: &'static str = "textDocument/documentSymbol";
414}
415
416#[derive(Debug)]
419pub enum WorkspaceSymbolRequest {}
420
421impl Request for WorkspaceSymbolRequest {
422 type Params = WorkspaceSymbolParams;
423 type Result = Option<WorkspaceSymbolResponse>;
424 const METHOD: &'static str = "workspace/symbol";
425}
426
427#[derive(Debug)]
430pub enum WorkspaceSymbolResolve {}
431
432impl Request for WorkspaceSymbolResolve {
433 type Params = WorkspaceSymbol;
434 type Result = WorkspaceSymbol;
435 const METHOD: &'static str = "workspaceSymbol/resolve";
436}
437
438#[derive(Debug)]
442pub enum ExecuteCommand {}
443
444impl Request for ExecuteCommand {
445 type Params = ExecuteCommandParams;
446 type Result = Option<Value>;
447 const METHOD: &'static str = "workspace/executeCommand";
448}
449
450#[derive(Debug)]
456pub enum WillSaveWaitUntil {}
457
458impl Request for WillSaveWaitUntil {
459 type Params = WillSaveTextDocumentParams;
460 type Result = Option<Vec<TextEdit>>;
461 const METHOD: &'static str = "textDocument/willSaveWaitUntil";
462}
463
464#[derive(Debug)]
467pub enum ApplyWorkspaceEdit {}
468
469impl Request for ApplyWorkspaceEdit {
470 type Params = ApplyWorkspaceEditParams;
471 type Result = ApplyWorkspaceEditResponse;
472 const METHOD: &'static str = "workspace/applyEdit";
473}
474
475#[derive(Debug)]
489pub enum WorkspaceConfiguration {}
490
491impl Request for WorkspaceConfiguration {
492 type Params = ConfigurationParams;
493 type Result = Vec<Value>;
494 const METHOD: &'static str = "workspace/configuration";
495}
496
497#[derive(Debug)]
501pub enum CodeActionRequest {}
502
503impl Request for CodeActionRequest {
504 type Params = CodeActionParams;
505 type Result = Option<CodeActionResponse>;
506 const METHOD: &'static str = "textDocument/codeAction";
507}
508
509#[derive(Debug)]
515pub enum CodeActionResolveRequest {}
516
517impl Request for CodeActionResolveRequest {
518 type Params = CodeAction;
519 type Result = CodeAction;
520 const METHOD: &'static str = "codeAction/resolve";
521}
522
523#[derive(Debug)]
525pub enum CodeLensRequest {}
526
527impl Request for CodeLensRequest {
528 type Params = CodeLensParams;
529 type Result = Option<Vec<CodeLens>>;
530 const METHOD: &'static str = "textDocument/codeLens";
531}
532
533#[derive(Debug)]
536pub enum CodeLensResolve {}
537
538impl Request for CodeLensResolve {
539 type Params = CodeLens;
540 type Result = CodeLens;
541 const METHOD: &'static str = "codeLens/resolve";
542}
543
544#[derive(Debug)]
546pub enum DocumentLinkRequest {}
547
548impl Request for DocumentLinkRequest {
549 type Params = DocumentLinkParams;
550 type Result = Option<Vec<DocumentLink>>;
551 const METHOD: &'static str = "textDocument/documentLink";
552}
553
554#[derive(Debug)]
557pub enum DocumentLinkResolve {}
558
559impl Request for DocumentLinkResolve {
560 type Params = DocumentLink;
561 type Result = DocumentLink;
562 const METHOD: &'static str = "documentLink/resolve";
563}
564
565#[derive(Debug)]
567pub enum Formatting {}
568
569impl Request for Formatting {
570 type Params = DocumentFormattingParams;
571 type Result = Option<Vec<TextEdit>>;
572 const METHOD: &'static str = "textDocument/formatting";
573}
574
575#[derive(Debug)]
577pub enum RangeFormatting {}
578
579impl Request for RangeFormatting {
580 type Params = DocumentRangeFormattingParams;
581 type Result = Option<Vec<TextEdit>>;
582 const METHOD: &'static str = "textDocument/rangeFormatting";
583}
584
585#[derive(Debug)]
588pub enum OnTypeFormatting {}
589
590impl Request for OnTypeFormatting {
591 type Params = DocumentOnTypeFormattingParams;
592 type Result = Option<Vec<TextEdit>>;
593 const METHOD: &'static str = "textDocument/onTypeFormatting";
594}
595
596#[derive(Debug)]
602pub enum LinkedEditingRange {}
603
604impl Request for LinkedEditingRange {
605 type Params = LinkedEditingRangeParams;
606 type Result = Option<LinkedEditingRanges>;
607 const METHOD: &'static str = "textDocument/linkedEditingRange";
608}
609
610#[derive(Debug)]
612pub enum Rename {}
613
614impl Request for Rename {
615 type Params = RenameParams;
616 type Result = Option<WorkspaceEdit>;
617 const METHOD: &'static str = "textDocument/rename";
618}
619
620#[derive(Debug)]
623pub enum DocumentColor {}
624
625impl Request for DocumentColor {
626 type Params = DocumentColorParams;
627 type Result = Vec<ColorInformation>;
628 const METHOD: &'static str = "textDocument/documentColor";
629}
630
631#[derive(Debug)]
634pub enum ColorPresentationRequest {}
635
636impl Request for ColorPresentationRequest {
637 type Params = ColorPresentationParams;
638 type Result = Vec<ColorPresentation>;
639 const METHOD: &'static str = "textDocument/colorPresentation";
640}
641
642#[derive(Debug)]
644pub enum FoldingRangeRequest {}
645
646impl Request for FoldingRangeRequest {
647 type Params = FoldingRangeParams;
648 type Result = Option<Vec<FoldingRange>>;
649 const METHOD: &'static str = "textDocument/foldingRange";
650}
651
652#[derive(Debug)]
655pub enum PrepareRenameRequest {}
656
657impl Request for PrepareRenameRequest {
658 type Params = TextDocumentPositionParams;
659 type Result = Option<PrepareRenameResponse>;
660 const METHOD: &'static str = "textDocument/prepareRename";
661}
662
663#[derive(Debug)]
667pub enum WorkspaceFoldersRequest {}
668
669impl Request for WorkspaceFoldersRequest {
670 type Params = ();
671 type Result = Option<Vec<WorkspaceFolder>>;
672 const METHOD: &'static str = "workspace/workspaceFolders";
673}
674
675#[derive(Debug)]
678pub enum WorkDoneProgressCreate {}
679
680impl Request for WorkDoneProgressCreate {
681 type Params = WorkDoneProgressCreateParams;
682 type Result = ();
683 const METHOD: &'static str = "window/workDoneProgress/create";
684}
685
686pub enum SelectionRangeRequest {}
696
697impl Request for SelectionRangeRequest {
698 type Params = SelectionRangeParams;
699 type Result = Option<Vec<SelectionRange>>;
700 const METHOD: &'static str = "textDocument/selectionRange";
701}
702
703pub enum CallHierarchyPrepare {}
704
705impl Request for CallHierarchyPrepare {
706 type Params = CallHierarchyPrepareParams;
707 type Result = Option<Vec<CallHierarchyItem>>;
708 const METHOD: &'static str = "textDocument/prepareCallHierarchy";
709}
710
711pub enum CallHierarchyIncomingCalls {}
712
713impl Request for CallHierarchyIncomingCalls {
714 type Params = CallHierarchyIncomingCallsParams;
715 type Result = Option<Vec<CallHierarchyIncomingCall>>;
716 const METHOD: &'static str = "callHierarchy/incomingCalls";
717}
718
719pub enum CallHierarchyOutgoingCalls {}
720
721impl Request for CallHierarchyOutgoingCalls {
722 type Params = CallHierarchyOutgoingCallsParams;
723 type Result = Option<Vec<CallHierarchyOutgoingCall>>;
724 const METHOD: &'static str = "callHierarchy/outgoingCalls";
725}
726
727pub enum SemanticTokensFullRequest {}
728
729impl Request for SemanticTokensFullRequest {
730 type Params = SemanticTokensParams;
731 type Result = Option<SemanticTokensResult>;
732 const METHOD: &'static str = "textDocument/semanticTokens/full";
733}
734
735pub enum SemanticTokensFullDeltaRequest {}
736
737impl Request for SemanticTokensFullDeltaRequest {
738 type Params = SemanticTokensDeltaParams;
739 type Result = Option<SemanticTokensFullDeltaResult>;
740 const METHOD: &'static str = "textDocument/semanticTokens/full/delta";
741}
742
743pub enum SemanticTokensRangeRequest {}
744
745impl Request for SemanticTokensRangeRequest {
746 type Params = SemanticTokensRangeParams;
747 type Result = Option<SemanticTokensRangeResult>;
748 const METHOD: &'static str = "textDocument/semanticTokens/range";
749}
750
751pub enum SemanticTokensRefresh {}
757
758impl Request for SemanticTokensRefresh {
759 type Params = ();
760 type Result = ();
761 const METHOD: &'static str = "workspace/semanticTokens/refresh";
762}
763
764pub enum CodeLensRefresh {}
770
771impl Request for CodeLensRefresh {
772 type Params = ();
773 type Result = ();
774 const METHOD: &'static str = "workspace/codeLens/refresh";
775}
776
777pub enum WillCreateFiles {}
779
780impl Request for WillCreateFiles {
781 type Params = CreateFilesParams;
782 type Result = Option<WorkspaceEdit>;
783 const METHOD: &'static str = "workspace/willCreateFiles";
784}
785
786pub enum WillRenameFiles {}
788
789impl Request for WillRenameFiles {
790 type Params = RenameFilesParams;
791 type Result = Option<WorkspaceEdit>;
792 const METHOD: &'static str = "workspace/willRenameFiles";
793}
794
795pub enum WillDeleteFiles {}
797
798impl Request for WillDeleteFiles {
799 type Params = DeleteFilesParams;
800 type Result = Option<WorkspaceEdit>;
801 const METHOD: &'static str = "workspace/willDeleteFiles";
802}
803
804pub enum ShowDocument {}
806
807impl Request for ShowDocument {
808 type Params = ShowDocumentParams;
809 type Result = ShowDocumentResult;
810 const METHOD: &'static str = "window/showDocument";
811}
812
813pub enum MonikerRequest {}
814
815impl Request for MonikerRequest {
816 type Params = MonikerParams;
817 type Result = Option<Vec<Moniker>>;
818 const METHOD: &'static str = "textDocument/moniker";
819}
820
821pub enum InlayHintRequest {}
824
825impl Request for InlayHintRequest {
826 type Params = InlayHintParams;
827 type Result = Option<Vec<InlayHint>>;
828 const METHOD: &'static str = "textDocument/inlayHint";
829}
830
831pub enum InlayHintResolveRequest {}
836
837impl Request for InlayHintResolveRequest {
838 type Params = InlayHint;
839 type Result = InlayHint;
840 const METHOD: &'static str = "inlayHint/resolve";
841}
842
843pub enum InlayHintRefreshRequest {}
850
851impl Request for InlayHintRefreshRequest {
852 type Params = ();
853 type Result = ();
854 const METHOD: &'static str = "workspace/inlayHint/refresh";
855}
856
857pub enum InlineValueRequest {}
860
861impl Request for InlineValueRequest {
862 type Params = InlineValueParams;
863 type Result = Option<InlineValue>;
864 const METHOD: &'static str = "textDocument/inlineValue";
865}
866
867pub enum InlineValueRefreshRequest {}
874
875impl Request for InlineValueRefreshRequest {
876 type Params = ();
877 type Result = ();
878 const METHOD: &'static str = "workspace/inlineValue/refresh";
879}
880
881#[derive(Debug)]
885pub enum DocumentDiagnosticRequest {}
886
887impl Request for DocumentDiagnosticRequest {
888 type Params = DocumentDiagnosticParams;
889 type Result = DocumentDiagnosticReportResult;
890 const METHOD: &'static str = "textDocument/diagnostic";
891}
892
893#[derive(Debug)]
900pub enum WorkspaceDiagnosticRequest {}
901
902impl Request for WorkspaceDiagnosticRequest {
903 type Params = WorkspaceDiagnosticParams;
904 const METHOD: &'static str = "workspace/diagnostic";
905 type Result = WorkspaceDiagnosticReportResult;
906}
907
908#[derive(Debug)]
913pub enum WorkspaceDiagnosticRefresh {}
914
915impl Request for WorkspaceDiagnosticRefresh {
916 type Params = ();
917 type Result = ();
918 const METHOD: &'static str = "workspace/diagnostic/refresh";
919}
920
921pub enum TypeHierarchyPrepare {}
928
929impl Request for TypeHierarchyPrepare {
930 type Params = TypeHierarchyPrepareParams;
931 type Result = Option<Vec<TypeHierarchyItem>>;
932 const METHOD: &'static str = "textDocument/prepareTypeHierarchy";
933}
934
935pub enum TypeHierarchySupertypes {}
941
942impl Request for TypeHierarchySupertypes {
943 type Params = TypeHierarchySupertypesParams;
944 type Result = Option<Vec<TypeHierarchyItem>>;
945 const METHOD: &'static str = "typeHierarchy/supertypes";
946}
947
948pub enum TypeHierarchySubtypes {}
953
954impl Request for TypeHierarchySubtypes {
955 type Params = TypeHierarchySubtypesParams;
956 type Result = Option<Vec<TypeHierarchyItem>>;
957 const METHOD: &'static str = "typeHierarchy/subtypes";
958}
959
960#[cfg(test)]
961mod test {
962 use super::*;
963
964 fn fake_call<R>()
965 where
966 R: Request,
967 R::Params: serde::Serialize,
968 R::Result: serde::de::DeserializeOwned,
969 {
970 }
971
972 macro_rules! check_macro {
973 ($name:tt) => {
974 assert_eq!(<lsp_request!($name) as Request>::METHOD, $name);
976 fake_call::<lsp_request!($name)>();
978 };
979 }
980
981 #[test]
982 fn check_macro_definitions() {
983 check_macro!("initialize");
984 check_macro!("shutdown");
985
986 check_macro!("window/showDocument");
987 check_macro!("window/showMessageRequest");
988 check_macro!("window/workDoneProgress/create");
989
990 check_macro!("client/registerCapability");
991 check_macro!("client/unregisterCapability");
992
993 check_macro!("textDocument/willSaveWaitUntil");
994 check_macro!("textDocument/completion");
995 check_macro!("textDocument/hover");
996 check_macro!("textDocument/signatureHelp");
997 check_macro!("textDocument/declaration");
998 check_macro!("textDocument/definition");
999 check_macro!("textDocument/references");
1000 check_macro!("textDocument/documentHighlight");
1001 check_macro!("textDocument/documentSymbol");
1002 check_macro!("textDocument/codeAction");
1003 check_macro!("textDocument/codeLens");
1004 check_macro!("textDocument/documentLink");
1005 check_macro!("textDocument/rangeFormatting");
1006 check_macro!("textDocument/onTypeFormatting");
1007 check_macro!("textDocument/formatting");
1008 check_macro!("textDocument/rename");
1009 check_macro!("textDocument/documentColor");
1010 check_macro!("textDocument/colorPresentation");
1011 check_macro!("textDocument/foldingRange");
1012 check_macro!("textDocument/prepareRename");
1013 check_macro!("textDocument/implementation");
1014 check_macro!("textDocument/selectionRange");
1015 check_macro!("textDocument/typeDefinition");
1016 check_macro!("textDocument/moniker");
1017 check_macro!("textDocument/linkedEditingRange");
1018 check_macro!("textDocument/prepareCallHierarchy");
1019 check_macro!("textDocument/prepareTypeHierarchy");
1020 check_macro!("textDocument/semanticTokens/full");
1021 check_macro!("textDocument/semanticTokens/full/delta");
1022 check_macro!("textDocument/semanticTokens/range");
1023 check_macro!("textDocument/inlayHint");
1024 check_macro!("textDocument/inlineValue");
1025 check_macro!("textDocument/diagnostic");
1026
1027 check_macro!("workspace/applyEdit");
1028 check_macro!("workspace/symbol");
1029 check_macro!("workspace/executeCommand");
1030 check_macro!("workspace/configuration");
1031 check_macro!("workspace/diagnostic");
1032 check_macro!("workspace/diagnostic/refresh");
1033 check_macro!("workspace/willCreateFiles");
1034 check_macro!("workspace/willRenameFiles");
1035 check_macro!("workspace/willDeleteFiles");
1036 check_macro!("workspace/workspaceFolders");
1037 check_macro!("workspace/semanticTokens/refresh");
1038 check_macro!("workspace/codeLens/refresh");
1039 check_macro!("workspace/inlayHint/refresh");
1040 check_macro!("workspace/inlineValue/refresh");
1041
1042 check_macro!("callHierarchy/incomingCalls");
1043 check_macro!("callHierarchy/outgoingCalls");
1044 check_macro!("codeAction/resolve");
1045 check_macro!("codeLens/resolve");
1046 check_macro!("completionItem/resolve");
1047 check_macro!("documentLink/resolve");
1048 check_macro!("inlayHint/resolve");
1049 check_macro!("typeHierarchy/subtypes");
1050 check_macro!("typeHierarchy/supertypes");
1051 check_macro!("workspaceSymbol/resolve");
1052 }
1053
1054 #[test]
1055 #[cfg(feature = "proposed")]
1056 fn check_proposed_macro_definitions() {}
1057}