lsp_ty/
part3.rs

1use super::*;
2use serde::{Deserialize, Serialize};
3use serde_repr::{Deserialize_repr, Serialize_repr};
4
5#[doc = " Signature help represents the signature of something callable. There can be multiple signature "]
6#[doc = " but only one active and only one active parameter."]
7#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
8pub struct SignatureHelp {
9    #[doc = " The active parameter of the active signature. If omitted or the value lies outside the "]
10    #[doc = " range of `signatures[activeSignature].parameters` defaults to 0 if the active signature has "]
11    #[doc = " parameters. If the active signature has no parameters it is ignored. In future version of "]
12    #[doc = " the protocol this property might become mandatory to better express the active parameter if "]
13    #[doc = " the active signature does have any."]
14    #[serde(skip_serializing_if = "Option::is_none")]
15    #[serde(rename = "activeParameter")]
16    pub active_parameter: Option<Uinteger>,
17    #[doc = " The active signature. If omitted or the value lies outside the range of `signatures` the "]
18    #[doc = " value defaults to zero or is ignored if the `SignatureHelp` has no signatures."]
19    #[doc = " "]
20    #[doc = " Whenever possible implementors should make an active decision about the active signature "]
21    #[doc = " and shouldn't rely on a default value."]
22    #[doc = " "]
23    #[doc = " In future version of the protocol this property might become mandatory to better express "]
24    #[doc = " this."]
25    #[serde(skip_serializing_if = "Option::is_none")]
26    #[serde(rename = "activeSignature")]
27    pub active_signature: Option<Uinteger>,
28    #[doc = " One or more signatures. If no signatures are available the signature help request should "]
29    #[doc = " return `null`."]
30    pub signatures: Vec<SignatureInformation>,
31}
32#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
33pub struct SignatureHelpClientCapabilitiesSignatureInformationParameterInformation {
34    #[doc = " The client supports processing label offsets instead of a simple label string."]
35    #[serde(skip_serializing_if = "Option::is_none")]
36    #[serde(rename = "labelOffsetSupport")]
37    pub label_offset_support: Option<bool>,
38}
39#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
40pub struct SignatureHelpClientCapabilitiesSignatureInformation {
41    #[doc = " The client supports the `activeParameter` property on `SignatureInformation` literal."]
42    #[serde(skip_serializing_if = "Option::is_none")]
43    #[serde(rename = "activeParameterSupport")]
44    pub active_parameter_support: Option<bool>,
45    #[doc = " Client supports the following content formats for the documentation property. The order "]
46    #[doc = " describes the preferred format of the client."]
47    #[serde(skip_serializing_if = "Option::is_none")]
48    #[serde(rename = "documentationFormat")]
49    pub documentation_format: Option<Vec<MarkupKind>>,
50    #[doc = " Client capabilities specific to parameter information."]
51    #[serde(skip_serializing_if = "Option::is_none")]
52    #[serde(rename = "parameterInformation")]
53    pub parameter_information:
54        Option<SignatureHelpClientCapabilitiesSignatureInformationParameterInformation>,
55}
56#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
57pub struct SignatureHelpClientCapabilities {
58    #[doc = " The client supports to send additional context information for a "]
59    #[doc = " `textDocument/signatureHelp` request. A client that opts into contextSupport will also "]
60    #[doc = " support the `retriggerCharacters` on `SignatureHelpOptions`."]
61    #[serde(skip_serializing_if = "Option::is_none")]
62    #[serde(rename = "contextSupport")]
63    pub context_support: Option<bool>,
64    #[doc = " Whether signature help supports dynamic registration."]
65    #[serde(skip_serializing_if = "Option::is_none")]
66    #[serde(rename = "dynamicRegistration")]
67    pub dynamic_registration: Option<bool>,
68    #[doc = " The client supports the following `SignatureInformation` specific properties."]
69    #[serde(skip_serializing_if = "Option::is_none")]
70    #[serde(rename = "signatureInformation")]
71    pub signature_information: Option<SignatureHelpClientCapabilitiesSignatureInformation>,
72}
73#[doc = " Additional information about the context in which a signature help request was triggered."]
74#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
75pub struct SignatureHelpContext {
76    #[doc = " The currently active `SignatureHelp`."]
77    #[doc = " "]
78    #[doc = " The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on "]
79    #[doc = " the user navigating through available signatures."]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    #[serde(rename = "activeSignatureHelp")]
82    pub active_signature_help: Option<SignatureHelp>,
83    #[doc = " `true` if signature help was already showing when it was triggered."]
84    #[doc = " "]
85    #[doc = " Retriggers occur when the signature help is already active and can be caused by actions "]
86    #[doc = " such as typing a trigger character, a cursor move, or document content changes."]
87    #[serde(rename = "isRetrigger")]
88    pub is_retrigger: bool,
89    #[doc = " Character that caused signature help to be triggered."]
90    #[doc = " "]
91    #[doc = " This is undefined when triggerKind !== SignatureHelpTriggerKind.TriggerCharacter"]
92    #[serde(skip_serializing_if = "Option::is_none")]
93    #[serde(rename = "triggerCharacter")]
94    pub trigger_character: Option<String>,
95    #[doc = " Action that caused signature help to be triggered."]
96    #[serde(rename = "triggerKind")]
97    pub trigger_kind: SignatureHelpTriggerKind,
98}
99#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
100pub struct SignatureHelpOptions {
101    #[doc = " List of characters that re-trigger signature help."]
102    #[doc = " "]
103    #[doc = " These trigger characters are only active when signature help is already showing. All "]
104    #[doc = " trigger characters are also counted as re-trigger characters."]
105    #[serde(skip_serializing_if = "Option::is_none")]
106    #[serde(rename = "retriggerCharacters")]
107    pub retrigger_characters: Option<Vec<String>>,
108    #[doc = " The characters that trigger signature help automatically."]
109    #[serde(skip_serializing_if = "Option::is_none")]
110    #[serde(rename = "triggerCharacters")]
111    pub trigger_characters: Option<Vec<String>>,
112    #[serde(skip_serializing_if = "Option::is_none")]
113    #[serde(rename = "workDoneProgress")]
114    pub work_done_progress: Option<bool>,
115}
116#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
117pub struct SignatureHelpParams {
118    #[doc = " The signature help context. This is only available if the client specifies to send this "]
119    #[doc = " using the client capability `textDocument.signatureHelp.contextSupport === true`"]
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub context: Option<SignatureHelpContext>,
122    #[doc = " The position inside the text document."]
123    pub position: Position,
124    #[doc = " The text document."]
125    #[serde(rename = "textDocument")]
126    pub text_document: TextDocumentIdentifier,
127    #[doc = " An optional token that a server can use to report work done progress."]
128    #[serde(skip_serializing_if = "Option::is_none")]
129    #[serde(rename = "workDoneToken")]
130    pub work_done_token: Option<ProgressToken>,
131}
132#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
133pub struct SignatureHelpRegistrationOptions {
134    #[doc = " A document selector to identify the scope of the registration. If set to null the document "]
135    #[doc = " selector provided on the client side will be used."]
136    #[serde(rename = "documentSelector")]
137    pub document_selector: serde_json::Value,
138    #[doc = " List of characters that re-trigger signature help."]
139    #[doc = " "]
140    #[doc = " These trigger characters are only active when signature help is already showing. All "]
141    #[doc = " trigger characters are also counted as re-trigger characters."]
142    #[serde(skip_serializing_if = "Option::is_none")]
143    #[serde(rename = "retriggerCharacters")]
144    pub retrigger_characters: Option<Vec<String>>,
145    #[doc = " The characters that trigger signature help automatically."]
146    #[serde(skip_serializing_if = "Option::is_none")]
147    #[serde(rename = "triggerCharacters")]
148    pub trigger_characters: Option<Vec<String>>,
149    #[serde(skip_serializing_if = "Option::is_none")]
150    #[serde(rename = "workDoneProgress")]
151    pub work_done_progress: Option<bool>,
152}
153#[doc = " How a signature help was triggered."]
154#[derive(Clone, PartialEq, Debug, Serialize_repr, Deserialize_repr)]
155#[repr(i64)]
156pub enum SignatureHelpTriggerKind {
157    Invoked = 1,
158    TriggerCharacter = 2,
159    ContentChange = 3,
160}
161#[doc = " Represents the signature of something callable. A signature can have a label, like a "]
162#[doc = " function-name, a doc-comment, and a set of parameters."]
163#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
164pub struct SignatureInformation {
165    #[doc = " The index of the active parameter."]
166    #[doc = " "]
167    #[doc = " If provided, this is used in place of `SignatureHelp.activeParameter`."]
168    #[serde(skip_serializing_if = "Option::is_none")]
169    #[serde(rename = "activeParameter")]
170    pub active_parameter: Option<Uinteger>,
171    #[doc = " The human-readable doc-comment of this signature. Will be shown in the UI but can be "]
172    #[doc = " omitted."]
173    #[serde(skip_serializing_if = "Option::is_none")]
174    pub documentation: Option<OneOf<String, MarkupContent>>,
175    #[doc = " The label of this signature. Will be shown in the UI."]
176    pub label: String,
177    #[doc = " The parameters of this signature."]
178    #[serde(skip_serializing_if = "Option::is_none")]
179    pub parameters: Option<Vec<ParameterInformation>>,
180}
181#[doc = " Static registration options to be returned in the initialize request."]
182#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
183pub struct StaticRegistrationOptions {
184    #[doc = " The id used to register the request. The id can be used to deregister the request again. "]
185    #[doc = " See also Registration#id."]
186    #[serde(skip_serializing_if = "Option::is_none")]
187    pub id: Option<String>,
188}
189#[doc = " Represents information about programming constructs like variables, classes, interfaces etc."]
190#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
191pub struct SymbolInformation {
192    #[doc = " The name of the symbol containing this symbol. This information is for user interface "]
193    #[doc = " purposes (e.g. to render a qualifier in the user interface if necessary). It can't be used "]
194    #[doc = " to re-infer a hierarchy for the document symbols."]
195    #[serde(skip_serializing_if = "Option::is_none")]
196    #[serde(rename = "containerName")]
197    pub container_name: Option<String>,
198    #[doc = " Indicates if this symbol is deprecated."]
199    #[serde(skip_serializing_if = "Option::is_none")]
200    pub deprecated: Option<bool>,
201    #[doc = " The kind of this symbol."]
202    pub kind: SymbolKind,
203    #[doc = " The location of this symbol. The location's range is used by a tool to reveal the location "]
204    #[doc = " in the editor. If the symbol is selected in the tool the range's start information is used "]
205    #[doc = " to position the cursor. So the range usually spans more then the actual symbol's name and "]
206    #[doc = " does normally include things like visibility modifiers."]
207    #[doc = " "]
208    #[doc = " The range doesn't have to denote a node range in the sense of a abstract syntax tree. It "]
209    #[doc = " can therefore not be used to re-construct a hierarchy of the symbols."]
210    pub location: Location,
211    #[doc = " The name of this symbol."]
212    pub name: String,
213    #[doc = " Tags for this symbol."]
214    #[serde(skip_serializing_if = "Option::is_none")]
215    pub tags: Option<Vec<SymbolTag>>,
216}
217#[doc = " A symbol kind."]
218#[derive(Clone, PartialEq, Debug, Serialize_repr, Deserialize_repr)]
219#[repr(i64)]
220pub enum SymbolKind {
221    File = 1,
222    Module = 2,
223    Namespace = 3,
224    Package = 4,
225    Class = 5,
226    Method = 6,
227    Property = 7,
228    Field = 8,
229    Constructor = 9,
230    Enum = 10,
231    Interface = 11,
232    Function = 12,
233    Variable = 13,
234    Constant = 14,
235    String = 15,
236    Number = 16,
237    Boolean = 17,
238    Array = 18,
239    Object = 19,
240    Key = 20,
241    Null = 21,
242    EnumMember = 22,
243    Struct = 23,
244    Event = 24,
245    Operator = 25,
246    TypeParameter = 26,
247}
248#[doc = " Symbol tags are extra annotations that tweak the rendering of a symbol."]
249pub type SymbolTag = f64;
250#[doc = " Describe options to be used when registering for text document change events."]
251#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
252pub struct TextDocumentChangeRegistrationOptions {
253    #[doc = " A document selector to identify the scope of the registration. If set to null the document "]
254    #[doc = " selector provided on the client side will be used."]
255    #[serde(rename = "documentSelector")]
256    pub document_selector: serde_json::Value,
257    #[doc = " How documents are synced to the server. See TextDocumentSyncKind.Full and "]
258    #[doc = " TextDocumentSyncKind.Incremental."]
259    #[serde(rename = "syncKind")]
260    pub sync_kind: TextDocumentSyncKind,
261}
262#[doc = " Text document specific client capabilities."]
263#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
264pub struct TextDocumentClientCapabilities {
265    #[doc = " Capabilities specific to the various call hierarchy requests."]
266    #[serde(skip_serializing_if = "Option::is_none")]
267    #[serde(rename = "callHierarchy")]
268    pub call_hierarchy: Option<CallHierarchyClientCapabilities>,
269    #[doc = " Capabilities specific to the `textDocument/codeAction` request."]
270    #[serde(skip_serializing_if = "Option::is_none")]
271    #[serde(rename = "codeAction")]
272    pub code_action: Option<CodeActionClientCapabilities>,
273    #[doc = " Capabilities specific to the `textDocument/codeLens` request."]
274    #[serde(skip_serializing_if = "Option::is_none")]
275    #[serde(rename = "codeLens")]
276    pub code_lens: Option<CodeLensClientCapabilities>,
277    #[doc = " Capabilities specific to the `textDocument/documentColor` and the "]
278    #[doc = " `textDocument/colorPresentation` request."]
279    #[serde(skip_serializing_if = "Option::is_none")]
280    #[serde(rename = "colorProvider")]
281    pub color_provider: Option<DocumentColorClientCapabilities>,
282    #[doc = " Capabilities specific to the `textDocument/completion` request."]
283    #[serde(skip_serializing_if = "Option::is_none")]
284    pub completion: Option<CompletionClientCapabilities>,
285    #[doc = " Capabilities specific to the `textDocument/declaration` request."]
286    #[serde(skip_serializing_if = "Option::is_none")]
287    pub declaration: Option<DeclarationClientCapabilities>,
288    #[doc = " Capabilities specific to the `textDocument/definition` request."]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub definition: Option<DefinitionClientCapabilities>,
291    #[doc = " Capabilities specific to the `textDocument/documentHighlight` request."]
292    #[serde(skip_serializing_if = "Option::is_none")]
293    #[serde(rename = "documentHighlight")]
294    pub document_highlight: Option<DocumentHighlightClientCapabilities>,
295    #[doc = " Capabilities specific to the `textDocument/documentLink` request."]
296    #[serde(skip_serializing_if = "Option::is_none")]
297    #[serde(rename = "documentLink")]
298    pub document_link: Option<DocumentLinkClientCapabilities>,
299    #[doc = " Capabilities specific to the `textDocument/documentSymbol` request."]
300    #[serde(skip_serializing_if = "Option::is_none")]
301    #[serde(rename = "documentSymbol")]
302    pub document_symbol: Option<DocumentSymbolClientCapabilities>,
303    #[doc = " Capabilities specific to the `textDocument/foldingRange` request."]
304    #[serde(skip_serializing_if = "Option::is_none")]
305    #[serde(rename = "foldingRange")]
306    pub folding_range: Option<FoldingRangeClientCapabilities>,
307    #[doc = " Capabilities specific to the `textDocument/formatting` request."]
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub formatting: Option<DocumentFormattingClientCapabilities>,
310    #[doc = " Capabilities specific to the `textDocument/hover` request."]
311    #[serde(skip_serializing_if = "Option::is_none")]
312    pub hover: Option<HoverClientCapabilities>,
313    #[doc = " Capabilities specific to the `textDocument/implementation` request."]
314    #[serde(skip_serializing_if = "Option::is_none")]
315    pub implementation: Option<ImplementationClientCapabilities>,
316    #[doc = " Capabilities specific to the `textDocument/linkedEditingRange` request."]
317    #[serde(skip_serializing_if = "Option::is_none")]
318    #[serde(rename = "linkedEditingRange")]
319    pub linked_editing_range: Option<LinkedEditingRangeClientCapabilities>,
320    #[doc = " Capabilities specific to the `textDocument/moniker` request."]
321    #[serde(skip_serializing_if = "Option::is_none")]
322    pub moniker: Option<MonikerClientCapabilities>,
323    #[doc = " Capabilities specific to the `textDocument/onTypeFormatting` request."]
324    #[serde(skip_serializing_if = "Option::is_none")]
325    #[serde(rename = "onTypeFormatting")]
326    pub on_type_formatting: Option<DocumentOnTypeFormattingClientCapabilities>,
327    #[doc = " Capabilities specific to the `textDocument/publishDiagnostics` notification."]
328    #[serde(skip_serializing_if = "Option::is_none")]
329    #[serde(rename = "publishDiagnostics")]
330    pub publish_diagnostics: Option<PublishDiagnosticsClientCapabilities>,
331    #[doc = " Capabilities specific to the `textDocument/rangeFormatting` request."]
332    #[serde(skip_serializing_if = "Option::is_none")]
333    #[serde(rename = "rangeFormatting")]
334    pub range_formatting: Option<DocumentRangeFormattingClientCapabilities>,
335    #[doc = " Capabilities specific to the `textDocument/references` request."]
336    #[serde(skip_serializing_if = "Option::is_none")]
337    pub references: Option<ReferenceClientCapabilities>,
338    #[doc = " Capabilities specific to the `textDocument/rename` request."]
339    #[serde(skip_serializing_if = "Option::is_none")]
340    pub rename: Option<RenameClientCapabilities>,
341    #[doc = " Capabilities specific to the `textDocument/selectionRange` request."]
342    #[serde(skip_serializing_if = "Option::is_none")]
343    #[serde(rename = "selectionRange")]
344    pub selection_range: Option<SelectionRangeClientCapabilities>,
345    #[doc = " Capabilities specific to the various semantic token requests."]
346    #[serde(skip_serializing_if = "Option::is_none")]
347    #[serde(rename = "semanticTokens")]
348    pub semantic_tokens: Option<SemanticTokensClientCapabilities>,
349    #[doc = " Capabilities specific to the `textDocument/signatureHelp` request."]
350    #[serde(skip_serializing_if = "Option::is_none")]
351    #[serde(rename = "signatureHelp")]
352    pub signature_help: Option<SignatureHelpClientCapabilities>,
353    #[serde(skip_serializing_if = "Option::is_none")]
354    pub synchronization: Option<TextDocumentSyncClientCapabilities>,
355    #[doc = " Capabilities specific to the `textDocument/typeDefinition` request."]
356    #[serde(skip_serializing_if = "Option::is_none")]
357    #[serde(rename = "typeDefinition")]
358    pub type_definition: Option<TypeDefinitionClientCapabilities>,
359}
360#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
361#[doc = " An event describing a change to a text document. If range and rangeLength are omitted the new "]
362#[doc = " text is considered to be the full content of the document."]
363pub enum TextDocumentContentChangeEvent {
364    Simple {
365        #[doc = "The new text of the whole document."]
366        text: String,
367    },
368    Complex {
369        #[doc = "The range of the document that changed."]
370        range: Range,
371        #[serde(skip_serializing_if = "Option::is_none")]
372        #[serde(rename = "rangeLength")]
373        #[doc = "The optional length of the range that got replaced."]
374        #[doc = "@deprecated use range instead."]
375        range_length: Option<Uinteger>,
376        #[doc = "The new text of the whole document."]
377        text: String,
378    },
379}
380#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
381pub struct TextDocumentEdit {
382    #[doc = " The edits to be applied."]
383    pub edits: Vec<OneOf<TextEdit, AnnotatedTextEdit>>,
384    #[doc = " The text document to change."]
385    #[serde(rename = "textDocument")]
386    pub text_document: OptionalVersionedTextDocumentIdentifier,
387}
388#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
389pub struct TextDocumentIdentifier {
390    #[doc = " The text document's URI."]
391    pub uri: DocumentUri,
392}
393#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
394pub struct TextDocumentItem {
395    #[doc = " The text document's language identifier."]
396    #[serde(rename = "languageId")]
397    pub language_id: String,
398    #[doc = " The content of the opened text document."]
399    pub text: String,
400    #[doc = " The text document's URI."]
401    pub uri: DocumentUri,
402    #[doc = " The version number of this document (it will increase after each change, including "]
403    #[doc = " undo/redo)."]
404    pub version: Integer,
405}
406#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
407pub struct TextDocumentPositionParams {
408    #[doc = " The position inside the text document."]
409    pub position: Position,
410    #[doc = " The text document."]
411    #[serde(rename = "textDocument")]
412    pub text_document: TextDocumentIdentifier,
413}
414#[doc = " General text document registration options."]
415#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
416pub struct TextDocumentRegistrationOptions {
417    #[doc = " A document selector to identify the scope of the registration. If set to null the document "]
418    #[doc = " selector provided on the client side will be used."]
419    #[serde(rename = "documentSelector")]
420    pub document_selector: Option<DocumentSelector>,
421}
422#[doc = " Represents reasons why a text document is saved."]
423#[derive(Clone, PartialEq, Debug, Serialize_repr, Deserialize_repr)]
424#[repr(i64)]
425pub enum TextDocumentSaveReason {
426    Manual = 1,
427    AfterDelay = 2,
428    FocusOut = 3,
429}
430#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
431pub struct TextDocumentSaveRegistrationOptions {
432    #[doc = " A document selector to identify the scope of the registration. If set to null the document "]
433    #[doc = " selector provided on the client side will be used."]
434    #[serde(rename = "documentSelector")]
435    pub document_selector: serde_json::Value,
436    #[doc = " The client is supposed to include the content on save."]
437    #[serde(skip_serializing_if = "Option::is_none")]
438    #[serde(rename = "includeText")]
439    pub include_text: Option<bool>,
440}
441#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
442pub struct TextDocumentSyncClientCapabilities {
443    #[doc = " The client supports did save notifications."]
444    #[serde(skip_serializing_if = "Option::is_none")]
445    #[serde(rename = "didSave")]
446    pub did_save: Option<bool>,
447    #[doc = " Whether text document synchronization supports dynamic registration."]
448    #[serde(skip_serializing_if = "Option::is_none")]
449    #[serde(rename = "dynamicRegistration")]
450    pub dynamic_registration: Option<bool>,
451    #[doc = " The client supports sending will save notifications."]
452    #[serde(skip_serializing_if = "Option::is_none")]
453    #[serde(rename = "willSave")]
454    pub will_save: Option<bool>,
455    #[doc = " The client supports sending a will save request and waits for a response providing text "]
456    #[doc = " edits which will be applied to the document before it is saved."]
457    #[serde(skip_serializing_if = "Option::is_none")]
458    #[serde(rename = "willSaveWaitUntil")]
459    pub will_save_wait_until: Option<bool>,
460}
461#[doc = " Defines how the host (editor) should sync document changes to the language server."]
462#[derive(Clone, PartialEq, Debug, Serialize_repr, Deserialize_repr)]
463#[repr(i64)]
464pub enum TextDocumentSyncKind {
465    None = 0,
466    Full = 1,
467    Incremental = 2,
468}
469
470impl Default for TextDocumentSyncKind {
471    fn default() -> Self {
472        Self::None
473    }
474}
475
476#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
477pub struct TextDocumentSyncOptions {
478    #[doc = " Change notifications are sent to the server. See TextDocumentSyncKind.None, "]
479    #[doc = " TextDocumentSyncKind.Full and TextDocumentSyncKind.Incremental. If omitted it defaults to "]
480    #[doc = " TextDocumentSyncKind.None."]
481    #[serde(skip_serializing_if = "Option::is_none")]
482    pub change: Option<TextDocumentSyncKind>,
483    #[doc = " Open and close notifications are sent to the server. If omitted open close notification "]
484    #[doc = " should not be sent."]
485    #[serde(skip_serializing_if = "Option::is_none")]
486    #[serde(rename = "openClose")]
487    pub open_close: Option<bool>,
488    #[doc = "If present will save notifications are sent to the server. If omitted"]
489    #[doc = "the notification should not be sent."]
490    #[serde(skip_serializing_if = "Option::is_none")]
491    #[serde(rename = "willSave")]
492    pub will_save: Option<bool>,
493    #[doc = "If present will save notifications are sent to the server. If omitted"]
494    #[doc = "the notification should not be sent."]
495    #[serde(skip_serializing_if = "Option::is_none")]
496    #[serde(rename = "willSaveWaitUntil")]
497    pub will_save_until: Option<bool>,
498    #[doc = "If present save notifications are sent to the server. If omitted the"]
499    #[doc = "notification should not be sent."]
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub save: Option<OneOf<bool, SaveOptions>>,
502}
503#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
504pub struct TextEdit {
505    #[doc = " The string to be inserted. For delete operations use an empty string."]
506    #[serde(rename = "newText")]
507    pub new_text: String,
508    #[doc = " The range of the text document to be manipulated. To insert text into a document create a "]
509    #[doc = " range where start === end."]
510    pub range: Range,
511}
512
513/// The protocol defines an additional token format capability to allow
514/// future extensions of the format. The only format that is currently
515/// specified is relative expressing that the tokens are described
516/// using relative positions (see Integer Encoding for Tokens below).
517#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
518pub struct TokenFormat(String);
519
520impl TokenFormat {
521    pub fn new(s: String) -> Self {
522        Self(s)
523    }
524
525    pub fn relative() -> Self {
526        Self("relative".to_string())
527    }
528}
529
530#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
531pub enum TraceValue {
532    #[serde(rename = "off")]
533    Off,
534    #[serde(rename = "messages")]
535    Messages,
536    #[serde(rename = "verbose")]
537    Verbose,
538}
539
540impl Default for TraceValue {
541    fn default() -> Self {
542        Self::Off
543    }
544}
545
546#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
547pub struct TypeDefinitionClientCapabilities {
548    #[doc = " Whether implementation supports dynamic registration. If this is set to `true` the client "]
549    #[doc = " supports the new `TypeDefinitionRegistrationOptions` return value for the corresponding "]
550    #[doc = " server capability as well."]
551    #[serde(skip_serializing_if = "Option::is_none")]
552    #[serde(rename = "dynamicRegistration")]
553    pub dynamic_registration: Option<bool>,
554    #[doc = " The client supports additional metadata in the form of definition links."]
555    #[serde(skip_serializing_if = "Option::is_none")]
556    #[serde(rename = "linkSupport")]
557    pub link_support: Option<bool>,
558}
559#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
560pub struct TypeDefinitionOptions {
561    #[serde(skip_serializing_if = "Option::is_none")]
562    #[serde(rename = "workDoneProgress")]
563    pub work_done_progress: Option<bool>,
564}
565#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
566pub struct TypeDefinitionParams {
567    #[doc = " An optional token that a server can use to report partial results (e.g. streaming) to the "]
568    #[doc = " client."]
569    #[serde(skip_serializing_if = "Option::is_none")]
570    #[serde(rename = "partialResultToken")]
571    pub partial_result_token: Option<ProgressToken>,
572    #[doc = " The position inside the text document."]
573    pub position: Position,
574    #[doc = " The text document."]
575    #[serde(rename = "textDocument")]
576    pub text_document: TextDocumentIdentifier,
577    #[doc = " An optional token that a server can use to report work done progress."]
578    #[serde(skip_serializing_if = "Option::is_none")]
579    #[serde(rename = "workDoneToken")]
580    pub work_done_token: Option<ProgressToken>,
581}
582#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
583pub struct TypeDefinitionRegistrationOptions {
584    #[doc = " A document selector to identify the scope of the registration. If set to null the document "]
585    #[doc = " selector provided on the client side will be used."]
586    #[serde(rename = "documentSelector")]
587    pub document_selector: serde_json::Value,
588    #[doc = " The id used to register the request. The id can be used to deregister the request again. "]
589    #[doc = " See also Registration#id."]
590    #[serde(skip_serializing_if = "Option::is_none")]
591    pub id: Option<String>,
592    #[serde(skip_serializing_if = "Option::is_none")]
593    #[serde(rename = "workDoneProgress")]
594    pub work_done_progress: Option<bool>,
595}
596pub type Uri = String;
597#[doc = " Moniker uniqueness level to define scope of the moniker."]
598#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
599pub enum UniquenessLevel {
600    #[serde(rename = "document")]
601    Document,
602    #[serde(rename = "project")]
603    Project,
604    #[serde(rename = "group")]
605    Group,
606    #[serde(rename = "scheme")]
607    Scheme,
608    #[serde(rename = "global")]
609    Global,
610}
611#[doc = " General parameters to unregister a capability."]
612#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
613pub struct Unregistration {
614    #[doc = " The id used to unregister the request or notification. Usually an id provided during the "]
615    #[doc = " register request."]
616    pub id: String,
617    #[doc = " The method / capability to unregister for."]
618    pub method: String,
619}
620#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
621pub struct UnregistrationParams {
622    pub unregisterations: Vec<Unregistration>,
623}
624#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
625pub struct VersionedTextDocumentIdentifier {
626    #[doc = " The text document's URI."]
627    pub uri: DocumentUri,
628    #[doc = " The version number of this document."]
629    #[doc = " "]
630    #[doc = " The version number of a document will increase after each change, including undo/redo. The "]
631    #[doc = " number doesn't need to be consecutive."]
632    pub version: Integer,
633}
634#[derive(Clone, PartialEq, Debug, Serialize_repr, Deserialize_repr)]
635#[repr(i64)]
636pub enum WatchKind {
637    Create = 1,
638    Change = 2,
639    Delete = 4,
640}
641#[doc = " The parameters send in a will save text document notification."]
642#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
643pub struct WillSaveTextDocumentParams {
644    #[doc = " The 'TextDocumentSaveReason'."]
645    pub reason: TextDocumentSaveReason,
646    #[doc = " The document that will be saved."]
647    #[serde(rename = "textDocument")]
648    pub text_document: TextDocumentIdentifier,
649}
650#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
651pub struct WorkDoneProgressBegin {
652    #[doc = " Controls if a cancel button should show to allow the user to cancel the long running "]
653    #[doc = " operation. Clients that don't support cancellation are allowed to ignore the setting."]
654    #[serde(skip_serializing_if = "Option::is_none")]
655    pub cancellable: Option<bool>,
656    pub kind: String,
657    #[doc = " Optional, more detailed associated progress message. Contains complementary information to "]
658    #[doc = " the `title`."]
659    #[doc = " "]
660    #[doc = " Examples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\". If unset, the "]
661    #[doc = " previous progress message (if any) is still valid."]
662    #[serde(skip_serializing_if = "Option::is_none")]
663    pub message: Option<String>,
664    #[doc = " Optional progress percentage to display (value 100 is considered 100%). If not provided "]
665    #[doc = " infinite progress is assumed and clients are allowed to ignore the `percentage` value in "]
666    #[doc = " subsequent in report notifications."]
667    #[doc = " "]
668    #[doc = " The value should be steadily rising. Clients are free to ignore values that are not "]
669    #[doc = " following this rule. The value range is [0, 100]"]
670    #[serde(skip_serializing_if = "Option::is_none")]
671    pub percentage: Option<Uinteger>,
672    #[doc = " Mandatory title of the progress operation. Used to briefly inform about the kind of "]
673    #[doc = " operation being performed."]
674    #[doc = " "]
675    #[doc = " Examples: \"Indexing\" or \"Linking dependencies\"."]
676    pub title: String,
677}
678#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
679pub struct WorkDoneProgressCancelParams {
680    #[doc = " The token to be used to report progress."]
681    pub token: ProgressToken,
682}
683#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
684pub struct WorkDoneProgressCreateParams {
685    #[doc = " The token to be used to report progress."]
686    pub token: ProgressToken,
687}
688#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
689pub struct WorkDoneProgressEnd {
690    pub kind: String,
691    #[doc = " Optional, a final message indicating to for example indicate the outcome of the operation."]
692    #[serde(skip_serializing_if = "Option::is_none")]
693    pub message: Option<String>,
694}
695#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
696pub struct WorkDoneProgressOptions {
697    #[serde(skip_serializing_if = "Option::is_none")]
698    #[serde(rename = "workDoneProgress")]
699    pub work_done_progress: Option<bool>,
700}
701#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
702pub struct WorkDoneProgressParams {
703    #[doc = " An optional token that a server can use to report work done progress."]
704    #[serde(skip_serializing_if = "Option::is_none")]
705    #[serde(rename = "workDoneToken")]
706    pub work_done_token: Option<ProgressToken>,
707}
708#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
709pub struct WorkDoneProgressReport {
710    #[doc = " Controls enablement state of a cancel button. This property is only valid if a cancel "]
711    #[doc = " button got requested in the `WorkDoneProgressBegin` payload."]
712    #[doc = " "]
713    #[doc = " Clients that don't support cancellation or don't support control the button's enablement "]
714    #[doc = " state are allowed to ignore the setting."]
715    #[serde(skip_serializing_if = "Option::is_none")]
716    pub cancellable: Option<bool>,
717    pub kind: String,
718    #[doc = " Optional, more detailed associated progress message. Contains complementary information to "]
719    #[doc = " the `title`."]
720    #[doc = " "]
721    #[doc = " Examples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\". If unset, the "]
722    #[doc = " previous progress message (if any) is still valid."]
723    #[serde(skip_serializing_if = "Option::is_none")]
724    pub message: Option<String>,
725    #[doc = " Optional progress percentage to display (value 100 is considered 100%). If not provided "]
726    #[doc = " infinite progress is assumed and clients are allowed to ignore the `percentage` value in "]
727    #[doc = " subsequent in report notifications."]
728    #[doc = " "]
729    #[doc = " The value should be steadily rising. Clients are free to ignore values that are not "]
730    #[doc = " following this rule. The value range is [0, 100]"]
731    #[serde(skip_serializing_if = "Option::is_none")]
732    pub percentage: Option<Uinteger>,
733}
734#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
735pub struct WorkspaceEdit {
736    #[doc = " A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, "]
737    #[doc = " rename and delete file / folder operations."]
738    #[doc = " "]
739    #[doc = " Whether clients honor this property depends on the client capability "]
740    #[doc = " `workspace.changeAnnotationSupport`."]
741    #[serde(skip_serializing_if = "Option::is_none")]
742    #[serde(rename = "changeAnnotations")]
743    pub change_annotations: Option<::std::collections::BTreeMap<String, ChangeAnnotation>>,
744    #[doc = " Holds changes to existing resources."]
745    #[serde(skip_serializing_if = "Option::is_none")]
746    pub changes: Option<::std::collections::BTreeMap<String, Vec<TextEdit>>>,
747    #[doc = " Depending on the client capability `workspace.workspaceEdit.resourceOperations` document "]
748    #[doc = " changes are either an array of `TextDocumentEdit`s to express changes to n different text "]
749    #[doc = " documents where each text document edit addresses a specific version of a text document. Or "]
750    #[doc = " it can contain above `TextDocumentEdit`s mixed with create, rename and delete file / folder "]
751    #[doc = " operations."]
752    #[doc = " "]
753    #[doc = " Whether a client supports versioned document edits is expressed via "]
754    #[doc = " `workspace.workspaceEdit.documentChanges` client capability."]
755    #[doc = " "]
756    #[doc = " If a client neither supports `documentChanges` nor "]
757    #[doc = " `workspace.workspaceEdit.resourceOperations` then only plain `TextEdit`s using the "]
758    #[doc = " `changes` property are supported."]
759    #[serde(skip_serializing_if = "Option::is_none")]
760    #[serde(rename = "documentChanges")]
761    pub document_changes: Option<OneOf<Vec<TextDocumentEdit>, DocumentChange>>,
762}
763
764#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
765pub enum DocumentChange {
766    Edit(TextDocumentEdit),
767    Create(CreateFile),
768    Rename(RenameFile),
769    Delete(DeleteFile),
770}
771
772#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
773pub struct WorkspaceEditClientCapabilitiesChangeAnnotationSupport {
774    #[doc = " Whether the client groups edits with equal labels into tree nodes, for instance all edits "]
775    #[doc = " labelled with \"Changes in Strings\" would be a tree node."]
776    #[serde(skip_serializing_if = "Option::is_none")]
777    #[serde(rename = "groupsOnLabel")]
778    pub groups_on_label: Option<bool>,
779}
780#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
781pub struct WorkspaceEditClientCapabilities {
782    #[doc = " Whether the client in general supports change annotations on text edits, create file, "]
783    #[doc = " rename file and delete file changes."]
784    #[serde(skip_serializing_if = "Option::is_none")]
785    #[serde(rename = "changeAnnotationSupport")]
786    pub change_annotation_support: Option<WorkspaceEditClientCapabilitiesChangeAnnotationSupport>,
787    #[doc = " The client supports versioned document changes in `WorkspaceEdit`s"]
788    #[serde(skip_serializing_if = "Option::is_none")]
789    #[serde(rename = "documentChanges")]
790    pub document_changes: Option<bool>,
791    #[doc = " The failure handling strategy of a client if applying the workspace edit fails."]
792    #[serde(skip_serializing_if = "Option::is_none")]
793    #[serde(rename = "failureHandling")]
794    pub failure_handling: Option<FailureHandlingKind>,
795    #[doc = " Whether the client normalizes line endings to the client specific setting. If set to `true` "]
796    #[doc = " the client will normalize line ending characters in a workspace edit to the client specific "]
797    #[doc = " new line character(s)."]
798    #[serde(skip_serializing_if = "Option::is_none")]
799    #[serde(rename = "normalizesLineEndings")]
800    pub normalizes_line_endings: Option<bool>,
801    #[doc = " The resource operations the client supports. Clients should at least support 'create', "]
802    #[doc = " 'rename' and 'delete' files and folders."]
803    #[serde(skip_serializing_if = "Option::is_none")]
804    #[serde(rename = "resourceOperations")]
805    pub resource_operations: Option<Vec<ResourceOperationKind>>,
806}
807#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
808pub struct WorkspaceFolder {
809    #[doc = " The name of the workspace folder. Used to refer to this workspace folder in the user "]
810    #[doc = " interface."]
811    pub name: String,
812    #[doc = " The associated URI for this workspace folder."]
813    pub uri: DocumentUri,
814}
815
816#[derive(Clone, PartialEq, Debug, Default)]
817pub struct WorkspaceFolderParams {}
818#[doc = " The workspace folder change event."]
819#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
820pub struct WorkspaceFoldersChangeEvent {
821    #[doc = " The array of added workspace folders"]
822    pub added: Vec<WorkspaceFolder>,
823    #[doc = " The array of the removed workspace folders"]
824    pub removed: Vec<WorkspaceFolder>,
825}
826#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
827pub struct WorkspaceFoldersServerCapabilities {
828    #[doc = " Whether the server wants to receive workspace folder change notifications."]
829    #[doc = " "]
830    #[doc = " If a string is provided, the string is treated as an ID under which the notification is "]
831    #[doc = " registered on the client side. The ID can be used to unregister for these events using the "]
832    #[doc = " `client/unregisterCapability` request."]
833    #[serde(skip_serializing_if = "Option::is_none")]
834    #[serde(rename = "changeNotifications")]
835    pub change_notifications: Option<OneOf<bool, String>>,
836    #[doc = " The server has support for workspace folders"]
837    #[serde(skip_serializing_if = "Option::is_none")]
838    pub supported: Option<bool>,
839}
840#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
841pub struct WorkspaceSymbolClientCapabilitiesSymbolKind {
842    #[doc = " The symbol kind values the client supports. When this property exists the client also "]
843    #[doc = " guarantees that it will handle values outside its set gracefully and falls back to a "]
844    #[doc = " default value when unknown."]
845    #[doc = " "]
846    #[doc = " If this property is not present the client only supports the symbol kinds from `File` to "]
847    #[doc = " `Array` as defined in the initial version of the protocol."]
848    #[serde(skip_serializing_if = "Option::is_none")]
849    #[serde(rename = "valueSet")]
850    pub value_set: Option<Vec<SymbolKind>>,
851}
852#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
853pub struct WorkspaceSymbolClientCapabilitiesTagSupport {
854    #[doc = " The tags supported by the client."]
855    #[serde(rename = "valueSet")]
856    pub value_set: Vec<SymbolTag>,
857}
858#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
859pub struct WorkspaceSymbolClientCapabilities {
860    #[doc = " Symbol request supports dynamic registration."]
861    #[serde(skip_serializing_if = "Option::is_none")]
862    #[serde(rename = "dynamicRegistration")]
863    pub dynamic_registration: Option<bool>,
864    #[doc = " Specific capabilities for the `SymbolKind` in the `workspace/symbol` request."]
865    #[serde(skip_serializing_if = "Option::is_none")]
866    #[serde(rename = "symbolKind")]
867    pub symbol_kind: Option<WorkspaceSymbolClientCapabilitiesSymbolKind>,
868    #[doc = " The client supports tags on `SymbolInformation`. Clients supporting tags have to handle "]
869    #[doc = " unknown tags gracefully."]
870    #[serde(skip_serializing_if = "Option::is_none")]
871    #[serde(rename = "tagSupport")]
872    pub tag_support: Option<WorkspaceSymbolClientCapabilitiesTagSupport>,
873}
874#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
875pub struct WorkspaceSymbolOptions {
876    #[serde(skip_serializing_if = "Option::is_none")]
877    #[serde(rename = "workDoneProgress")]
878    pub work_done_progress: Option<bool>,
879}
880#[doc = " The parameters of a Workspace Symbol Request."]
881#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
882pub struct WorkspaceSymbolParams {
883    #[doc = " An optional token that a server can use to report partial results (e.g. streaming) to the "]
884    #[doc = " client."]
885    #[serde(skip_serializing_if = "Option::is_none")]
886    #[serde(rename = "partialResultToken")]
887    pub partial_result_token: Option<ProgressToken>,
888    #[doc = " A query string to filter symbols by. Clients may send an empty string here to request all "]
889    #[doc = " symbols."]
890    pub query: String,
891    #[doc = " An optional token that a server can use to report work done progress."]
892    #[serde(skip_serializing_if = "Option::is_none")]
893    #[serde(rename = "workDoneToken")]
894    pub work_done_token: Option<ProgressToken>,
895}
896#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
897pub struct WorkspaceSymbolRegistrationOptions {
898    #[serde(skip_serializing_if = "Option::is_none")]
899    #[serde(rename = "workDoneProgress")]
900    pub work_done_progress: Option<bool>,
901}
902#[doc = " Defines a decimal number. Since decimal numbers are very rare in the language server "]
903#[doc = " specification we denote the exact range with every decimal using the mathematics interval "]
904#[doc = " notation (e.g. [0, 1] denotes all decimals d with 0 <= d <= 1."]
905pub type Decimal = f64;
906#[doc = " Defines an integer number in the range of -2^31 to 2^31 - 1."]
907pub type Integer = i32;
908#[doc = " Defines an unsigned integer number in the range of 0 to 2^31 - 1."]
909pub type Uinteger = u32;