|
|
|
@ -1,6 +1,12 @@
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
use serde_json::Value;
|
|
|
|
|
|
|
|
|
|
pub trait Request {
|
|
|
|
|
type Arguments: serde::de::DeserializeOwned + serde::Serialize;
|
|
|
|
|
type Result: serde::de::DeserializeOwned + serde::Serialize;
|
|
|
|
|
const COMMAND: &'static str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ColumnDescriptor {
|
|
|
|
@ -74,28 +80,6 @@ impl std::ops::Deref for DebuggerCapabilities {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct InitializeArguments {
|
|
|
|
|
#[serde(rename = "clientID")]
|
|
|
|
|
pub client_id: Option<String>,
|
|
|
|
|
pub client_name: Option<String>,
|
|
|
|
|
#[serde(rename = "adapterID")]
|
|
|
|
|
pub adapter_id: String,
|
|
|
|
|
pub locale: Option<String>,
|
|
|
|
|
#[serde(rename = "linesStartAt1")]
|
|
|
|
|
pub lines_start_at_one: Option<bool>,
|
|
|
|
|
#[serde(rename = "columnsStartAt1")]
|
|
|
|
|
pub columns_start_at_one: Option<bool>,
|
|
|
|
|
pub path_format: Option<String>,
|
|
|
|
|
pub supports_variable_type: Option<bool>,
|
|
|
|
|
pub supports_variable_paging: Option<bool>,
|
|
|
|
|
pub supports_run_in_terminal_request: Option<bool>,
|
|
|
|
|
pub supports_memory_references: Option<bool>,
|
|
|
|
|
pub supports_progress_reporting: Option<bool>,
|
|
|
|
|
pub supports_invalidated_event: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct Checksum {
|
|
|
|
@ -126,15 +110,6 @@ pub struct SourceBreakpoint {
|
|
|
|
|
pub log_message: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct SetBreakpointsArguments {
|
|
|
|
|
pub source: Source,
|
|
|
|
|
pub breakpoints: Option<Vec<SourceBreakpoint>>,
|
|
|
|
|
// lines is deprecated
|
|
|
|
|
pub source_modified: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct Breakpoint {
|
|
|
|
@ -150,24 +125,6 @@ pub struct Breakpoint {
|
|
|
|
|
pub offset: Option<usize>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct SetBreakpointsResponseBody {
|
|
|
|
|
pub breakpoints: Option<Vec<Breakpoint>>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ContinueArguments {
|
|
|
|
|
pub thread_id: usize,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ContinueResponseBody {
|
|
|
|
|
pub all_threads_continued: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct StackFrameFormat {
|
|
|
|
@ -180,15 +137,6 @@ pub struct StackFrameFormat {
|
|
|
|
|
pub include_all: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct StackTraceArguments {
|
|
|
|
|
pub thread_id: usize,
|
|
|
|
|
pub start_frame: Option<usize>,
|
|
|
|
|
pub levels: Option<usize>,
|
|
|
|
|
pub format: Option<StackFrameFormat>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct StackFrame {
|
|
|
|
@ -205,13 +153,6 @@ pub struct StackFrame {
|
|
|
|
|
pub presentation_hint: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct StackTraceResponseBody {
|
|
|
|
|
pub total_frames: Option<usize>,
|
|
|
|
|
pub stack_frames: Vec<StackFrame>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct Thread {
|
|
|
|
@ -219,18 +160,6 @@ pub struct Thread {
|
|
|
|
|
pub name: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ThreadsResponseBody {
|
|
|
|
|
pub threads: Vec<Thread>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ScopesArguments {
|
|
|
|
|
pub frame_id: usize,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct Scope {
|
|
|
|
@ -247,28 +176,12 @@ pub struct Scope {
|
|
|
|
|
pub end_column: Option<usize>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ScopesResponseBody {
|
|
|
|
|
pub scopes: Vec<Scope>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ValueFormat {
|
|
|
|
|
pub hex: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct VariablesArguments {
|
|
|
|
|
pub variables_reference: usize,
|
|
|
|
|
pub filter: Option<String>,
|
|
|
|
|
pub start: Option<usize>,
|
|
|
|
|
pub count: Option<usize>,
|
|
|
|
|
pub format: Option<ValueFormat>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct VariablePresentationHint {
|
|
|
|
@ -292,15 +205,169 @@ pub struct Variable {
|
|
|
|
|
pub memory_reference: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub mod requests {
|
|
|
|
|
use super::*;
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct VariablesResponseBody {
|
|
|
|
|
pub struct InitializeArguments {
|
|
|
|
|
#[serde(rename = "clientID")]
|
|
|
|
|
pub client_id: Option<String>,
|
|
|
|
|
pub client_name: Option<String>,
|
|
|
|
|
#[serde(rename = "adapterID")]
|
|
|
|
|
pub adapter_id: String,
|
|
|
|
|
pub locale: Option<String>,
|
|
|
|
|
#[serde(rename = "linesStartAt1")]
|
|
|
|
|
pub lines_start_at_one: Option<bool>,
|
|
|
|
|
#[serde(rename = "columnsStartAt1")]
|
|
|
|
|
pub columns_start_at_one: Option<bool>,
|
|
|
|
|
pub path_format: Option<String>,
|
|
|
|
|
pub supports_variable_type: Option<bool>,
|
|
|
|
|
pub supports_variable_paging: Option<bool>,
|
|
|
|
|
pub supports_run_in_terminal_request: Option<bool>,
|
|
|
|
|
pub supports_memory_references: Option<bool>,
|
|
|
|
|
pub supports_progress_reporting: Option<bool>,
|
|
|
|
|
pub supports_invalidated_event: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct SetBreakpointsArguments {
|
|
|
|
|
pub source: Source,
|
|
|
|
|
pub breakpoints: Option<Vec<SourceBreakpoint>>,
|
|
|
|
|
// lines is deprecated
|
|
|
|
|
pub source_modified: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct SetBreakpointsResponse {
|
|
|
|
|
pub breakpoints: Option<Vec<Breakpoint>>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub enum SetBreakpoints {}
|
|
|
|
|
|
|
|
|
|
impl Request for SetBreakpoints {
|
|
|
|
|
type Arguments = SetBreakpointsArguments;
|
|
|
|
|
type Result = SetBreakpointsResponse;
|
|
|
|
|
const COMMAND: &'static str = "setBreakpoints";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ContinueArguments {
|
|
|
|
|
pub thread_id: usize,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ContinueResponse {
|
|
|
|
|
pub all_threads_continued: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub enum Continue {}
|
|
|
|
|
|
|
|
|
|
impl Request for Continue {
|
|
|
|
|
type Arguments = ContinueArguments;
|
|
|
|
|
type Result = ContinueResponse;
|
|
|
|
|
const COMMAND: &'static str = "continue";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct StackTraceArguments {
|
|
|
|
|
pub thread_id: usize,
|
|
|
|
|
pub start_frame: Option<usize>,
|
|
|
|
|
pub levels: Option<usize>,
|
|
|
|
|
pub format: Option<StackFrameFormat>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct StackTraceResponse {
|
|
|
|
|
pub total_frames: Option<usize>,
|
|
|
|
|
pub stack_frames: Vec<StackFrame>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub enum StackTrace {}
|
|
|
|
|
|
|
|
|
|
impl Request for StackTrace {
|
|
|
|
|
type Arguments = StackTraceArguments;
|
|
|
|
|
type Result = StackTraceResponse;
|
|
|
|
|
const COMMAND: &'static str = "stackTrace";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ThreadsResponse {
|
|
|
|
|
pub threads: Vec<Thread>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub enum Threads {}
|
|
|
|
|
|
|
|
|
|
impl Request for Threads {
|
|
|
|
|
type Arguments = ();
|
|
|
|
|
type Result = ThreadsResponse;
|
|
|
|
|
const COMMAND: &'static str = "threads";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ScopesArguments {
|
|
|
|
|
pub frame_id: usize,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ScopesResponse {
|
|
|
|
|
pub scopes: Vec<Scope>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub enum Scopes {}
|
|
|
|
|
|
|
|
|
|
impl Request for Scopes {
|
|
|
|
|
type Arguments = ScopesArguments;
|
|
|
|
|
type Result = ScopesResponse;
|
|
|
|
|
const COMMAND: &'static str = "scopes";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct VariablesArguments {
|
|
|
|
|
pub variables_reference: usize,
|
|
|
|
|
pub filter: Option<String>,
|
|
|
|
|
pub start: Option<usize>,
|
|
|
|
|
pub count: Option<usize>,
|
|
|
|
|
pub format: Option<ValueFormat>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct VariablesResponse {
|
|
|
|
|
pub variables: Vec<Variable>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub enum Variables {}
|
|
|
|
|
|
|
|
|
|
impl Request for Variables {
|
|
|
|
|
type Arguments = VariablesArguments;
|
|
|
|
|
type Result = VariablesResponse;
|
|
|
|
|
const COMMAND: &'static str = "scopes";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Events
|
|
|
|
|
|
|
|
|
|
pub mod events {
|
|
|
|
|
use super::*;
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct OutputEventBody {
|
|
|
|
|
pub struct Output {
|
|
|
|
|
pub output: String,
|
|
|
|
|
pub category: Option<String>,
|
|
|
|
|
pub group: Option<String>,
|
|
|
|
@ -313,7 +380,7 @@ pub struct OutputEventBody {
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct StoppedEventBody {
|
|
|
|
|
pub struct Stopped {
|
|
|
|
|
pub reason: String,
|
|
|
|
|
pub description: Option<String>,
|
|
|
|
|
pub thread_id: Option<usize>,
|
|
|
|
@ -322,3 +389,4 @@ pub struct StoppedEventBody {
|
|
|
|
|
pub all_threads_stopped: Option<bool>,
|
|
|
|
|
pub hit_breakpoint_ids: Option<Vec<usize>>,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|