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,5 +1,11 @@
|
|
1
1
|
require_relative 'capabilities'
|
2
2
|
|
3
|
+
# The event indicates that one or more capabilities have changed. Since the
|
4
|
+
# capabilities are dependent on the frontend and its UI, it might not be possible
|
5
|
+
# to change that at random times (or too late). Consequently this event has a hint
|
6
|
+
# characteristic: a frontend can only be expected to make a ‘best effort’ in
|
7
|
+
# honouring individual capabilities but there are no guarantees. Only changed
|
8
|
+
# capabilities need to be included, all other capabilities keep their values.
|
3
9
|
class DAP::CapabilitiesEventBody < DAP::Base
|
4
10
|
# The set of updated capabilities.
|
5
11
|
property :capabilities, as: DAP::Capabilities
|
data/lib/dap/checksum.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require_relative 'checksum_algorithm'
|
2
2
|
|
3
|
+
# The checksum of an item calculated by the specified algorithm.
|
3
4
|
class DAP::Checksum < DAP::Base
|
4
5
|
# The algorithm used to calculate this checksum.
|
5
6
|
property :algorithm, as: DAP::ChecksumAlgorithm
|
6
7
|
|
7
8
|
# Value of the checksum.
|
8
|
-
property :checksum
|
9
|
+
property :checksum, as: 'string'
|
9
10
|
end
|
@@ -1,17 +1,20 @@
|
|
1
|
+
# A ColumnDescriptor specifies what module attribute to show in a column of the
|
2
|
+
# ModulesView, how to format it, and what the column’s label should be. It is only
|
3
|
+
# used if the underlying UI actually supports this level of customization.
|
1
4
|
class DAP::ColumnDescriptor < DAP::Base
|
2
5
|
# Name of the attribute rendered in this column.
|
3
|
-
property :attributeName
|
6
|
+
property :attributeName, as: 'string'
|
4
7
|
|
5
8
|
# Header UI label of column.
|
6
|
-
property :label
|
9
|
+
property :label, as: 'string'
|
7
10
|
|
8
11
|
# Format to use for the rendered values in this column. TBD how the format strings looks like.
|
9
|
-
property :format, required: false
|
12
|
+
property :format, required: false, as: 'string'
|
10
13
|
|
11
14
|
# Datatype of values in this column. Defaults to 'string' if not specified.
|
12
15
|
# Values: 'string', 'number', 'boolean', 'unixTimestampUTC', etc.
|
13
|
-
property :type, required: false
|
16
|
+
property :type, required: false, as: 'string'
|
14
17
|
|
15
18
|
# Width of this column in characters (hint only).
|
16
|
-
property :width, required: false
|
19
|
+
property :width, required: false, as: 'number'
|
17
20
|
end
|
data/lib/dap/completion_item.rb
CHANGED
@@ -1,33 +1,34 @@
|
|
1
1
|
require_relative 'completion_item_type'
|
2
2
|
|
3
|
+
# CompletionItems are the suggestions returned from the CompletionsRequest.
|
3
4
|
class DAP::CompletionItem < DAP::Base
|
4
5
|
# The label of this completion item. By default this is also the text that is inserted when selecting this completion.
|
5
|
-
property :label
|
6
|
+
property :label, as: 'string'
|
6
7
|
|
7
8
|
# If text is not falsy then it is inserted instead of the label.
|
8
|
-
property :text, required: false
|
9
|
+
property :text, required: false, as: 'string'
|
9
10
|
|
10
11
|
# A string that should be used when comparing this item with other items. When `falsy` the label is used.
|
11
|
-
property :sortText, required: false
|
12
|
+
property :sortText, required: false, as: 'string'
|
12
13
|
|
13
14
|
# The item's type. Typically the client uses this information to render the item in the UI with an icon.
|
14
15
|
property :type, required: false, as: DAP::CompletionItemType
|
15
16
|
|
16
17
|
# This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added.
|
17
18
|
# If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute.
|
18
|
-
property :start, required: false
|
19
|
+
property :start, required: false, as: 'number'
|
19
20
|
|
20
21
|
# This value determines how many characters are overwritten by the completion text.
|
21
22
|
# If missing the value 0 is assumed which results in the completion text being inserted.
|
22
|
-
property :length, required: false
|
23
|
+
property :length, required: false, as: 'number'
|
23
24
|
|
24
25
|
# Determines the start of the new selection after the text has been inserted (or replaced).
|
25
26
|
# The start position must in the range 0 and length of the completion text.
|
26
27
|
# If omitted the selection starts at the end of the completion text.
|
27
|
-
property :selectionStart, required: false
|
28
|
+
property :selectionStart, required: false, as: 'number'
|
28
29
|
|
29
30
|
# Determines the length of the new selection after the text has been inserted (or replaced).
|
30
31
|
# The selection can not extend beyond the bounds of the completion text.
|
31
32
|
# If omitted the length is assumed to be 0.
|
32
|
-
property :selectionLength, required: false
|
33
|
+
property :selectionLength, required: false, as: 'number'
|
33
34
|
end
|
@@ -1,13 +1,14 @@
|
|
1
|
+
# Arguments for ‘completions’ request.
|
1
2
|
class DAP::CompletionsArguments < DAP::Base
|
2
3
|
# Returns completions in the scope of this stack frame. If not specified, the completions are returned for the global scope.
|
3
|
-
property :frameId, required: false
|
4
|
+
property :frameId, required: false, as: 'number'
|
4
5
|
|
5
6
|
# One or more source lines. Typically this is the text a user has typed into the debug console before he asked for completion.
|
6
|
-
property :text
|
7
|
+
property :text, as: 'string'
|
7
8
|
|
8
9
|
# The character position for which to determine the completion proposals.
|
9
|
-
property :column
|
10
|
+
property :column, as: 'number'
|
10
11
|
|
11
12
|
# An optional line for which to determine the completion proposals. If missing the first line of the text is assumed.
|
12
|
-
property :line, required: false
|
13
|
+
property :line, required: false, as: 'number'
|
13
14
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
+
# Arguments for ‘continue’ request.
|
1
2
|
class DAP::ContinueArguments < DAP::Base
|
2
3
|
# Continue execution for the specified thread (if possible).
|
3
4
|
# If the backend cannot continue on a single thread but will continue on all threads, it should set the 'allThreadsContinued' attribute in the response to true.
|
4
|
-
property :threadId
|
5
|
+
property :threadId, as: 'number'
|
5
6
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
+
# Response to ‘continue’ request.
|
1
2
|
class DAP::ContinueResponseBody < DAP::Base
|
2
3
|
# If true, the 'continue' request has ignored the specified thread and continued all threads instead.
|
3
4
|
# If this attribute is missing a value of 'true' is assumed for backward compatibility.
|
4
|
-
property :allThreadsContinued, required: false
|
5
|
+
property :allThreadsContinued, required: false, as: 'boolean'
|
5
6
|
end
|
@@ -1,7 +1,12 @@
|
|
1
|
+
# The event indicates that the execution of the debuggee has continued. Please
|
2
|
+
# note: a debug adapter is not expected to send this event in response to a
|
3
|
+
# request that implies that execution continues, e.g. ‘launch’ or ‘continue’. It
|
4
|
+
# is only necessary to send a ‘continued’ event if there was no previous request
|
5
|
+
# that implied this.
|
1
6
|
class DAP::ContinuedEventBody < DAP::Base
|
2
7
|
# The thread which was continued.
|
3
|
-
property :threadId
|
8
|
+
property :threadId, as: 'number'
|
4
9
|
|
5
10
|
# If 'allThreadsContinued' is true, a debug adapter can announce that all threads have continued.
|
6
|
-
property :allThreadsContinued, required: false
|
11
|
+
property :allThreadsContinued, required: false, as: 'boolean'
|
7
12
|
end
|
data/lib/dap/data_breakpoint.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
require_relative 'data_breakpoint_access_type'
|
2
2
|
|
3
|
+
# Properties of a data breakpoint passed to the setDataBreakpoints request.
|
3
4
|
class DAP::DataBreakpoint < DAP::Base
|
4
5
|
# An id representing the data. This id is returned from the dataBreakpointInfo request.
|
5
|
-
property :dataId
|
6
|
+
property :dataId, as: 'string'
|
6
7
|
|
7
8
|
# The access type of the data.
|
8
9
|
property :accessType, required: false, as: DAP::DataBreakpointAccessType
|
9
10
|
|
10
11
|
# An optional expression for conditional breakpoints.
|
11
|
-
property :condition, required: false
|
12
|
+
property :condition, required: false, as: 'string'
|
12
13
|
|
13
14
|
# An optional expression that controls how many hits of the breakpoint are ignored.
|
14
15
|
# The backend is expected to interpret the expression as needed.
|
15
|
-
property :hitCondition, required: false
|
16
|
+
property :hitCondition, required: false, as: 'string'
|
16
17
|
end
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# Arguments for ‘dataBreakpointInfo’ request.
|
1
2
|
class DAP::DataBreakpointInfoArguments < DAP::Base
|
2
3
|
# Reference to the Variable container if the data breakpoint is requested for a child of the container.
|
3
|
-
property :variablesReference, required: false
|
4
|
+
property :variablesReference, required: false, as: 'number'
|
4
5
|
|
5
6
|
# The name of the Variable's child to obtain data breakpoint information for.
|
6
7
|
# If variableReference isn’t provided, this can be an expression.
|
7
|
-
property :name
|
8
|
+
property :name, as: 'string'
|
8
9
|
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
require_relative 'data_breakpoint_access_type'
|
2
2
|
|
3
|
+
# Response to ‘dataBreakpointInfo’ request.
|
3
4
|
class DAP::DataBreakpointInfoResponseBody < DAP::Base
|
4
5
|
# An identifier for the data on which a data breakpoint can be registered with the setDataBreakpoints request or null if no data breakpoint is available.
|
5
6
|
property :dataId
|
6
7
|
|
7
8
|
# UI string that describes on what data the breakpoint is set on or why a data breakpoint is not available.
|
8
|
-
property :description
|
9
|
+
property :description, as: 'string'
|
9
10
|
|
10
11
|
# Optional attribute listing the available access types for a potential data breakpoint. A UI frontend could surface this information.
|
11
12
|
property :accessTypes, required: false, as: many(DAP::DataBreakpointAccessType)
|
12
13
|
|
13
14
|
# Optional attribute indicating that a potential data breakpoint could be persisted across sessions.
|
14
|
-
property :canPersist, required: false
|
15
|
+
property :canPersist, required: false, as: 'boolean'
|
15
16
|
end
|
@@ -1,17 +1,18 @@
|
|
1
|
+
# Arguments for ‘disassemble’ request.
|
1
2
|
class DAP::DisassembleArguments < DAP::Base
|
2
3
|
# Memory reference to the base location containing the instructions to disassemble.
|
3
|
-
property :memoryReference
|
4
|
+
property :memoryReference, as: 'string'
|
4
5
|
|
5
6
|
# Optional offset (in bytes) to be applied to the reference location before disassembling. Can be negative.
|
6
|
-
property :offset, required: false
|
7
|
+
property :offset, required: false, as: 'number'
|
7
8
|
|
8
9
|
# Optional offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative.
|
9
|
-
property :instructionOffset, required: false
|
10
|
+
property :instructionOffset, required: false, as: 'number'
|
10
11
|
|
11
12
|
# Number of instructions to disassemble starting at the specified location and offset.
|
12
13
|
# An adapter must return exactly this number of instructions - any unavailable instructions should be replaced with an implementation-defined 'invalid instruction' value.
|
13
|
-
property :instructionCount
|
14
|
+
property :instructionCount, as: 'number'
|
14
15
|
|
15
16
|
# If true, the adapter should attempt to resolve memory addresses and other values to symbolic names.
|
16
|
-
property :resolveSymbols, required: false
|
17
|
+
property :resolveSymbols, required: false, as: 'boolean'
|
17
18
|
end
|
@@ -1,17 +1,18 @@
|
|
1
1
|
require_relative 'source'
|
2
2
|
|
3
|
+
# Represents a single disassembled instruction.
|
3
4
|
class DAP::DisassembledInstruction < DAP::Base
|
4
5
|
# The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
|
5
|
-
property :address
|
6
|
+
property :address, as: 'string'
|
6
7
|
|
7
8
|
# Optional raw bytes representing the instruction and its operands, in an implementation-defined format.
|
8
|
-
property :instructionBytes, required: false
|
9
|
+
property :instructionBytes, required: false, as: 'string'
|
9
10
|
|
10
11
|
# Text representing the instruction and its operands, in an implementation-defined format.
|
11
|
-
property :instruction
|
12
|
+
property :instruction, as: 'string'
|
12
13
|
|
13
14
|
# Name of the symbol that corresponds with the location of this instruction, if any.
|
14
|
-
property :symbol, required: false
|
15
|
+
property :symbol, required: false, as: 'string'
|
15
16
|
|
16
17
|
# Source location that corresponds to this instruction, if any.
|
17
18
|
# Should always be set (if available) on the first instruction returned,
|
@@ -19,14 +20,14 @@ class DAP::DisassembledInstruction < DAP::Base
|
|
19
20
|
property :location, required: false, as: DAP::Source
|
20
21
|
|
21
22
|
# The line within the source location that corresponds to this instruction, if any.
|
22
|
-
property :line, required: false
|
23
|
+
property :line, required: false, as: 'number'
|
23
24
|
|
24
25
|
# The column within the line that corresponds to this instruction, if any.
|
25
|
-
property :column, required: false
|
26
|
+
property :column, required: false, as: 'number'
|
26
27
|
|
27
28
|
# The end line of the range that corresponds to this instruction, if any.
|
28
|
-
property :endLine, required: false
|
29
|
+
property :endLine, required: false, as: 'number'
|
29
30
|
|
30
31
|
# The end column of the range that corresponds to this instruction, if any.
|
31
|
-
property :endColumn, required: false
|
32
|
+
property :endColumn, required: false, as: 'number'
|
32
33
|
end
|
@@ -1,9 +1,10 @@
|
|
1
|
+
# Arguments for ‘disconnect’ request.
|
1
2
|
class DAP::DisconnectArguments < DAP::Base
|
2
3
|
# A value of true indicates that this 'disconnect' request is part of a restart sequence.
|
3
|
-
property :restart, required: false
|
4
|
+
property :restart, required: false, as: 'boolean'
|
4
5
|
|
5
6
|
# Indicates whether the debuggee should be terminated when the debugger is disconnected.
|
6
7
|
# If unspecified, the debug adapter is free to do whatever it thinks is best.
|
7
8
|
# The attribute is only honored by a debug adapter if the capability 'supportTerminateDebuggee' is true.
|
8
|
-
property :terminateDebuggee, required: false
|
9
|
+
property :terminateDebuggee, required: false, as: 'boolean'
|
9
10
|
end
|
data/lib/dap/encoding.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
# Encoding and decoding for DAP messages
|
1
2
|
module DAP::Encoding
|
3
|
+
# The name of the content length header.
|
2
4
|
CONTENT_LENGTH_HEADER = 'Content-Length'
|
3
5
|
|
6
|
+
# Decode a DAP message from the stream.
|
7
|
+
# @param s [IO] the stream
|
8
|
+
# @return [ProtocolMessage] the message
|
4
9
|
def self.decode(s)
|
5
10
|
headers = {}
|
6
11
|
|
@@ -28,17 +33,23 @@ module DAP::Encoding
|
|
28
33
|
DAP::ProtocolMessage.from(values)
|
29
34
|
end
|
30
35
|
|
36
|
+
# Encode a DAP message to a string.
|
37
|
+
# @param message [ProtocolMessage] the message
|
38
|
+
# @return [String] the encoded message
|
31
39
|
def self.encode(message)
|
32
40
|
raise "Body must be a protocol message" unless message.is_a? DAP::ProtocolMessage
|
33
41
|
|
34
42
|
headers = {}
|
35
43
|
|
36
44
|
body = JSON.dump(message.to_wire)
|
37
|
-
headers[CONTENT_LENGTH_HEADER] = body.
|
45
|
+
headers[CONTENT_LENGTH_HEADER] = body.bytesize
|
38
46
|
|
39
47
|
headers.map { |name, value| "#{name}: #{value}\r\n" }.join + "\r\n" + body
|
40
48
|
end
|
41
49
|
|
50
|
+
# Decode all DAP messages from the stream.
|
51
|
+
# @param s [IO] the stream
|
52
|
+
# @yield Invokes the block for each message
|
42
53
|
def self.decode_all(s)
|
43
54
|
loop do
|
44
55
|
yield decode(s)
|
data/lib/dap/enum.rb
CHANGED
@@ -1,12 +1,18 @@
|
|
1
|
+
# Base class for DAP enumerations
|
1
2
|
class DAP::Enum
|
3
|
+
# Retreive an enumeration instance by value.
|
4
|
+
# @param value [String] the enumeration string value
|
5
|
+
# @return [Enum] the enumeration instance
|
2
6
|
def self.from(value)
|
3
7
|
values[value]
|
4
8
|
end
|
5
9
|
|
10
|
+
# The enumeration string value
|
6
11
|
def to_s
|
7
12
|
@value
|
8
13
|
end
|
9
14
|
|
15
|
+
# The enumeration string value, suitable for encoding
|
10
16
|
def to_wire
|
11
17
|
@value
|
12
18
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require_relative 'value_format'
|
2
2
|
|
3
|
+
# Arguments for ‘evaluate’ request.
|
3
4
|
class DAP::EvaluateArguments < DAP::Base
|
4
5
|
# The expression to evaluate.
|
5
|
-
property :expression
|
6
|
+
property :expression, as: 'string'
|
6
7
|
|
7
8
|
# Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope.
|
8
|
-
property :frameId, required: false
|
9
|
+
property :frameId, required: false, as: 'number'
|
9
10
|
|
10
11
|
# The context in which the evaluate request is run.
|
11
12
|
# Values:
|
@@ -15,7 +16,7 @@ class DAP::EvaluateArguments < DAP::Base
|
|
15
16
|
# 'clipboard': evaluate is run to generate the value that will be stored in the clipboard.
|
16
17
|
# The attribute is only honored by a debug adapter if the capability 'supportsClipboardContext' is true.
|
17
18
|
# etc.
|
18
|
-
property :context, required: false
|
19
|
+
property :context, required: false, as: 'string'
|
19
20
|
|
20
21
|
# Specifies details on how to format the Evaluate result.
|
21
22
|
# The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true.
|
@@ -1,32 +1,33 @@
|
|
1
1
|
require_relative 'variable_presentation_hint'
|
2
2
|
|
3
|
+
# Response to ‘evaluate’ request.
|
3
4
|
class DAP::EvaluateResponseBody < DAP::Base
|
4
5
|
# The result of the evaluate request.
|
5
|
-
property :result
|
6
|
+
property :result, as: 'string'
|
6
7
|
|
7
8
|
# The optional type of the evaluate result.
|
8
9
|
# 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.
|
9
|
-
property :type, required: false
|
10
|
+
property :type, required: false, as: 'string'
|
10
11
|
|
11
12
|
# Properties of a evaluate result that can be used to determine how to render the result in the UI.
|
12
13
|
property :presentationHint, required: false, as: DAP::VariablePresentationHint
|
13
14
|
|
14
15
|
# If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.
|
15
16
|
# The value should be less than or equal to 2147483647 (2^31 - 1).
|
16
|
-
property :variablesReference
|
17
|
+
property :variablesReference, as: 'number'
|
17
18
|
|
18
19
|
# The number of named child variables.
|
19
20
|
# The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
|
20
21
|
# The value should be less than or equal to 2147483647 (2^31 - 1).
|
21
|
-
property :namedVariables, required: false
|
22
|
+
property :namedVariables, required: false, as: 'number'
|
22
23
|
|
23
24
|
# The number of indexed child variables.
|
24
25
|
# The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
|
25
26
|
# The value should be less than or equal to 2147483647 (2^31 - 1).
|
26
|
-
property :indexedVariables, required: false
|
27
|
+
property :indexedVariables, required: false, as: 'number'
|
27
28
|
|
28
29
|
# Optional memory reference to a location appropriate for this result.
|
29
30
|
# For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
|
30
31
|
# This attribute should be returned by a debug adapter if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request.
|
31
|
-
property :memoryReference, required: false
|
32
|
+
property :memoryReference, required: false, as: 'string'
|
32
33
|
end
|