debug_adapter_protocol/
types.rs

1use crate::utils::eq_default;
2use serde::{Deserialize, Serialize};
3use serde_json::Value;
4use std::collections::HashMap;
5use typed_builder::TypedBuilder;
6
7/// Information about a Breakpoint created in setBreakpoints, setFunctionBreakpoints, setInstructionBreakpoints, or setDataBreakpoints.
8#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
9pub struct Breakpoint {
10    /// An optional identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints.
11    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
12    #[builder(default)]
13    pub id: Option<i32>,
14
15    /// If true breakpoint could be set (but not necessarily at the desired location).
16    #[serde(rename = "verified")]
17    pub verified: bool,
18
19    /// An optional message about the state of the breakpoint.
20    ///
21    /// This is shown to the user and can be used to explain why a breakpoint could not be verified.
22    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
23    #[builder(default)]
24    pub message: Option<String>,
25
26    /// The source where the breakpoint is located.
27    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
28    #[builder(default)]
29    pub source: Option<Source>,
30
31    /// The start line of the actual range covered by the breakpoint.
32    #[serde(rename = "line", skip_serializing_if = "Option::is_none")]
33    #[builder(default)]
34    pub line: Option<i32>,
35
36    /// An optional start column of the actual range covered by the breakpoint.
37    #[serde(rename = "column", skip_serializing_if = "Option::is_none")]
38    #[builder(default)]
39    pub column: Option<i32>,
40
41    /// An optional end line of the actual range covered by the breakpoint.
42    #[serde(rename = "endLine", skip_serializing_if = "Option::is_none")]
43    #[builder(default)]
44    pub end_line: Option<i32>,
45
46    /// An optional end column of the actual range covered by the breakpoint.
47    ///
48    /// If no end line is given, then the end column is assumed to be in the start line.
49    #[serde(rename = "endColumn", skip_serializing_if = "Option::is_none")]
50    #[builder(default)]
51    pub end_column: Option<i32>,
52
53    /// An optional memory reference to where the breakpoint is set.
54    #[serde(
55        rename = "instructionReference",
56        skip_serializing_if = "Option::is_none"
57    )]
58    #[builder(default)]
59    pub instruction_reference: Option<String>,
60
61    /// An optional offset from the instruction reference.
62    ///
63    /// This can be negative.
64    #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
65    #[builder(default)]
66    pub offset: Option<i32>,
67
68    #[serde(skip)]
69    #[builder(default, setter(skip))]
70    private: (),
71}
72
73/// Properties of a breakpoint location returned from the 'breakpointLocations' request.
74#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
75pub struct BreakpointLocation {
76    /// Start line of breakpoint location.
77    #[serde(rename = "line")]
78    pub line: i32,
79
80    /// Optional start column of breakpoint location.
81    #[serde(rename = "column", skip_serializing_if = "Option::is_none")]
82    #[builder(default)]
83    pub column: Option<i32>,
84
85    /// Optional end line of breakpoint location if the location covers a range.
86    #[serde(rename = "endLine", skip_serializing_if = "Option::is_none")]
87    #[builder(default)]
88    pub end_line: Option<i32>,
89
90    /// Optional end column of breakpoint location if the location covers a range.
91    #[serde(rename = "endColumn", skip_serializing_if = "Option::is_none")]
92    #[builder(default)]
93    pub end_column: Option<i32>,
94
95    #[serde(skip)]
96    #[builder(default, setter(skip))]
97    private: (),
98}
99
100/// Information about the capabilities of a debug adapter.
101#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
102pub struct Capabilities {
103    /// The debug adapter supports the 'configurationDone' request.
104    #[serde(
105        rename = "supportsConfigurationDoneRequest",
106        default,
107        skip_serializing_if = "eq_default"
108    )]
109    #[builder(default)]
110    pub supports_configuration_done_request: bool,
111
112    /// The debug adapter supports function breakpoints.
113    #[serde(
114        rename = "supportsFunctionBreakpoints",
115        default,
116        skip_serializing_if = "eq_default"
117    )]
118    #[builder(default)]
119    pub supports_function_breakpoints: bool,
120
121    /// The debug adapter supports conditional breakpoints.
122    #[serde(
123        rename = "supportsConditionalBreakpoints",
124        default,
125        skip_serializing_if = "eq_default"
126    )]
127    #[builder(default)]
128    pub supports_conditional_breakpoints: bool,
129
130    /// The debug adapter supports breakpoints that break execution after a specified number of hits.
131    #[serde(
132        rename = "supportsHitConditionalBreakpoints",
133        default,
134        skip_serializing_if = "eq_default"
135    )]
136    #[builder(default)]
137    pub supports_hit_conditional_breakpoints: bool,
138
139    /// The debug adapter supports a (side effect free) evaluate request for data hovers.
140    #[serde(
141        rename = "supportsEvaluateForHovers",
142        default,
143        skip_serializing_if = "eq_default"
144    )]
145    #[builder(default)]
146    pub supports_evaluate_for_hovers: bool,
147
148    /// Available exception filter options for the 'setExceptionBreakpoints' request.
149    #[serde(
150        rename = "exceptionBreakpointFilters",
151        default,
152        skip_serializing_if = "Vec::is_empty"
153    )]
154    #[builder(default)]
155    pub exception_breakpoint_filters: Vec<ExceptionBreakpointsFilter>,
156
157    /// The debug adapter supports stepping back via the 'stepBack' and 'reverseContinue' requests.
158    #[serde(
159        rename = "supportsStepBack",
160        default,
161        skip_serializing_if = "eq_default"
162    )]
163    #[builder(default)]
164    pub supports_step_back: bool,
165
166    /// The debug adapter supports setting a variable to a value.
167    #[serde(
168        rename = "supportsSetVariable",
169        default,
170        skip_serializing_if = "eq_default"
171    )]
172    #[builder(default)]
173    pub supports_set_variable: bool,
174
175    /// The debug adapter supports restarting a frame.
176    #[serde(
177        rename = "supportsRestartFrame",
178        default,
179        skip_serializing_if = "eq_default"
180    )]
181    #[builder(default)]
182    pub supports_restart_frame: bool,
183
184    /// The debug adapter supports the 'gotoTargets' request.
185    #[serde(
186        rename = "supportsGotoTargetsRequest",
187        default,
188        skip_serializing_if = "eq_default"
189    )]
190    #[builder(default)]
191    pub supports_goto_targets_request: bool,
192
193    /// The debug adapter supports the 'stepInTargets' request.
194    #[serde(
195        rename = "supportsStepInTargetsRequest",
196        default,
197        skip_serializing_if = "eq_default"
198    )]
199    #[builder(default)]
200    pub supports_step_in_targets_request: bool,
201
202    /// The debug adapter supports the 'completions' request.
203    #[serde(
204        rename = "supportsCompletionsRequest",
205        default,
206        skip_serializing_if = "eq_default"
207    )]
208    #[builder(default)]
209    pub supports_completions_request: bool,
210
211    /// The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the '.' character.
212    #[serde(
213        rename = "completionTriggerCharacters",
214        skip_serializing_if = "Option::is_none"
215    )]
216    #[builder(default)]
217    pub completion_trigger_characters: Option<Vec<String>>,
218
219    /// The debug adapter supports the 'modules' request.
220    #[serde(
221        rename = "supportsModulesRequest",
222        default,
223        skip_serializing_if = "eq_default"
224    )]
225    #[builder(default)]
226    pub supports_modules_request: bool,
227
228    /// The set of additional module information exposed by the debug adapter.
229    #[serde(
230        rename = "additionalModuleColumns",
231        default,
232        skip_serializing_if = "Vec::is_empty"
233    )]
234    #[builder(default)]
235    pub additional_module_columns: Vec<ColumnDescriptor>,
236
237    /// Checksum algorithms supported by the debug adapter.
238    #[serde(
239        rename = "supportedChecksumAlgorithms",
240        default,
241        skip_serializing_if = "Vec::is_empty"
242    )]
243    #[builder(default)]
244    pub supported_checksum_algorithms: Vec<ChecksumAlgorithm>,
245
246    /// The debug adapter supports the 'restart' request. In this case a client should not implement 'restart' by terminating and relaunching the adapter but by calling the RestartRequest.
247    #[serde(
248        rename = "supportsRestartRequest",
249        default,
250        skip_serializing_if = "eq_default"
251    )]
252    #[builder(default)]
253    pub supports_restart_request: bool,
254
255    /// The debug adapter supports 'exceptionOptions' on the setExceptionBreakpoints request.
256    #[serde(
257        rename = "supportsExceptionOptions",
258        default,
259        skip_serializing_if = "eq_default"
260    )]
261    #[builder(default)]
262    pub supports_exception_options: bool,
263
264    /// The debug adapter supports a 'format' attribute on the stackTraceRequest, variablesRequest, and evaluateRequest.
265    #[serde(
266        rename = "supportsValueFormattingOptions",
267        default,
268        skip_serializing_if = "eq_default"
269    )]
270    #[builder(default)]
271    pub supports_value_formatting_options: bool,
272
273    /// The debug adapter supports the 'exceptionInfo' request.
274    #[serde(
275        rename = "supportsExceptionInfoRequest",
276        default,
277        skip_serializing_if = "eq_default"
278    )]
279    #[builder(default)]
280    pub supports_exception_info_request: bool,
281
282    /// The debug adapter supports the 'terminateDebuggee' attribute on the 'disconnect' request.
283    #[serde(
284        rename = "supportTerminateDebuggee",
285        default,
286        skip_serializing_if = "eq_default"
287    )]
288    #[builder(default)]
289    pub support_terminate_debuggee: bool,
290
291    /// The debug adapter supports the 'suspendDebuggee' attribute on the 'disconnect' request.
292    #[serde(
293        rename = "supportSuspendDebuggee",
294        default,
295        skip_serializing_if = "eq_default"
296    )]
297    #[builder(default)]
298    pub support_suspend_debuggee: bool,
299
300    /// The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and an optional 'totalFrames' result of the 'StackTrace' request are supported.
301    #[serde(
302        rename = "supportsDelayedStackTraceLoading",
303        default,
304        skip_serializing_if = "eq_default"
305    )]
306    #[builder(default)]
307    pub supports_delayed_stack_trace_loading: bool,
308
309    /// The debug adapter supports the 'loadedSources' request.
310    #[serde(
311        rename = "supportsLoadedSourcesRequest",
312        default,
313        skip_serializing_if = "eq_default"
314    )]
315    #[builder(default)]
316    pub supports_loaded_sources_request: bool,
317
318    /// The debug adapter supports logpoints by interpreting the 'logMessage' attribute of the SourceBreakpoint.
319    #[serde(
320        rename = "supportsLogPoints",
321        default,
322        skip_serializing_if = "eq_default"
323    )]
324    #[builder(default)]
325    pub supports_log_points: bool,
326
327    /// The debug adapter supports the 'terminateThreads' request.
328    #[serde(
329        rename = "supportsTerminateThreadsRequest",
330        default,
331        skip_serializing_if = "eq_default"
332    )]
333    #[builder(default)]
334    pub supports_terminate_threads_request: bool,
335
336    /// The debug adapter supports the 'setExpression' request.
337    #[serde(
338        rename = "supportsSetExpression",
339        default,
340        skip_serializing_if = "eq_default"
341    )]
342    #[builder(default)]
343    pub supports_set_expression: bool,
344
345    /// The debug adapter supports the 'terminate' request.
346    #[serde(
347        rename = "supportsTerminateRequest",
348        default,
349        skip_serializing_if = "eq_default"
350    )]
351    #[builder(default)]
352    pub supports_terminate_request: bool,
353
354    /// The debug adapter supports data breakpoints.
355    #[serde(
356        rename = "supportsDataBreakpoints",
357        default,
358        skip_serializing_if = "eq_default"
359    )]
360    #[builder(default)]
361    pub supports_data_breakpoints: bool,
362
363    /// The debug adapter supports the 'readMemory' request.
364    #[serde(
365        rename = "supportsReadMemoryRequest",
366        default,
367        skip_serializing_if = "eq_default"
368    )]
369    #[builder(default)]
370    pub supports_read_memory_request: bool,
371
372    /// The debug adapter supports the 'disassemble' request.
373    #[serde(
374        rename = "supportsDisassembleRequest",
375        default,
376        skip_serializing_if = "eq_default"
377    )]
378    #[builder(default)]
379    pub supports_disassemble_request: bool,
380
381    /// The debug adapter supports the 'cancel' request.
382    #[serde(
383        rename = "supportsCancelRequest",
384        default,
385        skip_serializing_if = "eq_default"
386    )]
387    #[builder(default)]
388    pub supports_cancel_request: bool,
389
390    /// The debug adapter supports the 'breakpointLocations' request.
391    #[serde(
392        rename = "supportsBreakpointLocationsRequest",
393        default,
394        skip_serializing_if = "eq_default"
395    )]
396    #[builder(default)]
397    pub supports_breakpoint_locations_request: bool,
398
399    /// The debug adapter supports the 'clipboard' context value in the 'evaluate' request.
400    #[serde(
401        rename = "supportsClipboardContext",
402        default,
403        skip_serializing_if = "eq_default"
404    )]
405    #[builder(default)]
406    pub supports_clipboard_context: bool,
407
408    /// The debug adapter supports stepping granularities (argument 'granularity') for the stepping requests.
409    #[serde(
410        rename = "supportsSteppingGranularity",
411        default,
412        skip_serializing_if = "eq_default"
413    )]
414    #[builder(default)]
415    pub supports_stepping_granularity: bool,
416
417    /// The debug adapter supports adding breakpoints based on instruction references.
418    #[serde(
419        rename = "supportsInstructionBreakpoints",
420        default,
421        skip_serializing_if = "eq_default"
422    )]
423    #[builder(default)]
424    pub supports_instruction_breakpoints: bool,
425
426    /// The debug adapter supports 'filterOptions' as an argument on the 'setExceptionBreakpoints' request.
427    #[serde(
428        rename = "supportsExceptionFilterOptions",
429        default,
430        skip_serializing_if = "eq_default"
431    )]
432    #[builder(default)]
433    pub supports_exception_filter_options: bool,
434
435    #[serde(skip)]
436    #[builder(default, setter(skip))]
437    private: (),
438}
439
440/// The checksum of an item calculated by the specified algorithm.
441#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
442pub struct Checksum {
443    /// The algorithm used to calculate this checksum.
444    #[serde(rename = "algorithm")]
445    pub algorithm: ChecksumAlgorithm,
446
447    /// Value of the checksum.
448    #[serde(rename = "checksum")]
449    pub checksum: String,
450
451    #[serde(skip)]
452    #[builder(default, setter(skip))]
453    private: (),
454}
455
456/// Names of checksum algorithms that may be supported by a debug adapter.
457#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
458pub enum ChecksumAlgorithm {
459    #[serde(rename = "MD5")]
460    MD5,
461
462    #[serde(rename = "SHA1")]
463    SHA1,
464
465    #[serde(rename = "SHA256")]
466    SHA256,
467
468    #[serde(rename = "timestamp")]
469    Timestamp,
470}
471
472/// A ColumnDescriptor specifies what module attribute to show in a column of the ModulesView, how to format it,
473///
474/// and what the column's label should be.
475///
476/// It is only used if the underlying UI actually supports this level of customization.
477#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
478pub struct ColumnDescriptor {
479    /// Name of the attribute rendered in this column.
480    #[serde(rename = "attributeName")]
481    pub attribute_name: String,
482
483    /// Header UI label of column.
484    #[serde(rename = "label")]
485    pub label: String,
486
487    /// Format to use for the rendered values in this column. TBD how the format strings looks like.
488    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
489    #[builder(default)]
490    pub format: Option<String>,
491
492    /// Datatype of values in this column.  Defaults to 'string' if not specified.
493    #[serde(rename = "type", default, skip_serializing_if = "eq_default")]
494    #[builder(default)]
495    pub type_: ColumnDescriptorType,
496
497    /// Width of this column in characters (hint only).
498    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
499    #[builder(default)]
500    pub width: Option<i32>,
501
502    #[serde(skip)]
503    #[builder(default, setter(skip))]
504    private: (),
505}
506
507#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
508pub enum ColumnDescriptorType {
509    #[serde(rename = "string")]
510    String,
511
512    #[serde(rename = "number")]
513    Number,
514
515    #[serde(rename = "boolean")]
516    Boolean,
517
518    #[serde(rename = "unixTimestampUTC")]
519    UnixTimestampUTC,
520}
521
522impl Default for ColumnDescriptorType {
523    fn default() -> Self {
524        ColumnDescriptorType::String
525    }
526}
527
528/// CompletionItems are the suggestions returned from the CompletionsRequest.
529#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
530pub struct CompletionItem {
531    /// The label of this completion item. By default this is also the text that is inserted when selecting this completion.
532    #[serde(rename = "label")]
533    pub label: String,
534
535    /// If text is not falsy then it is inserted instead of the label.
536    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
537    #[builder(default)]
538    pub text: Option<String>,
539
540    /// A string that should be used when comparing this item with other items. When `falsy` the label is used.
541    #[serde(rename = "sortText", skip_serializing_if = "Option::is_none")]
542    #[builder(default)]
543    pub sort_text: Option<String>,
544
545    /// The item's type. Typically the client uses this information to render the item in the UI with an icon.
546    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
547    #[builder(default)]
548    pub type_: Option<CompletionItemType>,
549
550    /// This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added.
551    ///
552    /// If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute.
553    #[serde(rename = "start", skip_serializing_if = "Option::is_none")]
554    #[builder(default)]
555    pub start: Option<i32>,
556
557    /// This value determines how many characters are overwritten by the completion text.
558    ///
559    /// If missing the value 0 is assumed which results in the completion text being inserted.
560    #[serde(rename = "length", default, skip_serializing_if = "eq_default")]
561    #[builder(default)]
562    pub length: i32,
563
564    /// Determines the start of the new selection after the text has been inserted (or replaced).
565    ///
566    /// The start position must in the range 0 and length of the completion text.
567    ///
568    /// If omitted the selection starts at the end of the completion text.
569    #[serde(rename = "selectionStart", skip_serializing_if = "Option::is_none")]
570    #[builder(default)]
571    pub selection_start: Option<i32>,
572
573    /// Determines the length of the new selection after the text has been inserted (or replaced).
574    ///
575    /// The selection can not extend beyond the bounds of the completion text.
576    ///
577    /// If omitted the length is assumed to be 0.
578    #[serde(
579        rename = "selectionLength",
580        default,
581        skip_serializing_if = "eq_default"
582    )]
583    #[builder(default)]
584    pub selection_length: i32,
585
586    #[serde(skip)]
587    #[builder(default, setter(skip))]
588    private: (),
589}
590
591/// Some predefined types for the CompletionItem. Please note that not all clients have specific icons for all of them.
592#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
593pub enum CompletionItemType {
594    #[serde(rename = "method")]
595    Method,
596
597    #[serde(rename = "function")]
598    Function,
599
600    #[serde(rename = "constructor")]
601    Constructor,
602
603    #[serde(rename = "field")]
604    Field,
605
606    #[serde(rename = "variable")]
607    Variable,
608
609    #[serde(rename = "class")]
610    Class,
611
612    #[serde(rename = "interface")]
613    Interface,
614
615    #[serde(rename = "module")]
616    Module,
617
618    #[serde(rename = "property")]
619    Property,
620
621    #[serde(rename = "unit")]
622    Unit,
623
624    #[serde(rename = "value")]
625    Value,
626
627    #[serde(rename = "enum")]
628    Enum,
629
630    #[serde(rename = "keyword")]
631    Keyword,
632
633    #[serde(rename = "snippet")]
634    Snippet,
635
636    #[serde(rename = "text")]
637    Text,
638
639    #[serde(rename = "color")]
640    Color,
641
642    #[serde(rename = "file")]
643    File,
644
645    #[serde(rename = "reference")]
646    Reference,
647
648    #[serde(rename = "customcolor")]
649    Customcolor,
650}
651
652/// Properties of a data breakpoint passed to the setDataBreakpoints request.
653#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
654pub struct DataBreakpoint {
655    /// An id representing the data. This id is returned from the dataBreakpointInfo request.
656    #[serde(rename = "dataId")]
657    pub data_id: String,
658
659    /// The access type of the data.
660    #[serde(rename = "accessType", skip_serializing_if = "Option::is_none")]
661    #[builder(default)]
662    pub access_type: Option<DataBreakpointAccessType>,
663
664    /// An optional expression for conditional breakpoints.
665    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
666    #[builder(default)]
667    pub condition: Option<String>,
668
669    /// An optional expression that controls how many hits of the breakpoint are ignored.
670    ///
671    /// The backend is expected to interpret the expression as needed.
672    #[serde(rename = "hitCondition", skip_serializing_if = "Option::is_none")]
673    #[builder(default)]
674    pub hit_condition: Option<String>,
675
676    #[serde(skip)]
677    #[builder(default, setter(skip))]
678    private: (),
679}
680
681/// This enumeration defines all possible access types for data breakpoints.
682#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
683pub enum DataBreakpointAccessType {
684    #[serde(rename = "read")]
685    Read,
686
687    #[serde(rename = "write")]
688    Write,
689
690    #[serde(rename = "readWrite")]
691    ReadWrite,
692}
693
694/// Represents a single disassembled instruction.
695#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
696pub struct DisassembledInstruction {
697    /// The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
698    #[serde(rename = "address")]
699    pub address: String,
700
701    /// Optional raw bytes representing the instruction and its operands, in an implementation-defined format.
702    #[serde(rename = "instructionBytes", skip_serializing_if = "Option::is_none")]
703    #[builder(default)]
704    pub instruction_bytes: Option<String>,
705
706    /// Text representing the instruction and its operands, in an implementation-defined format.
707    #[serde(rename = "instruction")]
708    pub instruction: String,
709
710    /// Name of the symbol that corresponds with the location of this instruction, if any.
711    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")]
712    #[builder(default)]
713    pub symbol: Option<String>,
714
715    /// Source location that corresponds to this instruction, if any.
716    ///
717    /// Should always be set (if available) on the first instruction returned,
718    ///
719    /// but can be omitted afterwards if this instruction maps to the same source file as the previous instruction.
720    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
721    #[builder(default)]
722    pub location: Option<Source>,
723
724    /// The line within the source location that corresponds to this instruction, if any.
725    #[serde(rename = "line", skip_serializing_if = "Option::is_none")]
726    #[builder(default)]
727    pub line: Option<i32>,
728
729    /// The column within the line that corresponds to this instruction, if any.
730    #[serde(rename = "column", skip_serializing_if = "Option::is_none")]
731    #[builder(default)]
732    pub column: Option<i32>,
733
734    /// The end line of the range that corresponds to this instruction, if any.
735    #[serde(rename = "endLine", skip_serializing_if = "Option::is_none")]
736    #[builder(default)]
737    pub end_line: Option<i32>,
738
739    /// The end column of the range that corresponds to this instruction, if any.
740    #[serde(rename = "endColumn", skip_serializing_if = "Option::is_none")]
741    #[builder(default)]
742    pub end_column: Option<i32>,
743
744    #[serde(skip)]
745    #[builder(default, setter(skip))]
746    private: (),
747}
748
749/// This enumeration defines all possible conditions when a thrown exception should result in a break.
750///
751/// never: never breaks,
752///
753/// always: always breaks,
754///
755/// unhandled: breaks when exception unhandled,
756///
757/// userUnhandled: breaks if the exception is not handled by user code.
758#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
759pub enum ExceptionBreakMode {
760    #[serde(rename = "never")]
761    Never,
762
763    #[serde(rename = "always")]
764    Always,
765
766    #[serde(rename = "unhandled")]
767    Unhandled,
768
769    #[serde(rename = "userUnhandled")]
770    UserUnhandled,
771}
772
773/// An ExceptionBreakpointsFilter is shown in the UI as an filter option for configuring how exceptions are dealt with.
774#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
775pub struct ExceptionBreakpointsFilter {
776    /// The internal ID of the filter option. This value is passed to the 'setExceptionBreakpoints' request.
777    #[serde(rename = "filter")]
778    pub filter: String,
779
780    /// The name of the filter option. This will be shown in the UI.
781    #[serde(rename = "label")]
782    pub label: String,
783
784    /// An optional help text providing additional information about the exception filter. This string is typically shown as a hover and must be translated.
785    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
786    #[builder(default)]
787    pub description: Option<String>,
788
789    /// Initial value of the filter option. If not specified a value 'false' is assumed.
790    #[serde(rename = "default", default, skip_serializing_if = "eq_default")]
791    #[builder(default)]
792    pub default: bool,
793
794    /// Controls whether a condition can be specified for this filter option. If false or missing, a condition can not be set.
795    #[serde(
796        rename = "supportsCondition",
797        default,
798        skip_serializing_if = "eq_default"
799    )]
800    #[builder(default)]
801    pub supports_condition: bool,
802
803    /// An optional help text providing information about the condition. This string is shown as the placeholder text for a text box and must be translated.
804    #[serde(
805        rename = "conditionDescription",
806        skip_serializing_if = "Option::is_none"
807    )]
808    #[builder(default)]
809    pub condition_description: Option<String>,
810
811    #[serde(skip)]
812    #[builder(default, setter(skip))]
813    private: (),
814}
815
816/// Detailed information about an exception that has occurred.
817#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
818pub struct ExceptionDetails {
819    /// Message contained in the exception.
820    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
821    #[builder(default)]
822    pub message: Option<String>,
823
824    /// Short type name of the exception object.
825    #[serde(rename = "typeName", skip_serializing_if = "Option::is_none")]
826    #[builder(default)]
827    pub type_name: Option<String>,
828
829    /// Fully-qualified type name of the exception object.
830    #[serde(rename = "fullTypeName", skip_serializing_if = "Option::is_none")]
831    #[builder(default)]
832    pub full_type_name: Option<String>,
833
834    /// Optional expression that can be evaluated in the current scope to obtain the exception object.
835    #[serde(rename = "evaluateName", skip_serializing_if = "Option::is_none")]
836    #[builder(default)]
837    pub evaluate_name: Option<String>,
838
839    /// Stack trace at the time the exception was thrown.
840    #[serde(rename = "stackTrace", skip_serializing_if = "Option::is_none")]
841    #[builder(default)]
842    pub stack_trace: Option<String>,
843
844    /// Details of the exception contained by this exception, if any.
845    #[serde(
846        rename = "innerException",
847        default,
848        skip_serializing_if = "Vec::is_empty"
849    )]
850    #[builder(default)]
851    pub inner_exception: Vec<ExceptionDetails>,
852
853    #[serde(skip)]
854    #[builder(default, setter(skip))]
855    private: (),
856}
857
858/// An ExceptionFilterOptions is used to specify an exception filter together with a condition for the setExceptionsFilter request.
859#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
860pub struct ExceptionFilterOptions {
861    /// ID of an exception filter returned by the 'exceptionBreakpointFilters' capability.
862    #[serde(rename = "filterId")]
863    pub filter_id: String,
864
865    /// An optional expression for conditional exceptions.
866    ///
867    /// The exception will break into the debugger if the result of the condition is true.
868    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
869    #[builder(default)]
870    pub condition: Option<String>,
871
872    #[serde(skip)]
873    #[builder(default, setter(skip))]
874    private: (),
875}
876
877/// An ExceptionOptions assigns configuration options to a set of exceptions.
878#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
879pub struct ExceptionOptions {
880    /// A path that selects a single or multiple exceptions in a tree. If 'path' is missing, the whole tree is selected.
881    ///
882    /// By convention the first segment of the path is a category that is used to group exceptions in the UI.
883    #[serde(rename = "path", default, skip_serializing_if = "Vec::is_empty")]
884    #[builder(default)]
885    pub path: Vec<ExceptionPathSegment>,
886
887    /// Condition when a thrown exception should result in a break.
888    #[serde(rename = "breakMode")]
889    pub break_mode: ExceptionBreakMode,
890
891    #[serde(skip)]
892    #[builder(default, setter(skip))]
893    private: (),
894}
895
896/// An ExceptionPathSegment represents a segment in a path that is used to match leafs or nodes in a tree of exceptions.
897///
898/// If a segment consists of more than one name, it matches the names provided if 'negate' is false or missing or
899///
900/// it matches anything except the names provided if 'negate' is true.
901#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
902pub struct ExceptionPathSegment {
903    /// If false or missing this segment matches the names provided, otherwise it matches anything except the names provided.
904    #[serde(rename = "negate", default, skip_serializing_if = "eq_default")]
905    #[builder(default)]
906    pub negate: bool,
907
908    /// Depending on the value of 'negate' the names that should match or not match.
909    #[serde(rename = "names")]
910    pub names: Vec<String>,
911
912    #[serde(skip)]
913    #[builder(default, setter(skip))]
914    private: (),
915}
916
917/// Properties of a breakpoint passed to the setFunctionBreakpoints request.
918#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
919pub struct FunctionBreakpoint {
920    /// The name of the function.
921    #[serde(rename = "name")]
922    pub name: String,
923
924    /// An optional expression for conditional breakpoints.
925    ///
926    /// It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true.
927    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
928    #[builder(default)]
929    pub condition: Option<String>,
930
931    /// An optional expression that controls how many hits of the breakpoint are ignored.
932    ///
933    /// The backend is expected to interpret the expression as needed.
934    ///
935    /// The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true.
936    #[serde(rename = "hitCondition", skip_serializing_if = "Option::is_none")]
937    #[builder(default)]
938    pub hit_condition: Option<String>,
939
940    #[serde(skip)]
941    #[builder(default, setter(skip))]
942    private: (),
943}
944
945/// A GotoTarget describes a code location that can be used as a target in the 'goto' request.
946///
947/// The possible goto targets can be determined via the 'gotoTargets' request.
948#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
949pub struct GotoTarget {
950    /// Unique identifier for a goto target. This is used in the goto request.
951    #[serde(rename = "id")]
952    pub id: i32,
953
954    /// The name of the goto target (shown in the UI).
955    #[serde(rename = "label")]
956    pub label: String,
957
958    /// The line of the goto target.
959    #[serde(rename = "line")]
960    pub line: i32,
961
962    /// An optional column of the goto target.
963    #[serde(rename = "column", skip_serializing_if = "Option::is_none")]
964    #[builder(default)]
965    pub column: Option<i32>,
966
967    /// An optional end line of the range covered by the goto target.
968    #[serde(rename = "endLine", skip_serializing_if = "Option::is_none")]
969    #[builder(default)]
970    pub end_line: Option<i32>,
971
972    /// An optional end column of the range covered by the goto target.
973    #[serde(rename = "endColumn", skip_serializing_if = "Option::is_none")]
974    #[builder(default)]
975    pub end_column: Option<i32>,
976
977    /// Optional memory reference for the instruction pointer value represented by this target.
978    #[serde(
979        rename = "instructionPointerReference",
980        skip_serializing_if = "Option::is_none"
981    )]
982    #[builder(default)]
983    pub instruction_pointer_reference: Option<String>,
984
985    #[serde(skip)]
986    #[builder(default, setter(skip))]
987    private: (),
988}
989
990/// Properties of a breakpoint passed to the setInstructionBreakpoints request
991#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
992pub struct InstructionBreakpoint {
993    /// The instruction reference of the breakpoint.
994    ///
995    /// This should be a memory or instruction pointer reference from an EvaluateResponse, Variable, StackFrame, GotoTarget, or Breakpoint.
996    #[serde(rename = "instructionReference")]
997    pub instruction_reference: String,
998
999    /// An optional offset from the instruction reference.
1000    ///
1001    /// This can be negative.
1002    #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
1003    #[builder(default)]
1004    pub offset: Option<i32>,
1005
1006    /// An optional expression for conditional breakpoints.
1007    ///
1008    /// It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true.
1009    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
1010    #[builder(default)]
1011    pub condition: Option<String>,
1012
1013    /// An optional expression that controls how many hits of the breakpoint are ignored.
1014    ///
1015    /// The backend is expected to interpret the expression as needed.
1016    ///
1017    /// The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true.
1018    #[serde(rename = "hitCondition", skip_serializing_if = "Option::is_none")]
1019    #[builder(default)]
1020    pub hit_condition: Option<String>,
1021
1022    #[serde(skip)]
1023    #[builder(default, setter(skip))]
1024    private: (),
1025}
1026
1027/// Logical areas that can be invalidated by the 'invalidated' event.
1028#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1029pub enum InvalidatedAreas {
1030    /// All previously fetched data has become invalid and needs to be refetched.
1031    #[serde(rename = "all")]
1032    All,
1033
1034    /// Previously fetched stack related data has become invalid and needs to be refetched.
1035    #[serde(rename = "stacks")]
1036    Stacks,
1037
1038    /// Previously fetched thread related data has become invalid and needs to be refetched.
1039    #[serde(rename = "threads")]
1040    Threads,
1041
1042    /// Previously fetched variable data has become invalid and needs to be refetched.
1043    #[serde(rename = "variables")]
1044    Variables,
1045}
1046
1047/// A structured message object. Used to return errors from requests.
1048#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1049pub struct Message {
1050    /// Unique identifier for the message.
1051    #[serde(rename = "id")]
1052    pub id: i32,
1053
1054    /// A format string for the message. Embedded variables have the form '{name}'.
1055    ///
1056    /// If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes.
1057    #[serde(rename = "format")]
1058    pub format: String,
1059
1060    /// An object used as a dictionary for looking up the variables in the format string.
1061    #[serde(
1062        rename = "variables",
1063        default,
1064        skip_serializing_if = "HashMap::is_empty"
1065    )]
1066    #[builder(default)]
1067    pub variables: HashMap<String, String>,
1068
1069    /// If true send to telemetry.
1070    #[serde(rename = "sendTelemetry", default, skip_serializing_if = "eq_default")]
1071    #[builder(default)]
1072    pub send_telemetry: bool,
1073
1074    /// If true show user.
1075    #[serde(rename = "showUser", default, skip_serializing_if = "eq_default")]
1076    #[builder(default)]
1077    pub show_user: bool,
1078
1079    /// An optional url where additional information about this message can be found.
1080    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
1081    #[builder(default)]
1082    pub url: Option<String>,
1083
1084    /// An optional label that is presented to the user as the UI for opening the url.
1085    #[serde(rename = "urlLabel", skip_serializing_if = "Option::is_none")]
1086    #[builder(default)]
1087    pub url_label: Option<String>,
1088
1089    #[serde(skip)]
1090    #[builder(default, setter(skip))]
1091    private: (),
1092}
1093
1094/// A Module object represents a row in the modules view.
1095///
1096/// Two attributes are mandatory: an id identifies a module in the modules view and is used in a ModuleEvent for identifying a module for adding, updating or deleting.
1097///
1098/// The name is used to minimally render the module in the UI.
1099///
1100///
1101///
1102/// Additional attributes can be added to the module. They will show up in the module View if they have a corresponding ColumnDescriptor.
1103///
1104///
1105///
1106/// To avoid an unnecessary proliferation of additional attributes with similar semantics but different names
1107///
1108/// we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found.
1109#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1110pub struct Module {
1111    /// Unique identifier for the module.
1112    #[serde(rename = "id")]
1113    pub id: ModuleId,
1114
1115    /// A name of the module.
1116    #[serde(rename = "name")]
1117    pub name: String,
1118
1119    /// optional but recommended attributes.
1120    ///
1121    /// always try to use these first before introducing additional attributes.
1122    ///
1123    ///
1124    ///
1125    /// Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module.
1126    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
1127    #[builder(default)]
1128    pub path: Option<String>,
1129
1130    /// True if the module is optimized.
1131    #[serde(rename = "isOptimized", skip_serializing_if = "Option::is_none")]
1132    #[builder(default)]
1133    pub is_optimized: Option<bool>,
1134
1135    /// True if the module is considered 'user code' by a debugger that supports 'Just My Code'.
1136    #[serde(rename = "isUserCode", skip_serializing_if = "Option::is_none")]
1137    #[builder(default)]
1138    pub is_user_code: Option<bool>,
1139
1140    /// Version of Module.
1141    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
1142    #[builder(default)]
1143    pub version: Option<String>,
1144
1145    /// User understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc.
1146    #[serde(rename = "symbolStatus", skip_serializing_if = "Option::is_none")]
1147    #[builder(default)]
1148    pub symbol_status: Option<String>,
1149
1150    /// Logical full path to the symbol file. The exact definition is implementation defined.
1151    #[serde(rename = "symbolFilePath", skip_serializing_if = "Option::is_none")]
1152    #[builder(default)]
1153    pub symbol_file_path: Option<String>,
1154
1155    /// Module created or modified.
1156    #[serde(rename = "dateTimeStamp", skip_serializing_if = "Option::is_none")]
1157    #[builder(default)]
1158    pub date_time_stamp: Option<String>,
1159
1160    /// Address range covered by this module.
1161    #[serde(rename = "addressRange", skip_serializing_if = "Option::is_none")]
1162    #[builder(default)]
1163    pub address_range: Option<String>,
1164
1165    #[serde(skip)]
1166    #[builder(default, setter(skip))]
1167    private: (),
1168}
1169
1170#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1171#[serde(untagged)]
1172pub enum ModuleId {
1173    Integer(i32),
1174    String(String),
1175}
1176
1177/// The ModulesViewDescriptor is the container for all declarative configuration options of a ModuleView.
1178///
1179/// For now it only specifies the columns to be shown in the modules view.
1180#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1181pub struct ModulesViewDescriptor {
1182    #[serde(rename = "columns")]
1183    pub columns: Vec<ColumnDescriptor>,
1184
1185    #[serde(skip)]
1186    #[builder(default, setter(skip))]
1187    private: (),
1188}
1189
1190/// A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source.
1191#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1192pub struct Scope {
1193    /// Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated.
1194    #[serde(rename = "name")]
1195    pub name: String,
1196
1197    /// An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.
1198    #[serde(rename = "presentationHint", skip_serializing_if = "Option::is_none")]
1199    #[builder(default)]
1200    pub presentation_hint: Option<ScopePresentationHint>,
1201
1202    /// The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest.
1203    #[serde(rename = "variablesReference")]
1204    pub variables_reference: i32,
1205
1206    /// The number of named variables in this scope.
1207    ///
1208    /// The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
1209    #[serde(rename = "namedVariables", skip_serializing_if = "Option::is_none")]
1210    #[builder(default)]
1211    pub named_variables: Option<i32>,
1212
1213    /// The number of indexed variables in this scope.
1214    ///
1215    /// The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
1216    #[serde(rename = "indexedVariables", skip_serializing_if = "Option::is_none")]
1217    #[builder(default)]
1218    pub indexed_variables: Option<i32>,
1219
1220    /// If true, the number of variables in this scope is large or expensive to retrieve.
1221    #[serde(rename = "expensive")]
1222    pub expensive: bool,
1223
1224    /// Optional source for this scope.
1225    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
1226    #[builder(default)]
1227    pub source: Option<Source>,
1228
1229    /// Optional start line of the range covered by this scope.
1230    #[serde(rename = "line", skip_serializing_if = "Option::is_none")]
1231    #[builder(default)]
1232    pub line: Option<i32>,
1233
1234    /// Optional start column of the range covered by this scope.
1235    #[serde(rename = "column", skip_serializing_if = "Option::is_none")]
1236    #[builder(default)]
1237    pub column: Option<i32>,
1238
1239    /// Optional end line of the range covered by this scope.
1240    #[serde(rename = "endLine", skip_serializing_if = "Option::is_none")]
1241    #[builder(default)]
1242    pub end_line: Option<i32>,
1243
1244    /// Optional end column of the range covered by this scope.
1245    #[serde(rename = "endColumn", skip_serializing_if = "Option::is_none")]
1246    #[builder(default)]
1247    pub end_column: Option<i32>,
1248
1249    #[serde(skip)]
1250    #[builder(default, setter(skip))]
1251    private: (),
1252}
1253
1254#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1255pub enum ScopePresentationHint {
1256    /// Scope contains method arguments.
1257    #[serde(rename = "arguments")]
1258    Arguments,
1259
1260    /// Scope contains local variables.
1261    #[serde(rename = "locals")]
1262    Locals,
1263
1264    /// Scope contains registers. Only a single 'registers' scope should be returned from a 'scopes' request.
1265    #[serde(rename = "registers")]
1266    Registers,
1267}
1268
1269/// A Source is a descriptor for source code.
1270///
1271/// It is returned from the debug adapter as part of a StackFrame and it is used by clients when specifying breakpoints.
1272#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1273pub struct Source {
1274    /// The short name of the source. Every source returned from the debug adapter has a name.
1275    ///
1276    /// When sending a source to the debug adapter this name is optional.
1277    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
1278    #[builder(default)]
1279    pub name: Option<String>,
1280
1281    /// The path of the source to be shown in the UI.
1282    ///
1283    /// It is only used to locate and load the content of the source if no sourceReference is specified (or its value is 0).
1284    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
1285    #[builder(default)]
1286    pub path: Option<String>,
1287
1288    /// If sourceReference > 0 the contents of the source must be retrieved through the SourceRequest (even if a path is specified).
1289    ///
1290    /// A sourceReference is only valid for a session, so it must not be used to persist a source.
1291    ///
1292    /// The value should be less than or equal to 2147483647 (2^31-1).
1293    #[serde(rename = "sourceReference", skip_serializing_if = "Option::is_none")]
1294    #[builder(default)]
1295    pub source_reference: Option<i32>,
1296
1297    /// An optional hint for how to present the source in the UI.
1298    ///
1299    /// A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping.
1300    #[serde(rename = "presentationHint", skip_serializing_if = "Option::is_none")]
1301    #[builder(default)]
1302    pub presentation_hint: Option<SourcePresentationHint>,
1303
1304    /// The (optional) origin of this source: possible values 'internal module', 'inlined content from source map', etc.
1305    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
1306    #[builder(default)]
1307    pub origin: Option<String>,
1308
1309    /// An optional list of sources that are related to this source. These may be the source that generated this source.
1310    #[serde(rename = "sources", default, skip_serializing_if = "Vec::is_empty")]
1311    #[builder(default)]
1312    pub sources: Vec<Source>,
1313
1314    /// Optional data that a debug adapter might want to loop through the client.
1315    ///
1316    /// The client should leave the data intact and persist it across sessions. The client should not interpret the data.
1317    #[serde(rename = "adapterData", skip_serializing_if = "Option::is_none")]
1318    #[builder(default)]
1319    pub adapter_data: Option<Value>,
1320
1321    /// The checksums associated with this file.
1322    #[serde(rename = "checksums", default, skip_serializing_if = "Vec::is_empty")]
1323    #[builder(default)]
1324    pub checksums: Vec<Checksum>,
1325
1326    #[serde(skip)]
1327    #[builder(default, setter(skip))]
1328    private: (),
1329}
1330
1331/// An optional hint for how to present the source in the UI.
1332///
1333/// A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping.
1334#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1335pub enum SourcePresentationHint {
1336    #[serde(rename = "normal")]
1337    Normal,
1338
1339    #[serde(rename = "emphasize")]
1340    Emphasize,
1341
1342    #[serde(rename = "deemphasize")]
1343    Deemphasize,
1344}
1345
1346/// Properties of a breakpoint or logpoint passed to the setBreakpoints request.
1347#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1348pub struct SourceBreakpoint {
1349    /// The source line of the breakpoint or logpoint.
1350    #[serde(rename = "line")]
1351    pub line: i32,
1352
1353    /// An optional source column of the breakpoint.
1354    #[serde(rename = "column", skip_serializing_if = "Option::is_none")]
1355    #[builder(default)]
1356    pub column: Option<i32>,
1357
1358    /// An optional expression for conditional breakpoints.
1359    ///
1360    /// It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true.
1361    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
1362    #[builder(default)]
1363    pub condition: Option<String>,
1364
1365    /// An optional expression that controls how many hits of the breakpoint are ignored.
1366    ///
1367    /// The backend is expected to interpret the expression as needed.
1368    ///
1369    /// The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true.
1370    #[serde(rename = "hitCondition", skip_serializing_if = "Option::is_none")]
1371    #[builder(default)]
1372    pub hit_condition: Option<String>,
1373
1374    /// If this attribute exists and is non-empty, the backend must not 'break' (stop)
1375    ///
1376    /// but log the message instead. Expressions within {} are interpolated.
1377    ///
1378    /// The attribute is only honored by a debug adapter if the capability 'supportsLogPoints' is true.
1379    #[serde(rename = "logMessage", skip_serializing_if = "Option::is_none")]
1380    #[builder(default)]
1381    pub log_message: Option<String>,
1382
1383    #[serde(skip)]
1384    #[builder(default, setter(skip))]
1385    private: (),
1386}
1387
1388/// A Stackframe contains the source location.
1389#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1390pub struct StackFrame {
1391    /// An identifier for the stack frame. It must be unique across all threads.
1392    ///
1393    /// This id can be used to retrieve the scopes of the frame with the 'scopesRequest' or to restart the execution of a stackframe.
1394    #[serde(rename = "id")]
1395    pub id: i32,
1396
1397    /// The name of the stack frame, typically a method name.
1398    #[serde(rename = "name")]
1399    pub name: String,
1400
1401    /// The optional source of the frame.
1402    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
1403    #[builder(default)]
1404    pub source: Option<Source>,
1405
1406    /// The line within the file of the frame. If source is null or doesn't exist, line is 0 and must be ignored.
1407    #[serde(rename = "line")]
1408    pub line: i32,
1409
1410    /// The column within the line. If source is null or doesn't exist, column is 0 and must be ignored.
1411    #[serde(rename = "column")]
1412    pub column: i32,
1413
1414    /// An optional end line of the range covered by the stack frame.
1415    #[serde(rename = "endLine", skip_serializing_if = "Option::is_none")]
1416    #[builder(default)]
1417    pub end_line: Option<i32>,
1418
1419    /// An optional end column of the range covered by the stack frame.
1420    #[serde(rename = "endColumn", skip_serializing_if = "Option::is_none")]
1421    #[builder(default)]
1422    pub end_column: Option<i32>,
1423
1424    /// Indicates whether this frame can be restarted with the 'restart' request. Clients should only use this if the debug adapter supports the 'restart' request (capability 'supportsRestartRequest' is true).
1425    #[serde(rename = "canRestart", skip_serializing_if = "Option::is_none")]
1426    #[builder(default)]
1427    pub can_restart: Option<bool>,
1428
1429    /// Optional memory reference for the current instruction pointer in this frame.
1430    #[serde(
1431        rename = "instructionPointerReference",
1432        skip_serializing_if = "Option::is_none"
1433    )]
1434    #[builder(default)]
1435    pub instruction_pointer_reference: Option<String>,
1436
1437    /// The module associated with this frame, if any.
1438    #[serde(rename = "moduleId", skip_serializing_if = "Option::is_none")]
1439    #[builder(default)]
1440    pub module_id: Option<ModuleId>,
1441
1442    /// An optional hint for how to present this frame in the UI.
1443    ///
1444    /// A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way.
1445    #[serde(rename = "presentationHint", skip_serializing_if = "Option::is_none")]
1446    #[builder(default)]
1447    pub presentation_hint: Option<StackFramePresentationHint>,
1448
1449    #[serde(skip)]
1450    #[builder(default, setter(skip))]
1451    private: (),
1452}
1453
1454#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1455pub enum StackFramePresentationHint {
1456    #[serde(rename = "normal")]
1457    Normal,
1458
1459    #[serde(rename = "label")]
1460    Label,
1461
1462    #[serde(rename = "subtle")]
1463    Subtle,
1464}
1465
1466/// Provides formatting information for a stack frame.
1467#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1468pub struct StackFrameFormat {
1469    /// Displays parameters for the stack frame.
1470    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
1471    #[builder(default)]
1472    pub parameters: Option<bool>,
1473
1474    /// Displays the types of parameters for the stack frame.
1475    #[serde(rename = "parameterTypes", skip_serializing_if = "Option::is_none")]
1476    #[builder(default)]
1477    pub parameter_types: Option<bool>,
1478
1479    /// Displays the names of parameters for the stack frame.
1480    #[serde(rename = "parameterNames", skip_serializing_if = "Option::is_none")]
1481    #[builder(default)]
1482    pub parameter_names: Option<bool>,
1483
1484    /// Displays the values of parameters for the stack frame.
1485    #[serde(rename = "parameterValues", skip_serializing_if = "Option::is_none")]
1486    #[builder(default)]
1487    pub parameter_values: Option<bool>,
1488
1489    /// Displays the line number of the stack frame.
1490    #[serde(rename = "line", skip_serializing_if = "Option::is_none")]
1491    #[builder(default)]
1492    pub line: Option<bool>,
1493
1494    /// Displays the module of the stack frame.
1495    #[serde(rename = "module", skip_serializing_if = "Option::is_none")]
1496    #[builder(default)]
1497    pub module: Option<bool>,
1498
1499    /// Includes all stack frames, including those the debug adapter might otherwise hide.
1500    #[serde(rename = "includeAll", skip_serializing_if = "Option::is_none")]
1501    #[builder(default)]
1502    pub include_all: Option<bool>,
1503
1504    #[serde(skip)]
1505    #[builder(default, setter(skip))]
1506    private: (),
1507}
1508
1509/// A StepInTarget can be used in the 'stepIn' request and determines into which single target the stepIn request should step.
1510#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1511pub struct StepInTarget {
1512    /// Unique identifier for a stepIn target.
1513    #[serde(rename = "id")]
1514    pub id: i32,
1515
1516    /// The name of the stepIn target (shown in the UI).
1517    #[serde(rename = "label")]
1518    pub label: String,
1519
1520    #[serde(skip)]
1521    #[builder(default, setter(skip))]
1522    private: (),
1523}
1524
1525/// The granularity of one 'step' in the stepping requests 'next', 'stepIn', 'stepOut', and 'stepBack'.
1526#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1527pub enum SteppingGranularity {
1528    /// The step should allow the program to run until the current statement has finished executing.
1529    ///
1530    /// The meaning of a statement is determined by the adapter and it may be considered equivalent to a line.
1531    ///
1532    /// For example 'for(int i = 0; i < 10; i++) could be considered to have 3 statements 'int i = 0', 'i < 10', and 'i++'.
1533    #[serde(rename = "statement")]
1534    Statement,
1535
1536    /// The step should allow the program to run until the current source line has executed.
1537    #[serde(rename = "line")]
1538    Line,
1539
1540    /// The step should allow one instruction to execute (e.g. one x86 instruction).
1541    #[serde(rename = "instruction")]
1542    Instruction,
1543}
1544
1545impl Default for SteppingGranularity {
1546    fn default() -> Self {
1547        SteppingGranularity::Statement
1548    }
1549}
1550
1551/// A Thread
1552#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1553pub struct Thread {
1554    /// Unique identifier for the thread.
1555    #[serde(rename = "id")]
1556    pub id: i32,
1557
1558    /// A name of the thread.
1559    #[serde(rename = "name")]
1560    pub name: String,
1561
1562    #[serde(skip)]
1563    #[builder(default, setter(skip))]
1564    private: (),
1565}
1566
1567/// Provides formatting information for a value.
1568#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1569pub struct ValueFormat {
1570    /// Display the value in hex.
1571    #[serde(rename = "hex", skip_serializing_if = "Option::is_none")]
1572    #[builder(default)]
1573    pub hex: Option<bool>,
1574
1575    #[serde(skip)]
1576    #[builder(default, setter(skip))]
1577    private: (),
1578}
1579
1580/// A Variable is a name/value pair.
1581///
1582/// Optionally a variable can have a 'type' that is shown if space permits or when hovering over the variable's name.
1583///
1584/// An optional 'kind' is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private.
1585///
1586/// If the value is structured (has children), a handle is provided to retrieve the children with the VariablesRequest.
1587///
1588/// If the number of named or indexed children is large, the numbers should be returned via the optional 'namedVariables' and 'indexedVariables' attributes.
1589///
1590/// The client can use this optional information to present the children in a paged UI and fetch them in chunks.
1591#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1592pub struct Variable {
1593    /// The variable's name.
1594    #[serde(rename = "name")]
1595    pub name: String,
1596
1597    /// The variable's value. This can be a multi-line text, e.g. for a function the body of a function.
1598    #[serde(rename = "value")]
1599    pub value: String,
1600
1601    /// The type of the variable's value. Typically shown in the UI when hovering over the value.
1602    ///
1603    /// This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request.
1604    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
1605    #[builder(default)]
1606    pub type_: Option<String>,
1607
1608    /// Properties of a variable that can be used to determine how to render the variable in the UI.
1609    #[serde(rename = "presentationHint", skip_serializing_if = "Option::is_none")]
1610    #[builder(default)]
1611    pub presentation_hint: Option<VariablePresentationHint>,
1612
1613    /// Optional evaluatable name of this variable which can be passed to the 'EvaluateRequest' to fetch the variable's value.
1614    #[serde(rename = "evaluateName", skip_serializing_if = "Option::is_none")]
1615    #[builder(default)]
1616    pub evaluate_name: Option<String>,
1617
1618    /// If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.
1619    #[serde(rename = "variablesReference")]
1620    pub variables_reference: i32,
1621
1622    /// The number of named child variables.
1623    ///
1624    /// The client can use this optional information to present the children in a paged UI and fetch them in chunks.
1625    #[serde(rename = "namedVariables", skip_serializing_if = "Option::is_none")]
1626    #[builder(default)]
1627    pub named_variables: Option<i32>,
1628
1629    /// The number of indexed child variables.
1630    ///
1631    /// The client can use this optional information to present the children in a paged UI and fetch them in chunks.
1632    #[serde(rename = "indexedVariables", skip_serializing_if = "Option::is_none")]
1633    #[builder(default)]
1634    pub indexed_variables: Option<i32>,
1635
1636    /// Optional memory reference for the variable if the variable represents executable code, such as a function pointer.
1637    ///
1638    /// This attribute is only required if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request.
1639    #[serde(rename = "memoryReference", skip_serializing_if = "Option::is_none")]
1640    #[builder(default)]
1641    pub memory_reference: Option<String>,
1642
1643    #[serde(skip)]
1644    #[builder(default, setter(skip))]
1645    private: (),
1646}
1647
1648/// Optional properties of a variable that can be used to determine how to render the variable in the UI.
1649#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, TypedBuilder)]
1650pub struct VariablePresentationHint {
1651    /// The kind of variable. Before introducing additional values, try to use the listed values.
1652    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
1653    #[builder(default)]
1654    pub kind: Option<VariableKind>,
1655
1656    /// Set of attributes represented as an array of strings. Before introducing additional values, try to use the listed values.
1657    #[serde(rename = "attributes", default, skip_serializing_if = "Vec::is_empty")]
1658    #[builder(default)]
1659    pub attributes: Vec<VariableAttribute>,
1660
1661    /// Visibility of variable. Before introducing additional values, try to use the listed values.
1662    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
1663    #[builder(default)]
1664    pub visibility: Option<VariableVisibility>,
1665
1666    #[serde(skip)]
1667    #[builder(default, setter(skip))]
1668    private: (),
1669}
1670
1671#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1672pub enum VariableKind {
1673    /// Indicates that the object is a property.
1674    #[serde(rename = "property")]
1675    Property,
1676
1677    /// Indicates that the object is a method.
1678    #[serde(rename = "method")]
1679    Method,
1680
1681    /// Indicates that the object is a class.
1682    #[serde(rename = "class")]
1683    Class,
1684
1685    /// Indicates that the object is data.
1686    #[serde(rename = "data")]
1687    Data,
1688
1689    /// Indicates that the object is an event.
1690    #[serde(rename = "event")]
1691    Event,
1692
1693    /// Indicates that the object is a base class.
1694    #[serde(rename = "baseClass")]
1695    BaseClass,
1696
1697    /// Indicates that the object is an inner class.
1698    #[serde(rename = "innerClass")]
1699    InnerClass,
1700
1701    /// Indicates that the object is an interface.
1702    #[serde(rename = "interface")]
1703    Interface,
1704
1705    /// Indicates that the object is the most derived class.
1706    #[serde(rename = "mostDerivedClass")]
1707    MostDerivedClass,
1708
1709    /// Indicates that the object is virtual, that means it is a synthetic object introducedby the
1710    ///
1711    /// adapter for rendering purposes, e.g. an index range for large arrays.
1712    #[serde(rename = "virtual")]
1713    Virtual,
1714
1715    /// Deprecated: Indicates that a data breakpoint is registered for the object. The 'hasDataBreakpoint' attribute should generally be used instead.
1716    #[serde(rename = "dataBreakpoint")]
1717    DataBreakpoint,
1718}
1719
1720#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1721pub enum VariableAttribute {
1722    /// Indicates that the object is static.
1723    #[serde(rename = "static")]
1724    Static,
1725
1726    /// Indicates that the object is a constant.
1727    #[serde(rename = "constant")]
1728    Constant,
1729
1730    /// Indicates that the object is read only.
1731    #[serde(rename = "readOnly")]
1732    ReadOnly,
1733
1734    /// Indicates that the object is a raw string.
1735    #[serde(rename = "rawString")]
1736    RawString,
1737
1738    /// Indicates that the object can have an Object ID created for it.
1739    #[serde(rename = "hasObjectId")]
1740    HasObjectId,
1741
1742    /// Indicates that the object has an Object ID associated with it.
1743    #[serde(rename = "canHaveObjectId")]
1744    CanHaveObjectId,
1745
1746    /// Indicates that the evaluation had side effects.
1747    #[serde(rename = "hasSideEffects")]
1748    HasSideEffects,
1749
1750    /// Indicates that the object has its value tracked by a data breakpoint.
1751    #[serde(rename = "hasDataBreakpoint")]
1752    HasDataBreakpoint,
1753}
1754
1755#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
1756pub enum VariableVisibility {
1757    #[serde(rename = "public")]
1758    Public,
1759
1760    #[serde(rename = "private")]
1761    Private,
1762
1763    #[serde(rename = "protected")]
1764    Protected,
1765
1766    #[serde(rename = "internal")]
1767    Internal,
1768
1769    #[serde(rename = "final")]
1770    Final,
1771}