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
// Copyright Two Neutron Stars Incorporated and contributors
// SPDX-License-Identifier: BlueOak-1.0.0
use {
crate::{
connect::lsp::{
LSP_CLIENT_TRACER,
LspClient,
},
protocol::lsp,
},
serde::{
Serialize,
de::DeserializeOwned,
},
};
pub trait Request {
type Params: DeserializeOwned + Serialize + Send + Sync + 'static;
type Result: DeserializeOwned + Serialize + Send + Sync + 'static;
const METHOD: &'static str;
}
macro_rules! lsp_request {
(@parse_all [] [$($output:tt)*]) => {
$($output)*
};
(@parse_all [
$(#[$meta:meta])*
$name:ident($method:literal, $params:ty $(,)?
) -> $result:ty;
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_all
[$($rest)*]
[$($output)*
$(#[$meta])*
#[derive(Debug)]
pub enum $name {}
impl Request for $name {
type Params = $params;
type Result = $result;
const METHOD: &'static str = $method;
}
]
);
};
(@parse_all [
$(#[$meta:meta])*
$name:ident($method:literal);
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_all
[$($rest)*]
[$($output)*
$(#[$meta])*
#[derive(Debug)]
pub enum $name {}
impl Request for $name {
type Params = ();
type Result = ();
const METHOD: &'static str = $method;
}
]
);
};
(@parse_all [
$(#[$meta:meta])*
$name:ident($method:literal) -> $result:ty;
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_all
[$($rest)*]
[$($output)*
$(#[$meta])*
#[derive(Debug)]
pub enum $name {}
impl Request for $name {
type Params = ();
type Result = $result;
const METHOD: &'static str = $method;
}
]
);
};
(@parse_all [
$(#[$meta:meta])*
$name:ident($method:literal, $params:ty);
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_all
[$($rest)*]
[$($output)*
$(#[$meta])*
#[derive(Debug)]
pub enum $name {}
impl Request for $name {
type Params = $params;
type Result = ();
const METHOD: &'static str = $method;
}
]
);
};
(@parse_methods [] [$($output:tt)*]) => {
impl LspClient {
$($output)*
}
};
(@parse_methods [
$(#[$meta:meta])*
$name:ident($method:literal, $params:ty) -> $result:ty;
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_methods
[$($rest)*]
[$($output)*
paste::paste! {
$(#[$meta])*
pub async fn [<$name:snake>](
&self,
params: $params,
) -> Result<$result, $crate::connect::lsp::errors::LspClientError> {
use opentelemetry::trace::FutureExt as _;
otel::span!(
@LSP_CLIENT_TRACER,
concat!("laburnum.lsp_client.request.",stringify!([<$name:snake>])),
in |cx| {
self.send_request::<$name>(params)
.with_context(cx)
.await
}
)
}
}
]
);
};
(@parse_methods [
$(#[$meta:meta])*
$name:ident($method:literal);
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_methods
[$($rest)*]
[$($output)*
paste::paste! {
$(#[$meta])*
pub async fn [<$name:snake>](&self) -> Result<(), $crate::connect::lsp::errors::LspClientError> {
use opentelemetry::trace::FutureExt as _;
otel::span!(
@LSP_CLIENT_TRACER,
concat!("laburnum.lsp_client.request.",stringify!([<$name:snake>])),
in |cx| {
self.send_request::<$name>(())
.with_context(cx)
.await
}
)
}
}
]
);
};
(@parse_methods [
$(#[$meta:meta])*
$name:ident($method:literal) -> $result:ty;
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_methods
[$($rest)*]
[$($output)*
paste::paste! {
$(#[$meta])*
pub async fn [<$name:snake>](&self) -> Result<$result, $crate::connect::lsp::errors::LspClientError> {
otel::span!(
@LSP_CLIENT_TRACER,
concat!("laburnum.lsp_client.request.",stringify!([<$name:snake>])),
in |cx| {
self.send_request::<$name>(())
.with_context(cx)
.await
}
)
}
}
]
);
};
(@parse_methods [
$(#[$meta:meta])*
$name:ident($method:literal, $params:ty);
$($rest:tt)*
] [$($output:tt)*]) => {
$crate::connect::lsp::request::lsp_request!(
@parse_methods
[$($rest)*]
[$($output)*
paste::paste! {
$(#[$meta])*
pub async fn [<$name:snake>](
&self,
params: $params,
) -> Result<(), $crate::connect::lsp::errors::LspClientError> {
otel::span!(
@LSP_CLIENT_TRACER,
concat!("laburnum.lsp_client.request.",stringify!([<$name:snake>])),
in |cx| {
self.send_request::<$name>(params)
.with_context(cx)
.await
}
)
}
}
]
);
};
($($input:tt)*) => {
$crate::connect::lsp::request::lsp_request!(@parse_all [$($input)*] []);
$crate::connect::lsp::request::lsp_request!(@parse_methods [$($input)*] []);
};
}
pub(crate) use lsp_request;
lsp_request! {
Initialize(
"initialize",
lsp::InitializeParams
) -> lsp::InitializeResult;
/// The show message request is sent from a server to a client to ask the client to display a particular message
/// in the user interface. In addition to the show message notification the request allows to pass actions and to
/// wait for an answer from the client.
ShowMessageRequest(
"window/showMessageRequest",
lsp::ShowMessageRequestParams
) -> Option<lsp::MessageActionItem>;
/// The client/registerCapability request is sent from the server to the client to register for a new capability
/// on the client side. Not all clients need to support dynamic capability registration. A client opts in via the
/// ClientCapabilities.GenericCapability property.
RegisterCapability(
"client/registerCapability",
lsp::RegistrationParams
) -> ();
/// The client/unregisterCapability request is sent from the server to the client to unregister a
/// previously register capability.
UnregisterCapability(
"client/unregisterCapability",
lsp::UnregistrationParams
) -> ();
/// The Completion request is sent from the client to the server to compute completion items at a given cursor position.
///
/// Completion items are presented in the `IntelliSense` user interface. If computing full completion items is expensive,
/// servers can additionally provide a handler for the completion item resolve request ('completionItem/resolve').
/// This request is sent when a completion item is selected in the user interface. A typical use case is for example:
/// the 'textDocument/completion' request doesn’t fill in the documentation property for returned completion items
/// since it is expensive to compute. When the item is selected in the user interface then a ‘completionItem/resolve’
/// request is sent with the selected completion item as a param. The returned completion item should have the
/// documentation property filled in. The request can delay the computation of the detail and documentation properties.
/// However, properties that are needed for the initial sorting and filtering, like sortText, filterText, insertText,
/// and textEdit must be provided in the textDocument/completion request and must not be changed during resolve.
Completion(
"textDocument/completion",
lsp::CompletionParams
) -> Option<lsp::CompletionResponse>;
/// The request is sent from the client to the server to resolve additional information for a given completion item.
ResolveCompletionItem(
"completionItem/resolve",
lsp::CompletionItem
) -> lsp::CompletionItem;
/// The hover request is sent from the client to the server to request hover information at a given text
/// document position.
HoverRequest(
"textDocument/hover",
lsp::HoverParams
) -> Option<lsp::Hover>;
/// The signature help request is sent from the client to the server to request signature information at
/// a given cursor position.
SignatureHelpRequest(
"textDocument/signatureHelp",
lsp::SignatureHelpParams
) -> Option<lsp::SignatureHelp>;
GotoDeclaration(
"textDocument/declaration",
lsp::GotoDefinitionParams
) -> Option<lsp::GotoDefinitionResponse>;
/// The goto definition request is sent from the client to the server to resolve the definition location of
/// a symbol at a given text document position.
GotoDefinition(
"textDocument/definition",
lsp::GotoDefinitionParams
) -> Option<lsp::GotoDefinitionResponse>;
/// The references request is sent from the client to the server to resolve project-wide references for the
/// symbol denoted by the given text document position.
References(
"textDocument/references",
lsp::ReferenceParams
) -> Option<Vec<lsp::Location>>;
/// The goto type definition request is sent from the client to the
/// server to resolve the type definition location of a symbol at a
/// given text document position.
GotoTypeDefinition(
"textDocument/typeDefinition",
lsp::GotoDefinitionParams
) -> Option<lsp::GotoDefinitionResponse>;
/// The goto implementation request is sent from the client to the
/// server to resolve the implementation location of a symbol at a
/// given text document position.
GotoImplementation(
"textDocument/implementation",
lsp::GotoDefinitionParams
) -> Option<lsp::GotoDefinitionResponse>;
/// The document highlight request is sent from the client to the server to resolve a document highlights
/// for a given text document position.
/// For programming languages this usually highlights all references to the symbol scoped to this file.
/// However we kept 'textDocument/documentHighlight' and 'textDocument/references' separate requests since
/// the first one is allowed to be more fuzzy.
/// Symbol matches usually have a `DocumentHighlightKind` of Read or Write whereas fuzzy or textual matches
/// use Text as the kind.
DocumentHighlightRequest(
"textDocument/documentHighlight",
lsp::DocumentHighlightParams
) -> Option<Vec<lsp::DocumentHighlight>>;
/// The document symbol request is sent from the client to the server to list all symbols found in a given
/// text document.
DocumentSymbolRequest(
"textDocument/documentSymbol",
lsp::DocumentSymbolParams
) -> Option<lsp::DocumentSymbolResponse>;
/// The workspace symbol request is sent from the client to the server to list project-wide symbols
/// matching the query string.
WorkspaceSymbolRequest(
"workspace/symbol",
lsp::WorkspaceSymbolParams
) -> Option<lsp::WorkspaceSymbolResponse>;
/// The `workspaceSymbol/resolve` request is sent from the client to the server to resolve
/// additional information for a given workspace symbol.
WorkspaceSymbolResolve(
"workspaceSymbol/resolve",
lsp::WorkspaceSymbol
) -> lsp::WorkspaceSymbol;
/// The workspace/executeCommand request is sent from the client to the server to trigger command execution on the server.
///
/// In most cases the server creates a `WorkspaceEdit` structure and applies the changes to the workspace using the request
/// workspace/applyEdit which is sent from the server to the client.
ExecuteCommand(
"workspace/executeCommand",
lsp::ExecuteCommandParams
) -> Option<serde_json::Value>;
/// The 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.
WillSaveWaitUntil(
"textDocument/willSaveWaitUntil",
lsp::WillSaveTextDocumentParams
) -> Option<Vec<lsp::TextEdit>>;
/// The workspace/applyEdit request is sent from the server to the client to modify resource on the
/// client side.
ApplyWorkspaceEdit(
"workspace/applyEdit",
lsp::ApplyWorkspaceEditParams
) -> lsp::ApplyWorkspaceEditResponse;
/// The workspace/configuration request is sent from the server to the client to fetch configuration settings
/// from the client. The request can fetch several configuration settings in one roundtrip.
/// The order of the returned configuration settings correspond to the order of the passed `ConfigurationItems`
/// (e.g. the first item in the response is the result for the first configuration item in the params).
///
/// A `ConfigurationItem` consists of the configuration section to ask for and an additional scope URI.
/// The configuration section ask for is defined by the server and doesn’t necessarily need to correspond to
/// the configuration store used be the client. So a server might ask for a configuration cpp.formatterOptions
/// but the client stores the configuration in a XML store layout differently.
/// It is up to the client to do the necessary conversion. If a scope URI is provided the client should return
/// the setting scoped to the provided resource. If the client for example uses `EditorConfig` to manage its
/// settings the configuration should be returned for the passed resource URI. If the client can’t provide a
/// configuration setting for a given scope then null need to be present in the returned array.
WorkspaceConfiguration(
"workspace/configuration",
lsp::ConfigurationParams
) -> Vec<serde_json::Value>;
/// The code action request is sent from the client to the server to compute commands for a given text document
/// and range. The request is triggered when the user moves the cursor into a problem marker in the editor or
/// presses the lightbulb associated with a marker.
CodeActionRequest(
"textDocument/codeAction",
lsp::CodeActionParams
) -> Option<lsp::CodeActionResponse>;
/// The request is sent from the client to the server to resolve additional information for a given code action.
///
/// This is usually used to compute the `edit` property of a code action to avoid its unnecessary computation
/// during the `textDocument/codeAction` request.
///
/// @since 3.16.0
CodeActionResolveRequest(
"codeAction/resolve",
lsp::CodeAction
) -> lsp::CodeAction;
/// The code lens request is sent from the client to the server to compute code lenses for a given text document.
CodeLensRequest(
"textDocument/codeLens",
lsp::CodeLensParams
) -> Option<Vec<lsp::CodeLens>>;
/// The code lens resolve request is sent from the client to the server to resolve the command for a
/// given code lens item.
CodeLensResolve(
"codeLens/resolve",
lsp::CodeLens
) -> lsp::CodeLens;
/// The document links request is sent from the client to the server to request the location of links in a document.
DocumentLinkRequest(
"textDocument/documentLink",
lsp::DocumentLinkParams
) -> Option<Vec<lsp::DocumentLink>>;
/// The document link resolve request is sent from the client to the server to resolve the target of
/// a given document link.
DocumentLinkResolve(
"documentLink/resolve",
lsp::DocumentLink
) -> lsp::DocumentLink;
/// The document formatting request is sent from the server to the client to format a whole document.
Formatting(
"textDocument/formatting",
lsp::DocumentFormattingParams
) -> Option<Vec<lsp::TextEdit>>;
/// The document range formatting request is sent from the client to the server to format a given range in a document.
RangeFormatting(
"textDocument/rangeFormatting",
lsp::DocumentRangeFormattingParams
) -> Option<Vec<lsp::TextEdit>>;
/// The document on type formatting request is sent from the client to the server to format parts of
/// the document during typing.
OnTypeFormatting(
"textDocument/onTypeFormatting",
lsp::DocumentOnTypeFormattingParams
) -> Option<Vec<lsp::TextEdit>>;
/// The linked editing request is sent from the client to the server to return for a given position in a document
/// the range of the symbol at the position and all ranges that have the same content.
/// Optionally a word pattern can be returned to describe valid contents. A rename to one of the ranges can be applied
/// to all other ranges if the new content is valid. If no result-specific word pattern is provided, the word pattern from
/// the client’s language configuration is used.
LinkedEditingRange(
"textDocument/linkedEditingRange",
lsp::LinkedEditingRangeParams
) -> Option<lsp::LinkedEditingRanges>;
/// The rename request is sent from the client to the server to perform a workspace-wide rename of a symbol.
Rename(
"textDocument/rename",
lsp::RenameParams
) -> Option<lsp::WorkspaceEdit>;
/// The document color request is sent from the client to the server to list all color references found in a given text document.
/// Along with the range, a color value in RGB is returned.
DocumentColor(
"textDocument/documentColor",
lsp::DocumentColorParams
) -> Vec<lsp::ColorInformation>;
/// The color presentation request is sent from the client to the server to obtain a list of presentations for a color value
/// at a given location.
ColorPresentationRequest(
"textDocument/colorPresentation",
lsp::ColorPresentationParams
) -> Vec<lsp::ColorPresentation>;
/// The folding range request is sent from the client to the server to return all folding ranges found in a given text document.
FoldingRangeRequest(
"textDocument/foldingRange",
lsp::FoldingRangeParams
) -> Option<Vec<lsp::FoldingRange>>;
/// The prepare rename request is sent from the client to the server to setup and test the validity of a rename operation
/// at a given location.
PrepareRenameRequest(
"textDocument/prepareRename",
lsp::TextDocumentPositionParams
) -> Option<lsp::PrepareRenameResponse>;
InlineCompletionRequest(
"textDocument/inlineCompletion",
lsp::InlineCompletionParams
) -> Option<lsp::InlineCompletionResponse>;
/// The workspace/workspaceFolders request is sent from the server to the client to fetch the current open list of
/// workspace folders. Returns null in the response if only a single file is open in the tool.
/// Returns an empty array if a workspace is open but no folders are configured.
WorkspaceFoldersRequest(
"workspace/workspaceFolders",
()
) -> Option<Vec<lsp::WorkspaceFolder>>;
/// The `window/workDoneProgress/create` request is sent from the server
/// to the client to ask the client to create a work done progress.
WorkDoneProgressCreate(
"window/workDoneProgress/create",
lsp::WorkDoneProgressCreateParams
) -> ();
/// The selection range request is sent from the client to the server to return
/// suggested selection ranges at given positions. A selection range is a range
/// around the cursor position which the user might be interested in selecting.
///
/// A selection range in the return array is for the position in the provided parameters at the same index.
/// Therefore `positions[i]` must be contained in `result[i].range`.
///
/// Typically, but not necessary, selection ranges correspond to the nodes of the
/// syntax tree.
SelectionRangeRequest(
"textDocument/selectionRange",
lsp::SelectionRangeParams
) -> Option<Vec<lsp::SelectionRange>>;
CallHierarchyPrepare(
"textDocument/prepareCallHierarchy",
lsp::CallHierarchyPrepareParams
) -> Option<Vec<lsp::CallHierarchyItem>>;
CallHierarchyIncomingCalls(
"callHierarchy/incomingCalls",
lsp::CallHierarchyIncomingCallsParams
) -> Option<Vec<lsp::CallHierarchyIncomingCall>>;
CallHierarchyOutgoingCalls(
"callHierarchy/outgoingCalls",
lsp::CallHierarchyOutgoingCallsParams
) -> Option<Vec<lsp::CallHierarchyOutgoingCall>>;
SemanticTokensFullRequest(
"textDocument/semanticTokens/full",
lsp::SemanticTokensParams
) -> Option<lsp::SemanticTokensResult>;
SemanticTokensFullDeltaRequest(
"textDocument/semanticTokens/full/delta",
lsp::SemanticTokensDeltaParams
) -> Option<lsp::SemanticTokensFullDeltaResult>;
SemanticTokensRangeRequest(
"textDocument/semanticTokens/range",
lsp::SemanticTokensRangeParams
) -> Option<lsp::SemanticTokensRangeResult>;
/// 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. Please note that clients might drop
/// results if computing the edit took too long or if a server constantly fails on
/// this request. This is done to keep creates fast and reliable.
WillCreateFiles(
"workspace/willCreateFiles",
lsp::CreateFilesParams
) -> Option<lsp::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. The request can return a `WorkspaceEdit` which will be applied to workspace before the files are renamed. Please note that clients might drop results if computing the edit took too long or if a server constantly fails on this request. This is done to keep renames fast and reliable.
WillRenameFiles(
"workspace/willRenameFiles",
lsp::RenameFilesParams
) -> Option<lsp::WorkspaceEdit>;
/// The will delete files request is sent from the client to the server before files are actually deleted as long as the deletion is triggered from within the client. The request can return a `WorkspaceEdit` which will be applied to workspace before the files are deleted. Please note that clients might drop results if computing the edit took too long or if a server constantly fails on this request. This is done to keep deletes fast and reliable.
WillDeleteFiles(
"workspace/willDeleteFiles",
lsp::DeleteFilesParams
) -> Option<lsp::WorkspaceEdit>;
/// The show document request is sent from a server to a client to ask the client to display a particular document in the user interface.
ShowDocument(
"window/showDocument",
lsp::ShowDocumentParams
) -> lsp::ShowDocumentResult;
MonikerRequest(
"textDocument/moniker",
lsp::MonikerParams
) -> Option<Vec<lsp::Moniker>>;
/// The inlay hints request is sent from the client to the server to compute inlay hints for a given
/// [text document, range] tuple that may be rendered in the editor in place with other text.
InlayHintRequest(
"textDocument/inlayHint",
lsp::InlayHintParams
) -> Option<Vec<lsp::InlayHint>>;
/// The `inlayHint/resolve` request is sent from the client to the server to resolve additional
/// information for a given inlay hint. This is usually used to compute the tooltip, location or
/// command properties of a inlay hint’s label part to avoid its unnecessary computation during the
/// `textDocument/inlayHint` request.
InlayHintResolveRequest(
"inlayHint/resolve",
lsp::InlayHint
) -> lsp::InlayHint;
/// The inline value request is sent from the client to the server to compute inline values for a
/// given text document that may be rendered in the editor at the end of lines.
InlineValueRequest(
"textDocument/inlineValue",
lsp::InlineValueParams
) -> Option<Vec<lsp::InlineValue>>;
/// The text document diagnostic request is sent from the client to the server to ask the server to
/// compute the diagnostics for a given document. As with other pull requests the server is asked
/// to compute the diagnostics for the currently synced version of the document.
DocumentDiagnosticRequest(
"textDocument/diagnostic",
lsp::DocumentDiagnosticParams
) -> lsp::DocumentDiagnosticReportResult;
/// The workspace diagnostic request is sent from the client to the server to ask the server to
/// compute workspace wide diagnostics which previously where pushed from the server to the client.
/// In contrast to the document diagnostic request the workspace request can be long running and is
/// not bound to a specific workspace or document state. If the client supports streaming for the
/// workspace diagnostic pull it is legal to provide a document diagnostic report multiple times
/// for the same document URI. The last one reported will win over previous reports.
WorkspaceDiagnosticRequest(
"workspace/diagnostic",
lsp::WorkspaceDiagnosticParams
) -> lsp::WorkspaceDiagnosticReportResult;
/// The type hierarchy request is sent from the client to the server to return a type hierarchy for
/// the language element of given text document positions. Will return null if the server couldn’t
/// infer a valid type from the position. The type hierarchy requests are executed in two steps:
///
/// 1. first a type hierarchy item is prepared for the given text document position.
/// 2. for a type hierarchy item the supertype or subtype type hierarchy items are resolved.
TypeHierarchyPrepare(
"textDocument/prepareTypeHierarchy",
lsp::TypeHierarchyPrepareParams
) -> Option<Vec<lsp::TypeHierarchyItem>>;
/// The `typeHierarchy/supertypes` request is sent from the client to the server to resolve the
/// supertypes for a given type hierarchy item. Will return null if the server couldn’t infer a
/// valid type from item in the params. The request doesn’t define its own client and server
/// capabilities. It is only issued if a server registers for the
/// `textDocument/prepareTypeHierarchy` request.
TypeHierarchySupertypes(
"typeHierarchy/supertypes",
lsp::TypeHierarchySupertypesParams
) -> Option<Vec<lsp::TypeHierarchyItem>>;
/// The `typeHierarchy/subtypes` request is sent from the client to the server to resolve the
/// subtypes for a given type hierarchy item. Will return null if the server couldn’t infer a valid
/// type from item in the params. The request doesn’t define its own client and server capabilities.
/// It is only issued if a server registers for the textDocument/prepareTypeHierarchy request.
TypeHierarchySubtypes(
"typeHierarchy/subtypes",
lsp::TypeHierarchySubtypesParams
) -> Option<Vec<lsp::TypeHierarchyItem>>;
}
lsp_request! {
/// The shutdown request is sent from the client to the server. It asks the server to shut down, but to not exit
/// (otherwise the response might not be delivered correctly to the client). There is a separate exit notification that
/// asks the server to exit.
Shutdown("shutdown");
/// The `workspace/semanticTokens/refresh` request is sent from the server to the client.
///
/// Servers can use it to ask clients to refresh the editors for which this server provides semantic tokens.
/// As a result the client should ask the server to recompute the semantic tokens for these editors.
/// This is useful if a server detects a project wide configuration change which requires a re-calculation of all semantic tokens.
/// Note that the client still has the freedom to delay the re-calculation of the semantic tokens if for example an editor is currently not visible.
SemanticTokensRefresh("workspace/semanticTokens/refresh");
/// The workspace/codeLens/refresh request is sent from the server to the client.
///
/// Servers can use it to ask clients to refresh the code lenses currently shown in editors.
/// As a result the client should ask the server to recompute the code lenses for these editors.
/// This is useful if a server detects a configuration change which requires a re-calculation of all code lenses.
/// Note that the client still has the freedom to delay the re-calculation of the code lenses if for example an editor is currently not visible.
CodeLensRefresh("workspace/codeLens/refresh");
/// The `workspace/inlayHint/refresh` request is sent from the server to the client. Servers can use
/// it to ask clients to refresh the inlay hints currently shown in editors. As a result the client
/// should ask the server to recompute the inlay hints for these editors. This is useful if a server
/// detects a configuration change which requires a re-calculation of all inlay hints. Note that the
/// client still has the freedom to delay the re-calculation of the inlay hints if for example an
/// editor is currently not visible.
InlayHintRefreshRequest("workspace/inlayHint/refresh");
/// The `workspace/inlineValue/refresh` request is sent from the server to the client. Servers can
/// use it to ask clients to refresh the inline values currently shown in editors. As a result the
/// client should ask the server to recompute the inline values for these editors. This is useful if
/// a server detects a configuration change which requires a re-calculation of all inline values.
/// Note that the client still has the freedom to delay the re-calculation of the inline values if
/// for example an editor is currently not visible.
InlineValueRefreshRequest("workspace/inlineValue/refresh");
}