ruby-dap 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +17 -3
- data/lib/dap.rb +4 -0
- data/lib/dap/attach_request_arguments.rb +2 -0
- data/lib/dap/base.rb +57 -6
- data/lib/dap/breakpoint.rb +11 -9
- data/lib/dap/breakpoint_event_body.rb +2 -1
- data/lib/dap/breakpoint_location.rb +6 -4
- data/lib/dap/breakpoint_locations_arguments.rb +5 -4
- data/lib/dap/breakpoint_locations_response_body.rb +2 -0
- data/lib/dap/cancel_arguments.rb +3 -2
- data/lib/dap/capabilities.rb +33 -32
- data/lib/dap/capabilities_event_body.rb +6 -0
- data/lib/dap/checksum.rb +2 -1
- data/lib/dap/checksum_algorithm.rb +1 -0
- data/lib/dap/column_descriptor.rb +8 -5
- data/lib/dap/completion_item.rb +8 -7
- data/lib/dap/completion_item_type.rb +2 -0
- data/lib/dap/completions_arguments.rb +5 -4
- data/lib/dap/completions_response_body.rb +1 -0
- data/lib/dap/continue_arguments.rb +2 -1
- data/lib/dap/continue_response_body.rb +2 -1
- data/lib/dap/continued_event_body.rb +7 -2
- data/lib/dap/data_breakpoint.rb +4 -3
- data/lib/dap/data_breakpoint_access_type.rb +1 -0
- data/lib/dap/data_breakpoint_info_arguments.rb +3 -2
- data/lib/dap/data_breakpoint_info_response_body.rb +3 -2
- data/lib/dap/disassemble_arguments.rb +6 -5
- data/lib/dap/disassemble_response_body.rb +1 -0
- data/lib/dap/disassembled_instruction.rb +9 -8
- data/lib/dap/disconnect_arguments.rb +3 -2
- data/lib/dap/encoding.rb +12 -1
- data/lib/dap/enum.rb +6 -0
- data/lib/dap/error_response_body.rb +1 -0
- data/lib/dap/evaluate_arguments.rb +4 -3
- data/lib/dap/evaluate_response_body.rb +7 -6
- data/lib/dap/event.rb +7 -0
- data/lib/dap/exception_break_mode.rb +6 -0
- data/lib/dap/exception_breakpoints_filter.rb +5 -3
- data/lib/dap/exception_details.rb +6 -5
- data/lib/dap/exception_info_arguments.rb +2 -1
- data/lib/dap/exception_info_response_body.rb +3 -2
- data/lib/dap/exception_options.rb +1 -0
- data/lib/dap/exception_path_segment.rb +6 -2
- data/lib/dap/exited_event_body.rb +2 -1
- data/lib/dap/function_breakpoint.rb +4 -3
- data/lib/dap/goto_arguments.rb +3 -2
- data/lib/dap/goto_target.rb +10 -7
- data/lib/dap/goto_targets_arguments.rb +3 -2
- data/lib/dap/goto_targets_response_body.rb +1 -0
- data/lib/dap/initialize_request_arguments.rb +14 -13
- data/lib/dap/instruction_breakpoint.rb +5 -4
- data/lib/dap/invalidated_event_body.rb +11 -3
- data/lib/dap/launch_request_arguments.rb +3 -1
- data/lib/dap/loaded_source_event_body.rb +3 -1
- data/lib/dap/loaded_sources_response_body.rb +1 -0
- data/lib/dap/message.rb +8 -7
- data/lib/dap/module.rb +17 -8
- data/lib/dap/module_event_body.rb +2 -1
- data/lib/dap/modules_arguments.rb +3 -2
- data/lib/dap/modules_response_body.rb +2 -1
- data/lib/dap/next_arguments.rb +2 -1
- data/lib/dap/output_event_body.rb +7 -6
- data/lib/dap/pause_arguments.rb +2 -1
- data/lib/dap/process_event_body.rb +7 -5
- data/lib/dap/progress_end_event_body.rb +5 -2
- data/lib/dap/progress_start_event_body.rb +12 -6
- data/lib/dap/progress_update_event_body.rb +9 -3
- data/lib/dap/protocol_message.rb +12 -1
- data/lib/dap/read_memory_arguments.rb +4 -3
- data/lib/dap/read_memory_response_body.rb +4 -3
- data/lib/dap/relation.rb +17 -1
- data/lib/dap/request.rb +7 -0
- data/lib/dap/response.rb +22 -1
- data/lib/dap/restart_frame_arguments.rb +2 -1
- data/lib/dap/reverse_continue_arguments.rb +2 -1
- data/lib/dap/run_in_terminal_request_arguments.rb +6 -5
- data/lib/dap/run_in_terminal_response_body.rb +3 -2
- data/lib/dap/scope.rb +12 -10
- data/lib/dap/scopes_arguments.rb +2 -1
- data/lib/dap/scopes_response_body.rb +1 -0
- data/lib/dap/set_breakpoints_arguments.rb +3 -2
- data/lib/dap/set_breakpoints_response_body.rb +5 -0
- data/lib/dap/set_data_breakpoints_arguments.rb +1 -0
- data/lib/dap/set_data_breakpoints_response_body.rb +2 -0
- data/lib/dap/set_exception_breakpoints_arguments.rb +2 -1
- data/lib/dap/set_expression_arguments.rb +4 -3
- data/lib/dap/set_expression_response_body.rb +6 -5
- data/lib/dap/set_function_breakpoints_arguments.rb +1 -0
- data/lib/dap/set_function_breakpoints_response_body.rb +2 -0
- data/lib/dap/set_instruction_breakpoints_arguments.rb +1 -0
- data/lib/dap/set_instruction_breakpoints_response_body.rb +1 -0
- data/lib/dap/set_variable_arguments.rb +4 -3
- data/lib/dap/set_variable_response_body.rb +6 -5
- data/lib/dap/source.rb +7 -5
- data/lib/dap/source_arguments.rb +2 -1
- data/lib/dap/source_breakpoint.rb +6 -5
- data/lib/dap/source_response_body.rb +3 -2
- data/lib/dap/stack_frame.rb +9 -8
- data/lib/dap/stack_frame_format.rb +8 -7
- data/lib/dap/stack_trace_arguments.rb +4 -3
- data/lib/dap/stack_trace_response_body.rb +2 -1
- data/lib/dap/step_back_arguments.rb +2 -1
- data/lib/dap/step_in_arguments.rb +3 -2
- data/lib/dap/step_in_target.rb +4 -2
- data/lib/dap/step_in_targets_arguments.rb +2 -1
- data/lib/dap/step_in_targets_response_body.rb +1 -0
- data/lib/dap/step_out_arguments.rb +2 -1
- data/lib/dap/stepping_granularity.rb +10 -0
- data/lib/dap/stopped_event_body.rb +9 -6
- data/lib/dap/terminate_arguments.rb +2 -1
- data/lib/dap/terminate_threads_arguments.rb +2 -1
- data/lib/dap/terminated_event_body.rb +2 -0
- data/lib/dap/thread.rb +3 -2
- data/lib/dap/thread_event_body.rb +3 -2
- data/lib/dap/threads_response_body.rb +1 -0
- data/lib/dap/value_format.rb +2 -1
- data/lib/dap/variable.rb +17 -8
- data/lib/dap/variable_presentation_hint.rb +5 -3
- data/lib/dap/variables_arguments.rb +5 -4
- data/lib/dap/variables_response_body.rb +1 -0
- metadata +2 -2
@@ -1,7 +1,8 @@
|
|
1
|
+
# Arguments for ‘modules’ request.
|
1
2
|
class DAP::ModulesArguments < DAP::Base
|
2
3
|
# The index of the first module to return; if omitted modules start at 0.
|
3
|
-
property :startModule, required: false
|
4
|
+
property :startModule, required: false, as: 'number'
|
4
5
|
|
5
6
|
# The number of modules to return. If moduleCount is not specified or 0, all modules are returned.
|
6
|
-
property :moduleCount, required: false
|
7
|
+
property :moduleCount, required: false, as: 'number'
|
7
8
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
require_relative 'module'
|
2
2
|
|
3
|
+
# Response to ‘modules’ request.
|
3
4
|
class DAP::ModulesResponseBody < DAP::Base
|
4
5
|
# All modules or range of modules.
|
5
6
|
property :modules, as: many(DAP::Module)
|
6
7
|
|
7
8
|
# The total number of modules available.
|
8
|
-
property :totalModules, required: false
|
9
|
+
property :totalModules, required: false, as: 'number'
|
9
10
|
end
|
data/lib/dap/next_arguments.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require_relative 'stepping_granularity'
|
2
2
|
|
3
|
+
# Arguments for ‘next’ request.
|
3
4
|
class DAP::NextArguments < DAP::Base
|
4
5
|
# Execute 'next' for this thread.
|
5
|
-
property :threadId
|
6
|
+
property :threadId, as: 'number'
|
6
7
|
|
7
8
|
# Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed.
|
8
9
|
property :granularity, required: false, as: DAP::SteppingGranularity
|
@@ -1,12 +1,13 @@
|
|
1
1
|
require_relative 'source'
|
2
2
|
|
3
|
+
# The event indicates that the target has produced some output.
|
3
4
|
class DAP::OutputEventBody < DAP::Base
|
4
5
|
# The output category. If not specified, 'console' is assumed.
|
5
6
|
# Values: 'console', 'stdout', 'stderr', 'telemetry', etc.
|
6
|
-
property :category, required: false
|
7
|
+
property :category, required: false, as: 'string'
|
7
8
|
|
8
9
|
# The output to report.
|
9
|
-
property :output
|
10
|
+
property :output, as: 'string'
|
10
11
|
|
11
12
|
# Support for keeping an output log organized by grouping related messages.
|
12
13
|
# Values:
|
@@ -17,19 +18,19 @@ class DAP::OutputEventBody < DAP::Base
|
|
17
18
|
# 'end': End the current group and decreases the indentation of subsequent output events.
|
18
19
|
# A non empty 'output' attribute is shown as the unindented end of the group.
|
19
20
|
# etc.
|
20
|
-
property :group, required: false
|
21
|
+
property :group, required: false, as: 'string'
|
21
22
|
|
22
23
|
# If an attribute 'variablesReference' exists and its value is > 0, the output contains objects which can be retrieved by passing 'variablesReference' to the 'variables' request. The value should be less than or equal to 2147483647 (2^31 - 1).
|
23
|
-
property :variablesReference, required: false
|
24
|
+
property :variablesReference, required: false, as: 'number'
|
24
25
|
|
25
26
|
# An optional source location where the output was produced.
|
26
27
|
property :source, required: false, as: DAP::Source
|
27
28
|
|
28
29
|
# An optional source location line where the output was produced.
|
29
|
-
property :line, required: false
|
30
|
+
property :line, required: false, as: 'number'
|
30
31
|
|
31
32
|
# An optional source location column where the output was produced.
|
32
|
-
property :column, required: false
|
33
|
+
property :column, required: false, as: 'number'
|
33
34
|
|
34
35
|
# Optional data to report. For the 'telemetry' category the data will be sent to telemetry, for the other categories the data is shown in JSON format.
|
35
36
|
property :data, required: false
|
data/lib/dap/pause_arguments.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
+
# The event indicates that the debugger has begun debugging a new process. Either
|
2
|
+
# one that it has launched, or one that it has attached to.
|
1
3
|
class DAP::ProcessEventBody < DAP::Base
|
2
4
|
# The logical name of the process. This is usually the full path to process's executable file. Example: /home/example/myproj/program.js.
|
3
|
-
property :name
|
5
|
+
property :name, as: 'string'
|
4
6
|
|
5
7
|
# The system process id of the debugged process. This property will be missing for non-system processes.
|
6
|
-
property :systemProcessId, required: false
|
8
|
+
property :systemProcessId, required: false, as: 'number'
|
7
9
|
|
8
10
|
# If true, the process is running on the same computer as the debug adapter.
|
9
|
-
property :isLocalProcess, required: false
|
11
|
+
property :isLocalProcess, required: false, as: 'boolean'
|
10
12
|
|
11
13
|
# Describes how the debug engine started debugging this process.
|
12
14
|
# Values:
|
@@ -14,8 +16,8 @@ class DAP::ProcessEventBody < DAP::Base
|
|
14
16
|
# 'attach': Debugger attached to an existing process.
|
15
17
|
# 'attachForSuspendedLaunch': A project launcher component has launched a new process in a suspended state and then asked the debugger to attach.
|
16
18
|
# etc.
|
17
|
-
property :startMethod, required: false
|
19
|
+
property :startMethod, required: false, as: 'string'
|
18
20
|
|
19
21
|
# The size of a pointer or address for this process, in bits. This value may be used by clients when formatting addresses for display.
|
20
|
-
property :pointerSize, required: false
|
22
|
+
property :pointerSize, required: false, as: 'number'
|
21
23
|
end
|
@@ -1,7 +1,10 @@
|
|
1
|
+
# The event signals the end of the progress reporting with an optional final
|
2
|
+
# message. This event should only be sent if the client has passed the value true
|
3
|
+
# for the ‘supportsProgressReporting’ capability of the ‘initialize’ request.
|
1
4
|
class DAP::ProgressEndEventBody < DAP::Base
|
2
5
|
# The ID that was introduced in the initial 'ProgressStartEvent'.
|
3
|
-
property :progressId
|
6
|
+
property :progressId, as: 'string'
|
4
7
|
|
5
8
|
# Optional, more detailed progress message. If omitted, the previous message (if any) is used.
|
6
|
-
property :message, required: false
|
9
|
+
property :message, required: false, as: 'string'
|
7
10
|
end
|
@@ -1,24 +1,30 @@
|
|
1
|
+
# The event signals that a long running operation is about to start and provides
|
2
|
+
# additional information for the client to set up a corresponding progress and
|
3
|
+
# cancellation UI. The client is free to delay the showing of the UI in order to
|
4
|
+
# reduce flicker. This event should only be sent if the client has passed the
|
5
|
+
# value true for the ‘supportsProgressReporting’ capability of the ‘initialize’
|
6
|
+
# request.
|
1
7
|
class DAP::ProgressStartEventBody < DAP::Base
|
2
8
|
# An ID that must be used in subsequent 'progressUpdate' and 'progressEnd' events to make them refer to the same progress reporting.
|
3
9
|
# IDs must be unique within a debug session.
|
4
|
-
property :progressId
|
10
|
+
property :progressId, as: 'string'
|
5
11
|
|
6
12
|
# Mandatory (short) title of the progress reporting. Shown in the UI to describe the long running operation.
|
7
|
-
property :title
|
13
|
+
property :title, as: 'string'
|
8
14
|
|
9
15
|
# The request ID that this progress report is related to. If specified a debug adapter is expected to emit
|
10
16
|
# progress events for the long running request until the request has been either completed or cancelled.
|
11
17
|
# If the request ID is omitted, the progress report is assumed to be related to some general activity of the debug adapter.
|
12
|
-
property :requestId, required: false
|
18
|
+
property :requestId, required: false, as: 'number'
|
13
19
|
|
14
20
|
# If true, the request that reports progress may be canceled with a 'cancel' request.
|
15
21
|
# So this property basically controls whether the client should use UX that supports cancellation.
|
16
22
|
# Clients that don't support cancellation are allowed to ignore the setting.
|
17
|
-
property :cancellable, required: false
|
23
|
+
property :cancellable, required: false, as: 'boolean'
|
18
24
|
|
19
25
|
# Optional, more detailed progress message.
|
20
|
-
property :message, required: false
|
26
|
+
property :message, required: false, as: 'string'
|
21
27
|
|
22
28
|
# Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown.
|
23
|
-
property :percentage, required: false
|
29
|
+
property :percentage, required: false, as: 'number'
|
24
30
|
end
|
@@ -1,10 +1,16 @@
|
|
1
|
+
# The event signals that the progress reporting needs to updated with a new
|
2
|
+
# message and/or percentage. The client does not have to update the UI
|
3
|
+
# immediately, but the clients needs to keep track of the message and/or
|
4
|
+
# percentage values. This event should only be sent if the client has passed the
|
5
|
+
# value true for the ‘supportsProgressReporting’ capability of the ‘initialize’
|
6
|
+
# request.
|
1
7
|
class DAP::ProgressUpdateEventBody < DAP::Base
|
2
8
|
# The ID that was introduced in the initial 'progressStart' event.
|
3
|
-
property :progressId
|
9
|
+
property :progressId, as: 'string'
|
4
10
|
|
5
11
|
# Optional, more detailed progress message. If omitted, the previous message (if any) is used.
|
6
|
-
property :message, required: false
|
12
|
+
property :message, required: false, as: 'string'
|
7
13
|
|
8
14
|
# Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown.
|
9
|
-
property :percentage, required: false
|
15
|
+
property :percentage, required: false, as: 'number'
|
10
16
|
end
|
data/lib/dap/protocol_message.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
+
# Base class of requests, responses, and events.
|
1
2
|
class DAP::ProtocolMessage < DAP::Base
|
3
|
+
# Valid protocol message types.
|
4
|
+
# @return [Hash<Symbol,Class>]
|
2
5
|
def self.types
|
3
6
|
@types ||= {
|
4
7
|
request: DAP::Request,
|
@@ -7,6 +10,8 @@ class DAP::ProtocolMessage < DAP::Base
|
|
7
10
|
}
|
8
11
|
end
|
9
12
|
|
13
|
+
# Create a protocol message from attribute values.
|
14
|
+
# @param values [Hash] the attribute values
|
10
15
|
def self.from(values)
|
11
16
|
build(values) do |v|
|
12
17
|
key = v[:type]&.to_sym
|
@@ -17,8 +22,14 @@ class DAP::ProtocolMessage < DAP::Base
|
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
20
|
-
|
25
|
+
# Sequence number (also known as message ID). For protocol messages of type
|
26
|
+
# 'request' this ID can be used to cancel the request.
|
27
|
+
property :seq, as: 'number'
|
21
28
|
|
29
|
+
# Message type.
|
30
|
+
property :type, as: 'string'
|
31
|
+
|
32
|
+
# (see Base#initialize)
|
22
33
|
def initialize(values)
|
23
34
|
super(values)
|
24
35
|
@seq = values[:seq] || DAP::ProtocolMessage.seq
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# Arguments for ‘readMemory’ request.
|
1
2
|
class DAP::ReadMemoryArguments < DAP::Base
|
2
3
|
# Memory reference to the base location from which data should be read.
|
3
|
-
property :memoryReference
|
4
|
+
property :memoryReference, as: 'string'
|
4
5
|
|
5
6
|
# Optional offset (in bytes) to be applied to the reference location before reading data. Can be negative.
|
6
|
-
property :offset, required: false
|
7
|
+
property :offset, required: false, as: 'number'
|
7
8
|
|
8
9
|
# Number of bytes to read at the specified location and offset.
|
9
|
-
property :count
|
10
|
+
property :count, as: 'number'
|
10
11
|
end
|
@@ -1,12 +1,13 @@
|
|
1
|
+
# Response to ‘readMemory’ request.
|
1
2
|
class DAP::ReadMemoryResponseBody < DAP::Base
|
2
3
|
# The address of the first byte of data returned.
|
3
4
|
# Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
|
4
|
-
property :address
|
5
|
+
property :address, as: 'string'
|
5
6
|
|
6
7
|
# The number of unreadable bytes encountered after the last successfully read byte.
|
7
8
|
# This can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed.
|
8
|
-
property :unreadableBytes, required: false
|
9
|
+
property :unreadableBytes, required: false, as: 'number'
|
9
10
|
|
10
11
|
# The bytes read from memory, encoded using base64.
|
11
|
-
property :data, required: false
|
12
|
+
property :data, required: false, as: 'string'
|
12
13
|
end
|
data/lib/dap/relation.rb
CHANGED
@@ -1,31 +1,47 @@
|
|
1
|
+
# Relationships between DAP types
|
1
2
|
module DAP::Relation
|
3
|
+
# Raises an error if `klazz` is not an allowed DAP type
|
2
4
|
def self.supported!(klazz)
|
3
5
|
raise "Unsupported property class #{klazz}" unless klazz < DAP::Base || klazz < DAP::Enum
|
4
6
|
end
|
5
7
|
|
8
|
+
# Indicates a property is expected to be an array of the specified type
|
6
9
|
class Many
|
10
|
+
# The expected element type.
|
7
11
|
attr_reader :klazz
|
8
12
|
|
13
|
+
# @param klazz [Class] the expected element type
|
9
14
|
def initialize(klazz)
|
10
15
|
DAP::Relation.supported!(klazz)
|
11
16
|
@klazz = klazz
|
12
17
|
end
|
13
18
|
end
|
14
19
|
|
20
|
+
# Indicates a property is expected to be one of a set of types
|
15
21
|
class OneOf
|
16
|
-
|
22
|
+
# The allowed key property values and expected types.
|
23
|
+
attr_reader :types
|
17
24
|
|
25
|
+
# The name of the key property.
|
26
|
+
attr_reader :key
|
27
|
+
|
28
|
+
# @param types [Hash<Symbol, Class>] the allowed key property values and expected types
|
18
29
|
def initialize(types)
|
19
30
|
types.values.each { |k| DAP::Relation.supported!(k) }
|
20
31
|
@types = types
|
21
32
|
end
|
22
33
|
|
34
|
+
# Specifies the key property that is used to determine which type is selected.
|
35
|
+
# @param key [Symbol] the name of the key property
|
23
36
|
def with(key)
|
24
37
|
o = dup
|
25
38
|
o.instance_eval { @key = key }
|
26
39
|
o
|
27
40
|
end
|
28
41
|
|
42
|
+
# Sets the expected type for a specified value of the key property.
|
43
|
+
# @param k [Symbol] the specified value
|
44
|
+
# @param v [Class] the expected type
|
29
45
|
def []=(k, v)
|
30
46
|
@types[k] = v
|
31
47
|
end
|
data/lib/dap/request.rb
CHANGED
@@ -37,11 +37,15 @@ require_relative 'exception_info_arguments'
|
|
37
37
|
require_relative 'read_memory_arguments'
|
38
38
|
require_relative 'disassemble_arguments'
|
39
39
|
|
40
|
+
# A client or debug adapter initiated request.
|
40
41
|
class DAP::Request < DAP::ProtocolMessage
|
42
|
+
# (see ProtocolMessage#type)
|
41
43
|
def self.type
|
42
44
|
'request'
|
43
45
|
end
|
44
46
|
|
47
|
+
# Allowed request commands and their arguments types.
|
48
|
+
# @return [Hash<Symbol, Class>]
|
45
49
|
def self.arguments
|
46
50
|
@arguments ||= one_of(
|
47
51
|
cancel: DAP::CancelArguments,
|
@@ -89,6 +93,9 @@ class DAP::Request < DAP::ProtocolMessage
|
|
89
93
|
)
|
90
94
|
end
|
91
95
|
|
96
|
+
# The command to execute.
|
92
97
|
property :command
|
98
|
+
|
99
|
+
# Object containing arguments for the command.
|
93
100
|
property :arguments, as: arguments.with(:command)
|
94
101
|
end
|
data/lib/dap/response.rb
CHANGED
@@ -25,11 +25,15 @@ require_relative 'exception_info_response_body'
|
|
25
25
|
require_relative 'read_memory_response_body'
|
26
26
|
require_relative 'disassemble_response_body'
|
27
27
|
|
28
|
+
# Response for a request.
|
28
29
|
class DAP::Response < DAP::ProtocolMessage
|
30
|
+
# (see ProtocolMessage#type)
|
29
31
|
def self.type
|
30
32
|
'response'
|
31
33
|
end
|
32
34
|
|
35
|
+
# Allowed response commands and their body types.
|
36
|
+
# @return [Hash<Symbol, Class>]
|
33
37
|
def self.bodies
|
34
38
|
@bodies ||= one_of(
|
35
39
|
initialize: DAP::Capabilities,
|
@@ -78,12 +82,29 @@ class DAP::Response < DAP::ProtocolMessage
|
|
78
82
|
)
|
79
83
|
end
|
80
84
|
|
85
|
+
# (see Base#validate!)
|
81
86
|
def validate!
|
82
87
|
return unless success
|
83
88
|
|
84
89
|
super
|
85
90
|
end
|
86
91
|
|
87
|
-
|
92
|
+
# Sequence number of the corresponding request.
|
93
|
+
property :request_seq
|
94
|
+
|
95
|
+
# Outcome of the request.
|
96
|
+
# If true, the request was successful and the 'body' attribute may contain the result of the request.
|
97
|
+
# If the value is false, the attribute 'message' contains the error in short form and the 'body' may contain additional information (see 'ErrorResponse.body.error').
|
98
|
+
property :success
|
99
|
+
|
100
|
+
# The command requested.
|
101
|
+
property :command
|
102
|
+
|
103
|
+
# Contains the raw error in short form if 'success' is false.
|
104
|
+
# This raw error might be interpreted by the frontend and is not shown in the UI.
|
105
|
+
# Some predefined values exist.
|
106
|
+
property :message
|
107
|
+
|
108
|
+
# Contains request result if success is true and optional error details if success is false.
|
88
109
|
property :body, as: bodies.with(:command)
|
89
110
|
end
|
@@ -1,17 +1,18 @@
|
|
1
|
+
# Arguments for ‘runInTerminal’ request.
|
1
2
|
class DAP::RunInTerminalRequestArguments < DAP::Base
|
2
3
|
# What kind of terminal to launch.
|
3
4
|
# Values: 'integrated', 'external', etc.
|
4
|
-
property :kind, required: false
|
5
|
+
property :kind, required: false, as: 'string'
|
5
6
|
|
6
7
|
# Optional title of the terminal.
|
7
|
-
property :title, required: false
|
8
|
+
property :title, required: false, as: 'string'
|
8
9
|
|
9
10
|
# Working directory of the command.
|
10
|
-
property :cwd
|
11
|
+
property :cwd, as: 'string'
|
11
12
|
|
12
13
|
# List of arguments. The first argument is the command to run.
|
13
|
-
property :args
|
14
|
+
property :args, as: 'string[]'
|
14
15
|
|
15
16
|
# Environment key-value pairs that are added to or removed from the default environment.
|
16
|
-
property :env, required: false
|
17
|
+
property :env, required: false
|
17
18
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# Response to ‘runInTerminal’ request.
|
1
2
|
class DAP::RunInTerminalResponseBody < DAP::Base
|
2
3
|
# The process ID. The value should be less than or equal to 2147483647 (2^31 - 1).
|
3
|
-
property :processId, required: false
|
4
|
+
property :processId, required: false, as: 'number'
|
4
5
|
|
5
6
|
# The process ID of the terminal shell. The value should be less than or equal to 2147483647 (2^31 - 1).
|
6
|
-
property :shellProcessId, required: false
|
7
|
+
property :shellProcessId, required: false, as: 'number'
|
7
8
|
end
|
data/lib/dap/scope.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require_relative 'source'
|
2
2
|
|
3
|
+
# A Scope is a named container for variables. Optionally a scope can map to a
|
4
|
+
# source or a range within a source.
|
3
5
|
class DAP::Scope < DAP::Base
|
4
6
|
# Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated.
|
5
|
-
property :name
|
7
|
+
property :name, as: 'string'
|
6
8
|
|
7
9
|
# 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.
|
8
10
|
# Values:
|
@@ -10,34 +12,34 @@ class DAP::Scope < DAP::Base
|
|
10
12
|
# 'locals': Scope contains local variables.
|
11
13
|
# 'registers': Scope contains registers. Only a single 'registers' scope should be returned from a 'scopes' request.
|
12
14
|
# etc.
|
13
|
-
property :presentationHint, required: false
|
15
|
+
property :presentationHint, required: false, as: 'string'
|
14
16
|
|
15
17
|
# The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest.
|
16
|
-
property :variablesReference
|
18
|
+
property :variablesReference, as: 'number'
|
17
19
|
|
18
20
|
# The number of named variables in this scope.
|
19
21
|
# The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
|
20
|
-
property :namedVariables, required: false
|
22
|
+
property :namedVariables, required: false, as: 'number'
|
21
23
|
|
22
24
|
# The number of indexed variables in this scope.
|
23
25
|
# The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
|
24
|
-
property :indexedVariables, required: false
|
26
|
+
property :indexedVariables, required: false, as: 'number'
|
25
27
|
|
26
28
|
# If true, the number of variables in this scope is large or expensive to retrieve.
|
27
|
-
property :expensive
|
29
|
+
property :expensive, as: 'boolean'
|
28
30
|
|
29
31
|
# Optional source for this scope.
|
30
32
|
property :source, required: false, as: DAP::Source
|
31
33
|
|
32
34
|
# Optional start line of the range covered by this scope.
|
33
|
-
property :line, required: false
|
35
|
+
property :line, required: false, as: 'number'
|
34
36
|
|
35
37
|
# Optional start column of the range covered by this scope.
|
36
|
-
property :column, required: false
|
38
|
+
property :column, required: false, as: 'number'
|
37
39
|
|
38
40
|
# Optional end line of the range covered by this scope.
|
39
|
-
property :endLine, required: false
|
41
|
+
property :endLine, required: false, as: 'number'
|
40
42
|
|
41
43
|
# Optional end column of the range covered by this scope.
|
42
|
-
property :endColumn, required: false
|
44
|
+
property :endColumn, required: false, as: 'number'
|
43
45
|
end
|