| // Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| |
| // This code was auto-generated by tool/dap/generate_all.dart - do not hand-edit! |
| |
| import 'protocol_common.dart'; |
| import 'protocol_special.dart'; |
| |
| /// Arguments for 'attach' request. Additional attributes are implementation |
| /// specific. |
| class AttachRequestArguments extends RequestArguments { |
| /// Optional data from the previous, restarted session. |
| /// The data is sent as the 'restart' attribute of the 'terminated' event. |
| /// The client should leave the data intact. |
| final Object? restart; |
| |
| static AttachRequestArguments fromJson(Map<String, Object?> obj) => |
| AttachRequestArguments.fromMap(obj); |
| |
| AttachRequestArguments({ |
| this.restart, |
| }); |
| |
| AttachRequestArguments.fromMap(Map<String, Object?> obj) |
| : restart = obj['__restart']; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (restart != null) '__restart': restart, |
| }; |
| } |
| |
| /// Response to 'attach' request. This is just an acknowledgement, so no body |
| /// field is required. |
| class AttachResponse extends Response { |
| static AttachResponse fromJson(Map<String, Object?> obj) => |
| AttachResponse.fromMap(obj); |
| |
| AttachResponse({ |
| Object? body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| AttachResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Information about a Breakpoint created in setBreakpoints, |
| /// setFunctionBreakpoints, setInstructionBreakpoints, or setDataBreakpoints. |
| class Breakpoint { |
| /// An optional start column of the actual range covered by the breakpoint. |
| final int? column; |
| |
| /// An optional end column of the actual range covered by the breakpoint. |
| /// If no end line is given, then the end column is assumed to be in the start |
| /// line. |
| final int? endColumn; |
| |
| /// An optional end line of the actual range covered by the breakpoint. |
| final int? endLine; |
| |
| /// An optional identifier for the breakpoint. It is needed if breakpoint |
| /// events are used to update or remove breakpoints. |
| final int? id; |
| |
| /// An optional memory reference to where the breakpoint is set. |
| final String? instructionReference; |
| |
| /// The start line of the actual range covered by the breakpoint. |
| final int? line; |
| |
| /// An optional message about the state of the breakpoint. |
| /// This is shown to the user and can be used to explain why a breakpoint |
| /// could not be verified. |
| final String? message; |
| |
| /// An optional offset from the instruction reference. |
| /// This can be negative. |
| final int? offset; |
| |
| /// The source where the breakpoint is located. |
| final Source? source; |
| |
| /// If true breakpoint could be set (but not necessarily at the desired |
| /// location). |
| final bool verified; |
| |
| static Breakpoint fromJson(Map<String, Object?> obj) => |
| Breakpoint.fromMap(obj); |
| |
| Breakpoint({ |
| this.column, |
| this.endColumn, |
| this.endLine, |
| this.id, |
| this.instructionReference, |
| this.line, |
| this.message, |
| this.offset, |
| this.source, |
| required this.verified, |
| }); |
| |
| Breakpoint.fromMap(Map<String, Object?> obj) |
| : column = obj['column'] as int?, |
| endColumn = obj['endColumn'] as int?, |
| endLine = obj['endLine'] as int?, |
| id = obj['id'] as int?, |
| instructionReference = obj['instructionReference'] as String?, |
| line = obj['line'] as int?, |
| message = obj['message'] as String?, |
| offset = obj['offset'] as int?, |
| source = obj['source'] == null |
| ? null |
| : Source.fromJson(obj['source'] as Map<String, Object?>), |
| verified = obj['verified'] as bool; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['column'] is! int?) { |
| return false; |
| } |
| if (obj['endColumn'] is! int?) { |
| return false; |
| } |
| if (obj['endLine'] is! int?) { |
| return false; |
| } |
| if (obj['id'] is! int?) { |
| return false; |
| } |
| if (obj['instructionReference'] is! String?) { |
| return false; |
| } |
| if (obj['line'] is! int?) { |
| return false; |
| } |
| if (obj['message'] is! String?) { |
| return false; |
| } |
| if (obj['offset'] is! int?) { |
| return false; |
| } |
| if (!Source.canParse(obj['source'])) { |
| return false; |
| } |
| if (obj['verified'] is! bool) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (column != null) 'column': column, |
| if (endColumn != null) 'endColumn': endColumn, |
| if (endLine != null) 'endLine': endLine, |
| if (id != null) 'id': id, |
| if (instructionReference != null) |
| 'instructionReference': instructionReference, |
| if (line != null) 'line': line, |
| if (message != null) 'message': message, |
| if (offset != null) 'offset': offset, |
| if (source != null) 'source': source, |
| 'verified': verified, |
| }; |
| } |
| |
| /// Properties of a breakpoint location returned from the 'breakpointLocations' |
| /// request. |
| class BreakpointLocation { |
| /// Optional start column of breakpoint location. |
| final int? column; |
| |
| /// Optional end column of breakpoint location if the location covers a range. |
| final int? endColumn; |
| |
| /// Optional end line of breakpoint location if the location covers a range. |
| final int? endLine; |
| |
| /// Start line of breakpoint location. |
| final int line; |
| |
| static BreakpointLocation fromJson(Map<String, Object?> obj) => |
| BreakpointLocation.fromMap(obj); |
| |
| BreakpointLocation({ |
| this.column, |
| this.endColumn, |
| this.endLine, |
| required this.line, |
| }); |
| |
| BreakpointLocation.fromMap(Map<String, Object?> obj) |
| : column = obj['column'] as int?, |
| endColumn = obj['endColumn'] as int?, |
| endLine = obj['endLine'] as int?, |
| line = obj['line'] as int; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['column'] is! int?) { |
| return false; |
| } |
| if (obj['endColumn'] is! int?) { |
| return false; |
| } |
| if (obj['endLine'] is! int?) { |
| return false; |
| } |
| if (obj['line'] is! int) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (column != null) 'column': column, |
| if (endColumn != null) 'endColumn': endColumn, |
| if (endLine != null) 'endLine': endLine, |
| 'line': line, |
| }; |
| } |
| |
| /// Arguments for 'breakpointLocations' request. |
| class BreakpointLocationsArguments extends RequestArguments { |
| /// Optional start column of range to search possible breakpoint locations in. |
| /// If no start column is given, the first column in the start line is |
| /// assumed. |
| final int? column; |
| |
| /// Optional end column of range to search possible breakpoint locations in. |
| /// If no end column is given, then it is assumed to be in the last column of |
| /// the end line. |
| final int? endColumn; |
| |
| /// Optional end line of range to search possible breakpoint locations in. If |
| /// no end line is given, then the end line is assumed to be the start line. |
| final int? endLine; |
| |
| /// Start line of range to search possible breakpoint locations in. If only |
| /// the line is specified, the request returns all possible locations in that |
| /// line. |
| final int line; |
| |
| /// The source location of the breakpoints; either 'source.path' or |
| /// 'source.reference' must be specified. |
| final Source source; |
| |
| static BreakpointLocationsArguments fromJson(Map<String, Object?> obj) => |
| BreakpointLocationsArguments.fromMap(obj); |
| |
| BreakpointLocationsArguments({ |
| this.column, |
| this.endColumn, |
| this.endLine, |
| required this.line, |
| required this.source, |
| }); |
| |
| BreakpointLocationsArguments.fromMap(Map<String, Object?> obj) |
| : column = obj['column'] as int?, |
| endColumn = obj['endColumn'] as int?, |
| endLine = obj['endLine'] as int?, |
| line = obj['line'] as int, |
| source = Source.fromJson(obj['source'] as Map<String, Object?>); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['column'] is! int?) { |
| return false; |
| } |
| if (obj['endColumn'] is! int?) { |
| return false; |
| } |
| if (obj['endLine'] is! int?) { |
| return false; |
| } |
| if (obj['line'] is! int) { |
| return false; |
| } |
| if (!Source.canParse(obj['source'])) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (column != null) 'column': column, |
| if (endColumn != null) 'endColumn': endColumn, |
| if (endLine != null) 'endLine': endLine, |
| 'line': line, |
| 'source': source, |
| }; |
| } |
| |
| /// Response to 'breakpointLocations' request. |
| /// Contains possible locations for source breakpoints. |
| class BreakpointLocationsResponse extends Response { |
| static BreakpointLocationsResponse fromJson(Map<String, Object?> obj) => |
| BreakpointLocationsResponse.fromMap(obj); |
| |
| BreakpointLocationsResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| BreakpointLocationsResponse.fromMap(Map<String, Object?> obj) |
| : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Arguments for 'cancel' request. |
| class CancelArguments extends RequestArguments { |
| /// The ID (attribute 'progressId') of the progress to cancel. If missing no |
| /// progress is cancelled. |
| /// Both a 'requestId' and a 'progressId' can be specified in one request. |
| final String? progressId; |
| |
| /// The ID (attribute 'seq') of the request to cancel. If missing no request |
| /// is cancelled. |
| /// Both a 'requestId' and a 'progressId' can be specified in one request. |
| final int? requestId; |
| |
| static CancelArguments fromJson(Map<String, Object?> obj) => |
| CancelArguments.fromMap(obj); |
| |
| CancelArguments({ |
| this.progressId, |
| this.requestId, |
| }); |
| |
| CancelArguments.fromMap(Map<String, Object?> obj) |
| : progressId = obj['progressId'] as String?, |
| requestId = obj['requestId'] as int?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['progressId'] is! String?) { |
| return false; |
| } |
| if (obj['requestId'] is! int?) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (progressId != null) 'progressId': progressId, |
| if (requestId != null) 'requestId': requestId, |
| }; |
| } |
| |
| /// Response to 'cancel' request. This is just an acknowledgement, so no body |
| /// field is required. |
| class CancelResponse extends Response { |
| static CancelResponse fromJson(Map<String, Object?> obj) => |
| CancelResponse.fromMap(obj); |
| |
| CancelResponse({ |
| Object? body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| CancelResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Information about the capabilities of a debug adapter. |
| class Capabilities { |
| /// The set of additional module information exposed by the debug adapter. |
| final List<ColumnDescriptor>? additionalModuleColumns; |
| |
| /// The set of characters that should trigger completion in a REPL. If not |
| /// specified, the UI should assume the '.' character. |
| final List<String>? completionTriggerCharacters; |
| |
| /// Available exception filter options for the 'setExceptionBreakpoints' |
| /// request. |
| final List<ExceptionBreakpointsFilter>? exceptionBreakpointFilters; |
| |
| /// The debug adapter supports the 'suspendDebuggee' attribute on the |
| /// 'disconnect' request. |
| final bool? supportSuspendDebuggee; |
| |
| /// The debug adapter supports the 'terminateDebuggee' attribute on the |
| /// 'disconnect' request. |
| final bool? supportTerminateDebuggee; |
| |
| /// Checksum algorithms supported by the debug adapter. |
| final List<ChecksumAlgorithm>? supportedChecksumAlgorithms; |
| |
| /// The debug adapter supports the 'breakpointLocations' request. |
| final bool? supportsBreakpointLocationsRequest; |
| |
| /// The debug adapter supports the 'cancel' request. |
| final bool? supportsCancelRequest; |
| |
| /// The debug adapter supports the 'clipboard' context value in the 'evaluate' |
| /// request. |
| final bool? supportsClipboardContext; |
| |
| /// The debug adapter supports the 'completions' request. |
| final bool? supportsCompletionsRequest; |
| |
| /// The debug adapter supports conditional breakpoints. |
| final bool? supportsConditionalBreakpoints; |
| |
| /// The debug adapter supports the 'configurationDone' request. |
| final bool? supportsConfigurationDoneRequest; |
| |
| /// The debug adapter supports data breakpoints. |
| final bool? supportsDataBreakpoints; |
| |
| /// 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. |
| final bool? supportsDelayedStackTraceLoading; |
| |
| /// The debug adapter supports the 'disassemble' request. |
| final bool? supportsDisassembleRequest; |
| |
| /// The debug adapter supports a (side effect free) evaluate request for data |
| /// hovers. |
| final bool? supportsEvaluateForHovers; |
| |
| /// The debug adapter supports 'filterOptions' as an argument on the |
| /// 'setExceptionBreakpoints' request. |
| final bool? supportsExceptionFilterOptions; |
| |
| /// The debug adapter supports the 'exceptionInfo' request. |
| final bool? supportsExceptionInfoRequest; |
| |
| /// The debug adapter supports 'exceptionOptions' on the |
| /// setExceptionBreakpoints request. |
| final bool? supportsExceptionOptions; |
| |
| /// The debug adapter supports function breakpoints. |
| final bool? supportsFunctionBreakpoints; |
| |
| /// The debug adapter supports the 'gotoTargets' request. |
| final bool? supportsGotoTargetsRequest; |
| |
| /// The debug adapter supports breakpoints that break execution after a |
| /// specified number of hits. |
| final bool? supportsHitConditionalBreakpoints; |
| |
| /// The debug adapter supports adding breakpoints based on instruction |
| /// references. |
| final bool? supportsInstructionBreakpoints; |
| |
| /// The debug adapter supports the 'loadedSources' request. |
| final bool? supportsLoadedSourcesRequest; |
| |
| /// The debug adapter supports logpoints by interpreting the 'logMessage' |
| /// attribute of the SourceBreakpoint. |
| final bool? supportsLogPoints; |
| |
| /// The debug adapter supports the 'modules' request. |
| final bool? supportsModulesRequest; |
| |
| /// The debug adapter supports the 'readMemory' request. |
| final bool? supportsReadMemoryRequest; |
| |
| /// The debug adapter supports restarting a frame. |
| final bool? supportsRestartFrame; |
| |
| /// 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. |
| final bool? supportsRestartRequest; |
| |
| /// The debug adapter supports the 'setExpression' request. |
| final bool? supportsSetExpression; |
| |
| /// The debug adapter supports setting a variable to a value. |
| final bool? supportsSetVariable; |
| |
| /// The debug adapter supports stepping back via the 'stepBack' and |
| /// 'reverseContinue' requests. |
| final bool? supportsStepBack; |
| |
| /// The debug adapter supports the 'stepInTargets' request. |
| final bool? supportsStepInTargetsRequest; |
| |
| /// The debug adapter supports stepping granularities (argument 'granularity') |
| /// for the stepping requests. |
| final bool? supportsSteppingGranularity; |
| |
| /// The debug adapter supports the 'terminate' request. |
| final bool? supportsTerminateRequest; |
| |
| /// The debug adapter supports the 'terminateThreads' request. |
| final bool? supportsTerminateThreadsRequest; |
| |
| /// The debug adapter supports a 'format' attribute on the stackTraceRequest, |
| /// variablesRequest, and evaluateRequest. |
| final bool? supportsValueFormattingOptions; |
| |
| static Capabilities fromJson(Map<String, Object?> obj) => |
| Capabilities.fromMap(obj); |
| |
| Capabilities({ |
| this.additionalModuleColumns, |
| this.completionTriggerCharacters, |
| this.exceptionBreakpointFilters, |
| this.supportSuspendDebuggee, |
| this.supportTerminateDebuggee, |
| this.supportedChecksumAlgorithms, |
| this.supportsBreakpointLocationsRequest, |
| this.supportsCancelRequest, |
| this.supportsClipboardContext, |
| this.supportsCompletionsRequest, |
| this.supportsConditionalBreakpoints, |
| this.supportsConfigurationDoneRequest, |
| this.supportsDataBreakpoints, |
| this.supportsDelayedStackTraceLoading, |
| this.supportsDisassembleRequest, |
| this.supportsEvaluateForHovers, |
| this.supportsExceptionFilterOptions, |
| this.supportsExceptionInfoRequest, |
| this.supportsExceptionOptions, |
| this.supportsFunctionBreakpoints, |
| this.supportsGotoTargetsRequest, |
| this.supportsHitConditionalBreakpoints, |
| this.supportsInstructionBreakpoints, |
| this.supportsLoadedSourcesRequest, |
| this.supportsLogPoints, |
| this.supportsModulesRequest, |
| this.supportsReadMemoryRequest, |
| this.supportsRestartFrame, |
| this.supportsRestartRequest, |
| this.supportsSetExpression, |
| this.supportsSetVariable, |
| this.supportsStepBack, |
| this.supportsStepInTargetsRequest, |
| this.supportsSteppingGranularity, |
| this.supportsTerminateRequest, |
| this.supportsTerminateThreadsRequest, |
| this.supportsValueFormattingOptions, |
| }); |
| |
| Capabilities.fromMap(Map<String, Object?> obj) |
| : additionalModuleColumns = (obj['additionalModuleColumns'] as List?) |
| ?.map((item) => |
| ColumnDescriptor.fromJson(item as Map<String, Object?>)) |
| .toList(), |
| completionTriggerCharacters = |
| (obj['completionTriggerCharacters'] as List?) |
| ?.map((item) => item as String) |
| .toList(), |
| exceptionBreakpointFilters = |
| (obj['exceptionBreakpointFilters'] as List?) |
| ?.map((item) => ExceptionBreakpointsFilter.fromJson( |
| item as Map<String, Object?>)) |
| .toList(), |
| supportSuspendDebuggee = obj['supportSuspendDebuggee'] as bool?, |
| supportTerminateDebuggee = obj['supportTerminateDebuggee'] as bool?, |
| supportedChecksumAlgorithms = |
| (obj['supportedChecksumAlgorithms'] as List?) |
| ?.map((item) => item as ChecksumAlgorithm) |
| .toList(), |
| supportsBreakpointLocationsRequest = |
| obj['supportsBreakpointLocationsRequest'] as bool?, |
| supportsCancelRequest = obj['supportsCancelRequest'] as bool?, |
| supportsClipboardContext = obj['supportsClipboardContext'] as bool?, |
| supportsCompletionsRequest = obj['supportsCompletionsRequest'] as bool?, |
| supportsConditionalBreakpoints = |
| obj['supportsConditionalBreakpoints'] as bool?, |
| supportsConfigurationDoneRequest = |
| obj['supportsConfigurationDoneRequest'] as bool?, |
| supportsDataBreakpoints = obj['supportsDataBreakpoints'] as bool?, |
| supportsDelayedStackTraceLoading = |
| obj['supportsDelayedStackTraceLoading'] as bool?, |
| supportsDisassembleRequest = obj['supportsDisassembleRequest'] as bool?, |
| supportsEvaluateForHovers = obj['supportsEvaluateForHovers'] as bool?, |
| supportsExceptionFilterOptions = |
| obj['supportsExceptionFilterOptions'] as bool?, |
| supportsExceptionInfoRequest = |
| obj['supportsExceptionInfoRequest'] as bool?, |
| supportsExceptionOptions = obj['supportsExceptionOptions'] as bool?, |
| supportsFunctionBreakpoints = |
| obj['supportsFunctionBreakpoints'] as bool?, |
| supportsGotoTargetsRequest = obj['supportsGotoTargetsRequest'] as bool?, |
| supportsHitConditionalBreakpoints = |
| obj['supportsHitConditionalBreakpoints'] as bool?, |
| supportsInstructionBreakpoints = |
| obj['supportsInstructionBreakpoints'] as bool?, |
| supportsLoadedSourcesRequest = |
| obj['supportsLoadedSourcesRequest'] as bool?, |
| supportsLogPoints = obj['supportsLogPoints'] as bool?, |
| supportsModulesRequest = obj['supportsModulesRequest'] as bool?, |
| supportsReadMemoryRequest = obj['supportsReadMemoryRequest'] as bool?, |
| supportsRestartFrame = obj['supportsRestartFrame'] as bool?, |
| supportsRestartRequest = obj['supportsRestartRequest'] as bool?, |
| supportsSetExpression = obj['supportsSetExpression'] as bool?, |
| supportsSetVariable = obj['supportsSetVariable'] as bool?, |
| supportsStepBack = obj['supportsStepBack'] as bool?, |
| supportsStepInTargetsRequest = |
| obj['supportsStepInTargetsRequest'] as bool?, |
| supportsSteppingGranularity = |
| obj['supportsSteppingGranularity'] as bool?, |
| supportsTerminateRequest = obj['supportsTerminateRequest'] as bool?, |
| supportsTerminateThreadsRequest = |
| obj['supportsTerminateThreadsRequest'] as bool?, |
| supportsValueFormattingOptions = |
| obj['supportsValueFormattingOptions'] as bool?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if ((obj['additionalModuleColumns'] is! List || |
| (obj['additionalModuleColumns'] |
| .any((item) => !ColumnDescriptor.canParse(item))))) { |
| return false; |
| } |
| if ((obj['completionTriggerCharacters'] is! List || |
| (obj['completionTriggerCharacters'].any((item) => item is! String)))) { |
| return false; |
| } |
| if ((obj['exceptionBreakpointFilters'] is! List || |
| (obj['exceptionBreakpointFilters'] |
| .any((item) => !ExceptionBreakpointsFilter.canParse(item))))) { |
| return false; |
| } |
| if (obj['supportSuspendDebuggee'] is! bool?) { |
| return false; |
| } |
| if (obj['supportTerminateDebuggee'] is! bool?) { |
| return false; |
| } |
| if ((obj['supportedChecksumAlgorithms'] is! List || |
| (obj['supportedChecksumAlgorithms'] |
| .any((item) => item is! ChecksumAlgorithm)))) { |
| return false; |
| } |
| if (obj['supportsBreakpointLocationsRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsCancelRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsClipboardContext'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsCompletionsRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsConditionalBreakpoints'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsConfigurationDoneRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsDataBreakpoints'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsDelayedStackTraceLoading'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsDisassembleRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsEvaluateForHovers'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsExceptionFilterOptions'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsExceptionInfoRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsExceptionOptions'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsFunctionBreakpoints'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsGotoTargetsRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsHitConditionalBreakpoints'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsInstructionBreakpoints'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsLoadedSourcesRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsLogPoints'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsModulesRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsReadMemoryRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsRestartFrame'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsRestartRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsSetExpression'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsSetVariable'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsStepBack'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsStepInTargetsRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsSteppingGranularity'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsTerminateRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsTerminateThreadsRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsValueFormattingOptions'] is! bool?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (additionalModuleColumns != null) |
| 'additionalModuleColumns': additionalModuleColumns, |
| if (completionTriggerCharacters != null) |
| 'completionTriggerCharacters': completionTriggerCharacters, |
| if (exceptionBreakpointFilters != null) |
| 'exceptionBreakpointFilters': exceptionBreakpointFilters, |
| if (supportSuspendDebuggee != null) |
| 'supportSuspendDebuggee': supportSuspendDebuggee, |
| if (supportTerminateDebuggee != null) |
| 'supportTerminateDebuggee': supportTerminateDebuggee, |
| if (supportedChecksumAlgorithms != null) |
| 'supportedChecksumAlgorithms': supportedChecksumAlgorithms, |
| if (supportsBreakpointLocationsRequest != null) |
| 'supportsBreakpointLocationsRequest': |
| supportsBreakpointLocationsRequest, |
| if (supportsCancelRequest != null) |
| 'supportsCancelRequest': supportsCancelRequest, |
| if (supportsClipboardContext != null) |
| 'supportsClipboardContext': supportsClipboardContext, |
| if (supportsCompletionsRequest != null) |
| 'supportsCompletionsRequest': supportsCompletionsRequest, |
| if (supportsConditionalBreakpoints != null) |
| 'supportsConditionalBreakpoints': supportsConditionalBreakpoints, |
| if (supportsConfigurationDoneRequest != null) |
| 'supportsConfigurationDoneRequest': supportsConfigurationDoneRequest, |
| if (supportsDataBreakpoints != null) |
| 'supportsDataBreakpoints': supportsDataBreakpoints, |
| if (supportsDelayedStackTraceLoading != null) |
| 'supportsDelayedStackTraceLoading': supportsDelayedStackTraceLoading, |
| if (supportsDisassembleRequest != null) |
| 'supportsDisassembleRequest': supportsDisassembleRequest, |
| if (supportsEvaluateForHovers != null) |
| 'supportsEvaluateForHovers': supportsEvaluateForHovers, |
| if (supportsExceptionFilterOptions != null) |
| 'supportsExceptionFilterOptions': supportsExceptionFilterOptions, |
| if (supportsExceptionInfoRequest != null) |
| 'supportsExceptionInfoRequest': supportsExceptionInfoRequest, |
| if (supportsExceptionOptions != null) |
| 'supportsExceptionOptions': supportsExceptionOptions, |
| if (supportsFunctionBreakpoints != null) |
| 'supportsFunctionBreakpoints': supportsFunctionBreakpoints, |
| if (supportsGotoTargetsRequest != null) |
| 'supportsGotoTargetsRequest': supportsGotoTargetsRequest, |
| if (supportsHitConditionalBreakpoints != null) |
| 'supportsHitConditionalBreakpoints': |
| supportsHitConditionalBreakpoints, |
| if (supportsInstructionBreakpoints != null) |
| 'supportsInstructionBreakpoints': supportsInstructionBreakpoints, |
| if (supportsLoadedSourcesRequest != null) |
| 'supportsLoadedSourcesRequest': supportsLoadedSourcesRequest, |
| if (supportsLogPoints != null) 'supportsLogPoints': supportsLogPoints, |
| if (supportsModulesRequest != null) |
| 'supportsModulesRequest': supportsModulesRequest, |
| if (supportsReadMemoryRequest != null) |
| 'supportsReadMemoryRequest': supportsReadMemoryRequest, |
| if (supportsRestartFrame != null) |
| 'supportsRestartFrame': supportsRestartFrame, |
| if (supportsRestartRequest != null) |
| 'supportsRestartRequest': supportsRestartRequest, |
| if (supportsSetExpression != null) |
| 'supportsSetExpression': supportsSetExpression, |
| if (supportsSetVariable != null) |
| 'supportsSetVariable': supportsSetVariable, |
| if (supportsStepBack != null) 'supportsStepBack': supportsStepBack, |
| if (supportsStepInTargetsRequest != null) |
| 'supportsStepInTargetsRequest': supportsStepInTargetsRequest, |
| if (supportsSteppingGranularity != null) |
| 'supportsSteppingGranularity': supportsSteppingGranularity, |
| if (supportsTerminateRequest != null) |
| 'supportsTerminateRequest': supportsTerminateRequest, |
| if (supportsTerminateThreadsRequest != null) |
| 'supportsTerminateThreadsRequest': supportsTerminateThreadsRequest, |
| if (supportsValueFormattingOptions != null) |
| 'supportsValueFormattingOptions': supportsValueFormattingOptions, |
| }; |
| } |
| |
| /// The checksum of an item calculated by the specified algorithm. |
| class Checksum { |
| /// The algorithm used to calculate this checksum. |
| final ChecksumAlgorithm algorithm; |
| |
| /// Value of the checksum. |
| final String checksum; |
| |
| static Checksum fromJson(Map<String, Object?> obj) => Checksum.fromMap(obj); |
| |
| Checksum({ |
| required this.algorithm, |
| required this.checksum, |
| }); |
| |
| Checksum.fromMap(Map<String, Object?> obj) |
| : algorithm = obj['algorithm'] as ChecksumAlgorithm, |
| checksum = obj['checksum'] as String; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['algorithm'] is! ChecksumAlgorithm) { |
| return false; |
| } |
| if (obj['checksum'] is! String) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'algorithm': algorithm, |
| 'checksum': checksum, |
| }; |
| } |
| |
| /// Names of checksum algorithms that may be supported by a debug adapter. |
| typedef ChecksumAlgorithm = String; |
| |
| /// A ColumnDescriptor specifies what module attribute to show in a column of |
| /// the ModulesView, how to format it, |
| /// and what the column's label should be. |
| /// It is only used if the underlying UI actually supports this level of |
| /// customization. |
| class ColumnDescriptor { |
| /// Name of the attribute rendered in this column. |
| final String attributeName; |
| |
| /// Format to use for the rendered values in this column. TBD how the format |
| /// strings looks like. |
| final String? format; |
| |
| /// Header UI label of column. |
| final String label; |
| |
| /// Datatype of values in this column. Defaults to 'string' if not specified. |
| final String? type; |
| |
| /// Width of this column in characters (hint only). |
| final int? width; |
| |
| static ColumnDescriptor fromJson(Map<String, Object?> obj) => |
| ColumnDescriptor.fromMap(obj); |
| |
| ColumnDescriptor({ |
| required this.attributeName, |
| this.format, |
| required this.label, |
| this.type, |
| this.width, |
| }); |
| |
| ColumnDescriptor.fromMap(Map<String, Object?> obj) |
| : attributeName = obj['attributeName'] as String, |
| format = obj['format'] as String?, |
| label = obj['label'] as String, |
| type = obj['type'] as String?, |
| width = obj['width'] as int?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['attributeName'] is! String) { |
| return false; |
| } |
| if (obj['format'] is! String?) { |
| return false; |
| } |
| if (obj['label'] is! String) { |
| return false; |
| } |
| if (obj['type'] is! String?) { |
| return false; |
| } |
| if (obj['width'] is! int?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'attributeName': attributeName, |
| if (format != null) 'format': format, |
| 'label': label, |
| if (type != null) 'type': type, |
| if (width != null) 'width': width, |
| }; |
| } |
| |
| /// CompletionItems are the suggestions returned from the CompletionsRequest. |
| class CompletionItem { |
| /// The label of this completion item. By default this is also the text that |
| /// is inserted when selecting this completion. |
| final String label; |
| |
| /// This value determines how many characters are overwritten by the |
| /// completion text. |
| /// If missing the value 0 is assumed which results in the completion text |
| /// being inserted. |
| final int? length; |
| |
| /// Determines the length of the new selection after the text has been |
| /// inserted (or replaced). |
| /// The selection can not extend beyond the bounds of the completion text. |
| /// If omitted the length is assumed to be 0. |
| final int? selectionLength; |
| |
| /// Determines the start of the new selection after the text has been inserted |
| /// (or replaced). |
| /// The start position must in the range 0 and length of the completion text. |
| /// If omitted the selection starts at the end of the completion text. |
| final int? selectionStart; |
| |
| /// A string that should be used when comparing this item with other items. |
| /// When `falsy` the label is used. |
| final String? sortText; |
| |
| /// This value determines the location (in the CompletionsRequest's 'text' |
| /// attribute) where the completion text is added. |
| /// If missing the text is added at the location specified by the |
| /// CompletionsRequest's 'column' attribute. |
| final int? start; |
| |
| /// If text is not falsy then it is inserted instead of the label. |
| final String? text; |
| |
| /// The item's type. Typically the client uses this information to render the |
| /// item in the UI with an icon. |
| final CompletionItemType? type; |
| |
| static CompletionItem fromJson(Map<String, Object?> obj) => |
| CompletionItem.fromMap(obj); |
| |
| CompletionItem({ |
| required this.label, |
| this.length, |
| this.selectionLength, |
| this.selectionStart, |
| this.sortText, |
| this.start, |
| this.text, |
| this.type, |
| }); |
| |
| CompletionItem.fromMap(Map<String, Object?> obj) |
| : label = obj['label'] as String, |
| length = obj['length'] as int?, |
| selectionLength = obj['selectionLength'] as int?, |
| selectionStart = obj['selectionStart'] as int?, |
| sortText = obj['sortText'] as String?, |
| start = obj['start'] as int?, |
| text = obj['text'] as String?, |
| type = obj['type'] as CompletionItemType?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['label'] is! String) { |
| return false; |
| } |
| if (obj['length'] is! int?) { |
| return false; |
| } |
| if (obj['selectionLength'] is! int?) { |
| return false; |
| } |
| if (obj['selectionStart'] is! int?) { |
| return false; |
| } |
| if (obj['sortText'] is! String?) { |
| return false; |
| } |
| if (obj['start'] is! int?) { |
| return false; |
| } |
| if (obj['text'] is! String?) { |
| return false; |
| } |
| if (obj['type'] is! CompletionItemType?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'label': label, |
| if (length != null) 'length': length, |
| if (selectionLength != null) 'selectionLength': selectionLength, |
| if (selectionStart != null) 'selectionStart': selectionStart, |
| if (sortText != null) 'sortText': sortText, |
| if (start != null) 'start': start, |
| if (text != null) 'text': text, |
| if (type != null) 'type': type, |
| }; |
| } |
| |
| /// Some predefined types for the CompletionItem. Please note that not all |
| /// clients have specific icons for all of them. |
| typedef CompletionItemType = String; |
| |
| /// Arguments for 'completions' request. |
| class CompletionsArguments extends RequestArguments { |
| /// The character position for which to determine the completion proposals. |
| final int column; |
| |
| /// Returns completions in the scope of this stack frame. If not specified, |
| /// the completions are returned for the global scope. |
| final int? frameId; |
| |
| /// An optional line for which to determine the completion proposals. If |
| /// missing the first line of the text is assumed. |
| final int? line; |
| |
| /// One or more source lines. Typically this is the text a user has typed into |
| /// the debug console before he asked for completion. |
| final String text; |
| |
| static CompletionsArguments fromJson(Map<String, Object?> obj) => |
| CompletionsArguments.fromMap(obj); |
| |
| CompletionsArguments({ |
| required this.column, |
| this.frameId, |
| this.line, |
| required this.text, |
| }); |
| |
| CompletionsArguments.fromMap(Map<String, Object?> obj) |
| : column = obj['column'] as int, |
| frameId = obj['frameId'] as int?, |
| line = obj['line'] as int?, |
| text = obj['text'] as String; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['column'] is! int) { |
| return false; |
| } |
| if (obj['frameId'] is! int?) { |
| return false; |
| } |
| if (obj['line'] is! int?) { |
| return false; |
| } |
| if (obj['text'] is! String) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'column': column, |
| if (frameId != null) 'frameId': frameId, |
| if (line != null) 'line': line, |
| 'text': text, |
| }; |
| } |
| |
| /// Response to 'completions' request. |
| class CompletionsResponse extends Response { |
| static CompletionsResponse fromJson(Map<String, Object?> obj) => |
| CompletionsResponse.fromMap(obj); |
| |
| CompletionsResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| CompletionsResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Arguments for 'configurationDone' request. |
| class ConfigurationDoneArguments extends RequestArguments { |
| static ConfigurationDoneArguments fromJson(Map<String, Object?> obj) => |
| ConfigurationDoneArguments.fromMap(obj); |
| |
| ConfigurationDoneArguments(); |
| |
| ConfigurationDoneArguments.fromMap(Map<String, Object?> obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => {}; |
| } |
| |
| /// Response to 'configurationDone' request. This is just an acknowledgement, so |
| /// no body field is required. |
| class ConfigurationDoneResponse extends Response { |
| static ConfigurationDoneResponse fromJson(Map<String, Object?> obj) => |
| ConfigurationDoneResponse.fromMap(obj); |
| |
| ConfigurationDoneResponse({ |
| Object? body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| ConfigurationDoneResponse.fromMap(Map<String, Object?> obj) |
| : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Arguments for 'continue' request. |
| class ContinueArguments extends RequestArguments { |
| /// Continue execution for the specified thread (if possible). |
| /// 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. |
| final int threadId; |
| |
| static ContinueArguments fromJson(Map<String, Object?> obj) => |
| ContinueArguments.fromMap(obj); |
| |
| ContinueArguments({ |
| required this.threadId, |
| }); |
| |
| ContinueArguments.fromMap(Map<String, Object?> obj) |
| : threadId = obj['threadId'] as int; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['threadId'] is! int) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'threadId': threadId, |
| }; |
| } |
| |
| /// Response to 'continue' request. |
| class ContinueResponse extends Response { |
| static ContinueResponse fromJson(Map<String, Object?> obj) => |
| ContinueResponse.fromMap(obj); |
| |
| ContinueResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| ContinueResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Properties of a data breakpoint passed to the setDataBreakpoints request. |
| class DataBreakpoint { |
| /// The access type of the data. |
| final DataBreakpointAccessType? accessType; |
| |
| /// An optional expression for conditional breakpoints. |
| final String? condition; |
| |
| /// An id representing the data. This id is returned from the |
| /// dataBreakpointInfo request. |
| final String dataId; |
| |
| /// An optional expression that controls how many hits of the breakpoint are |
| /// ignored. |
| /// The backend is expected to interpret the expression as needed. |
| final String? hitCondition; |
| |
| static DataBreakpoint fromJson(Map<String, Object?> obj) => |
| DataBreakpoint.fromMap(obj); |
| |
| DataBreakpoint({ |
| this.accessType, |
| this.condition, |
| required this.dataId, |
| this.hitCondition, |
| }); |
| |
| DataBreakpoint.fromMap(Map<String, Object?> obj) |
| : accessType = obj['accessType'] as DataBreakpointAccessType?, |
| condition = obj['condition'] as String?, |
| dataId = obj['dataId'] as String, |
| hitCondition = obj['hitCondition'] as String?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['accessType'] is! DataBreakpointAccessType?) { |
| return false; |
| } |
| if (obj['condition'] is! String?) { |
| return false; |
| } |
| if (obj['dataId'] is! String) { |
| return false; |
| } |
| if (obj['hitCondition'] is! String?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (accessType != null) 'accessType': accessType, |
| if (condition != null) 'condition': condition, |
| 'dataId': dataId, |
| if (hitCondition != null) 'hitCondition': hitCondition, |
| }; |
| } |
| |
| /// This enumeration defines all possible access types for data breakpoints. |
| typedef DataBreakpointAccessType = String; |
| |
| /// Arguments for 'dataBreakpointInfo' request. |
| class DataBreakpointInfoArguments extends RequestArguments { |
| /// The name of the Variable's child to obtain data breakpoint information |
| /// for. |
| /// If variablesReference isn’t provided, this can be an expression. |
| final String name; |
| |
| /// Reference to the Variable container if the data breakpoint is requested |
| /// for a child of the container. |
| final int? variablesReference; |
| |
| static DataBreakpointInfoArguments fromJson(Map<String, Object?> obj) => |
| DataBreakpointInfoArguments.fromMap(obj); |
| |
| DataBreakpointInfoArguments({ |
| required this.name, |
| this.variablesReference, |
| }); |
| |
| DataBreakpointInfoArguments.fromMap(Map<String, Object?> obj) |
| : name = obj['name'] as String, |
| variablesReference = obj['variablesReference'] as int?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['name'] is! String) { |
| return false; |
| } |
| if (obj['variablesReference'] is! int?) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'name': name, |
| if (variablesReference != null) |
| 'variablesReference': variablesReference, |
| }; |
| } |
| |
| /// Response to 'dataBreakpointInfo' request. |
| class DataBreakpointInfoResponse extends Response { |
| static DataBreakpointInfoResponse fromJson(Map<String, Object?> obj) => |
| DataBreakpointInfoResponse.fromMap(obj); |
| |
| DataBreakpointInfoResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| DataBreakpointInfoResponse.fromMap(Map<String, Object?> obj) |
| : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Arguments for 'disassemble' request. |
| class DisassembleArguments extends RequestArguments { |
| /// Number of instructions to disassemble starting at the specified location |
| /// and offset. |
| /// An adapter must return exactly this number of instructions - any |
| /// unavailable instructions should be replaced with an implementation-defined |
| /// 'invalid instruction' value. |
| final int instructionCount; |
| |
| /// Optional offset (in instructions) to be applied after the byte offset (if |
| /// any) before disassembling. Can be negative. |
| final int? instructionOffset; |
| |
| /// Memory reference to the base location containing the instructions to |
| /// disassemble. |
| final String memoryReference; |
| |
| /// Optional offset (in bytes) to be applied to the reference location before |
| /// disassembling. Can be negative. |
| final int? offset; |
| |
| /// If true, the adapter should attempt to resolve memory addresses and other |
| /// values to symbolic names. |
| final bool? resolveSymbols; |
| |
| static DisassembleArguments fromJson(Map<String, Object?> obj) => |
| DisassembleArguments.fromMap(obj); |
| |
| DisassembleArguments({ |
| required this.instructionCount, |
| this.instructionOffset, |
| required this.memoryReference, |
| this.offset, |
| this.resolveSymbols, |
| }); |
| |
| DisassembleArguments.fromMap(Map<String, Object?> obj) |
| : instructionCount = obj['instructionCount'] as int, |
| instructionOffset = obj['instructionOffset'] as int?, |
| memoryReference = obj['memoryReference'] as String, |
| offset = obj['offset'] as int?, |
| resolveSymbols = obj['resolveSymbols'] as bool?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['instructionCount'] is! int) { |
| return false; |
| } |
| if (obj['instructionOffset'] is! int?) { |
| return false; |
| } |
| if (obj['memoryReference'] is! String) { |
| return false; |
| } |
| if (obj['offset'] is! int?) { |
| return false; |
| } |
| if (obj['resolveSymbols'] is! bool?) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'instructionCount': instructionCount, |
| if (instructionOffset != null) 'instructionOffset': instructionOffset, |
| 'memoryReference': memoryReference, |
| if (offset != null) 'offset': offset, |
| if (resolveSymbols != null) 'resolveSymbols': resolveSymbols, |
| }; |
| } |
| |
| /// Response to 'disassemble' request. |
| class DisassembleResponse extends Response { |
| static DisassembleResponse fromJson(Map<String, Object?> obj) => |
| DisassembleResponse.fromMap(obj); |
| |
| DisassembleResponse({ |
| Map<String, Object?>? body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| DisassembleResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>?) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Represents a single disassembled instruction. |
| class DisassembledInstruction { |
| /// The address of the instruction. Treated as a hex value if prefixed with |
| /// '0x', or as a decimal value otherwise. |
| final String address; |
| |
| /// The column within the line that corresponds to this instruction, if any. |
| final int? column; |
| |
| /// The end column of the range that corresponds to this instruction, if any. |
| final int? endColumn; |
| |
| /// The end line of the range that corresponds to this instruction, if any. |
| final int? endLine; |
| |
| /// Text representing the instruction and its operands, in an |
| /// implementation-defined format. |
| final String instruction; |
| |
| /// Optional raw bytes representing the instruction and its operands, in an |
| /// implementation-defined format. |
| final String? instructionBytes; |
| |
| /// The line within the source location that corresponds to this instruction, |
| /// if any. |
| final int? line; |
| |
| /// Source location that corresponds to this instruction, if any. |
| /// Should always be set (if available) on the first instruction returned, |
| /// but can be omitted afterwards if this instruction maps to the same source |
| /// file as the previous instruction. |
| final Source? location; |
| |
| /// Name of the symbol that corresponds with the location of this instruction, |
| /// if any. |
| final String? symbol; |
| |
| static DisassembledInstruction fromJson(Map<String, Object?> obj) => |
| DisassembledInstruction.fromMap(obj); |
| |
| DisassembledInstruction({ |
| required this.address, |
| this.column, |
| this.endColumn, |
| this.endLine, |
| required this.instruction, |
| this.instructionBytes, |
| this.line, |
| this.location, |
| this.symbol, |
| }); |
| |
| DisassembledInstruction.fromMap(Map<String, Object?> obj) |
| : address = obj['address'] as String, |
| column = obj['column'] as int?, |
| endColumn = obj['endColumn'] as int?, |
| endLine = obj['endLine'] as int?, |
| instruction = obj['instruction'] as String, |
| instructionBytes = obj['instructionBytes'] as String?, |
| line = obj['line'] as int?, |
| location = obj['location'] == null |
| ? null |
| : Source.fromJson(obj['location'] as Map<String, Object?>), |
| symbol = obj['symbol'] as String?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['address'] is! String) { |
| return false; |
| } |
| if (obj['column'] is! int?) { |
| return false; |
| } |
| if (obj['endColumn'] is! int?) { |
| return false; |
| } |
| if (obj['endLine'] is! int?) { |
| return false; |
| } |
| if (obj['instruction'] is! String) { |
| return false; |
| } |
| if (obj['instructionBytes'] is! String?) { |
| return false; |
| } |
| if (obj['line'] is! int?) { |
| return false; |
| } |
| if (!Source.canParse(obj['location'])) { |
| return false; |
| } |
| if (obj['symbol'] is! String?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'address': address, |
| if (column != null) 'column': column, |
| if (endColumn != null) 'endColumn': endColumn, |
| if (endLine != null) 'endLine': endLine, |
| 'instruction': instruction, |
| if (instructionBytes != null) 'instructionBytes': instructionBytes, |
| if (line != null) 'line': line, |
| if (location != null) 'location': location, |
| if (symbol != null) 'symbol': symbol, |
| }; |
| } |
| |
| /// Arguments for 'disconnect' request. |
| class DisconnectArguments extends RequestArguments { |
| /// A value of true indicates that this 'disconnect' request is part of a |
| /// restart sequence. |
| final bool? restart; |
| |
| /// Indicates whether the debuggee should stay suspended when the debugger is |
| /// disconnected. |
| /// If unspecified, the debuggee should resume execution. |
| /// The attribute is only honored by a debug adapter if the capability |
| /// 'supportSuspendDebuggee' is true. |
| final bool? suspendDebuggee; |
| |
| /// Indicates whether the debuggee should be terminated when the debugger is |
| /// disconnected. |
| /// If unspecified, the debug adapter is free to do whatever it thinks is |
| /// best. |
| /// The attribute is only honored by a debug adapter if the capability |
| /// 'supportTerminateDebuggee' is true. |
| final bool? terminateDebuggee; |
| |
| static DisconnectArguments fromJson(Map<String, Object?> obj) => |
| DisconnectArguments.fromMap(obj); |
| |
| DisconnectArguments({ |
| this.restart, |
| this.suspendDebuggee, |
| this.terminateDebuggee, |
| }); |
| |
| DisconnectArguments.fromMap(Map<String, Object?> obj) |
| : restart = obj['restart'] as bool?, |
| suspendDebuggee = obj['suspendDebuggee'] as bool?, |
| terminateDebuggee = obj['terminateDebuggee'] as bool?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['restart'] is! bool?) { |
| return false; |
| } |
| if (obj['suspendDebuggee'] is! bool?) { |
| return false; |
| } |
| if (obj['terminateDebuggee'] is! bool?) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (restart != null) 'restart': restart, |
| if (suspendDebuggee != null) 'suspendDebuggee': suspendDebuggee, |
| if (terminateDebuggee != null) 'terminateDebuggee': terminateDebuggee, |
| }; |
| } |
| |
| /// Response to 'disconnect' request. This is just an acknowledgement, so no |
| /// body field is required. |
| class DisconnectResponse extends Response { |
| static DisconnectResponse fromJson(Map<String, Object?> obj) => |
| DisconnectResponse.fromMap(obj); |
| |
| DisconnectResponse({ |
| Object? body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| DisconnectResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// On error (whenever 'success' is false), the body can provide more details. |
| class ErrorResponse extends Response { |
| static ErrorResponse fromJson(Map<String, Object?> obj) => |
| ErrorResponse.fromMap(obj); |
| |
| ErrorResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| ErrorResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Arguments for 'evaluate' request. |
| class EvaluateArguments extends RequestArguments { |
| /// The context in which the evaluate request is run. |
| final String? context; |
| |
| /// The expression to evaluate. |
| final String expression; |
| |
| /// Specifies details on how to format the Evaluate result. |
| /// The attribute is only honored by a debug adapter if the capability |
| /// 'supportsValueFormattingOptions' is true. |
| final ValueFormat? format; |
| |
| /// Evaluate the expression in the scope of this stack frame. If not |
| /// specified, the expression is evaluated in the global scope. |
| final int? frameId; |
| |
| static EvaluateArguments fromJson(Map<String, Object?> obj) => |
| EvaluateArguments.fromMap(obj); |
| |
| EvaluateArguments({ |
| this.context, |
| required this.expression, |
| this.format, |
| this.frameId, |
| }); |
| |
| EvaluateArguments.fromMap(Map<String, Object?> obj) |
| : context = obj['context'] as String?, |
| expression = obj['expression'] as String, |
| format = obj['format'] == null |
| ? null |
| : ValueFormat.fromJson(obj['format'] as Map<String, Object?>), |
| frameId = obj['frameId'] as int?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['context'] is! String?) { |
| return false; |
| } |
| if (obj['expression'] is! String) { |
| return false; |
| } |
| if (!ValueFormat.canParse(obj['format'])) { |
| return false; |
| } |
| if (obj['frameId'] is! int?) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (context != null) 'context': context, |
| 'expression': expression, |
| if (format != null) 'format': format, |
| if (frameId != null) 'frameId': frameId, |
| }; |
| } |
| |
| /// Response to 'evaluate' request. |
| class EvaluateResponse extends Response { |
| static EvaluateResponse fromJson(Map<String, Object?> obj) => |
| EvaluateResponse.fromMap(obj); |
| |
| EvaluateResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| EvaluateResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// A debug adapter initiated event. |
| class Event extends ProtocolMessage { |
| /// Event-specific information. |
| final Object? body; |
| |
| /// Type of event. |
| final String event; |
| |
| static Event fromJson(Map<String, Object?> obj) => Event.fromMap(obj); |
| |
| Event({ |
| this.body, |
| required this.event, |
| required int seq, |
| }) : super( |
| seq: seq, |
| type: 'event', |
| ); |
| |
| Event.fromMap(Map<String, Object?> obj) |
| : body = obj['body'], |
| event = obj['event'] as String, |
| super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['event'] is! String) { |
| return false; |
| } |
| if (obj['type'] is! String) { |
| return false; |
| } |
| return ProtocolMessage.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| if (body != null) 'body': body, |
| 'event': event, |
| }; |
| } |
| |
| /// This enumeration defines all possible conditions when a thrown exception |
| /// should result in a break. |
| /// never: never breaks, |
| /// always: always breaks, |
| /// unhandled: breaks when exception unhandled, |
| /// userUnhandled: breaks if the exception is not handled by user code. |
| typedef ExceptionBreakMode = String; |
| |
| /// An ExceptionBreakpointsFilter is shown in the UI as an filter option for |
| /// configuring how exceptions are dealt with. |
| class ExceptionBreakpointsFilter { |
| /// 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. |
| final String? conditionDescription; |
| |
| /// Initial value of the filter option. If not specified a value 'false' is |
| /// assumed. |
| final bool? defaultValue; |
| |
| /// An optional help text providing additional information about the exception |
| /// filter. This string is typically shown as a hover and must be translated. |
| final String? description; |
| |
| /// The internal ID of the filter option. This value is passed to the |
| /// 'setExceptionBreakpoints' request. |
| final String filter; |
| |
| /// The name of the filter option. This will be shown in the UI. |
| final String label; |
| |
| /// Controls whether a condition can be specified for this filter option. If |
| /// false or missing, a condition can not be set. |
| final bool? supportsCondition; |
| |
| static ExceptionBreakpointsFilter fromJson(Map<String, Object?> obj) => |
| ExceptionBreakpointsFilter.fromMap(obj); |
| |
| ExceptionBreakpointsFilter({ |
| this.conditionDescription, |
| this.defaultValue, |
| this.description, |
| required this.filter, |
| required this.label, |
| this.supportsCondition, |
| }); |
| |
| ExceptionBreakpointsFilter.fromMap(Map<String, Object?> obj) |
| : conditionDescription = obj['conditionDescription'] as String?, |
| defaultValue = obj['default'] as bool?, |
| description = obj['description'] as String?, |
| filter = obj['filter'] as String, |
| label = obj['label'] as String, |
| supportsCondition = obj['supportsCondition'] as bool?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['conditionDescription'] is! String?) { |
| return false; |
| } |
| if (obj['default'] is! bool?) { |
| return false; |
| } |
| if (obj['description'] is! String?) { |
| return false; |
| } |
| if (obj['filter'] is! String) { |
| return false; |
| } |
| if (obj['label'] is! String) { |
| return false; |
| } |
| if (obj['supportsCondition'] is! bool?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (conditionDescription != null) |
| 'conditionDescription': conditionDescription, |
| if (defaultValue != null) 'default': defaultValue, |
| if (description != null) 'description': description, |
| 'filter': filter, |
| 'label': label, |
| if (supportsCondition != null) 'supportsCondition': supportsCondition, |
| }; |
| } |
| |
| /// Detailed information about an exception that has occurred. |
| class ExceptionDetails { |
| /// Optional expression that can be evaluated in the current scope to obtain |
| /// the exception object. |
| final String? evaluateName; |
| |
| /// Fully-qualified type name of the exception object. |
| final String? fullTypeName; |
| |
| /// Details of the exception contained by this exception, if any. |
| final List<ExceptionDetails>? innerException; |
| |
| /// Message contained in the exception. |
| final String? message; |
| |
| /// Stack trace at the time the exception was thrown. |
| final String? stackTrace; |
| |
| /// Short type name of the exception object. |
| final String? typeName; |
| |
| static ExceptionDetails fromJson(Map<String, Object?> obj) => |
| ExceptionDetails.fromMap(obj); |
| |
| ExceptionDetails({ |
| this.evaluateName, |
| this.fullTypeName, |
| this.innerException, |
| this.message, |
| this.stackTrace, |
| this.typeName, |
| }); |
| |
| ExceptionDetails.fromMap(Map<String, Object?> obj) |
| : evaluateName = obj['evaluateName'] as String?, |
| fullTypeName = obj['fullTypeName'] as String?, |
| innerException = (obj['innerException'] as List?) |
| ?.map((item) => |
| ExceptionDetails.fromJson(item as Map<String, Object?>)) |
| .toList(), |
| message = obj['message'] as String?, |
| stackTrace = obj['stackTrace'] as String?, |
| typeName = obj['typeName'] as String?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['evaluateName'] is! String?) { |
| return false; |
| } |
| if (obj['fullTypeName'] is! String?) { |
| return false; |
| } |
| if ((obj['innerException'] is! List || |
| (obj['innerException'] |
| .any((item) => !ExceptionDetails.canParse(item))))) { |
| return false; |
| } |
| if (obj['message'] is! String?) { |
| return false; |
| } |
| if (obj['stackTrace'] is! String?) { |
| return false; |
| } |
| if (obj['typeName'] is! String?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (evaluateName != null) 'evaluateName': evaluateName, |
| if (fullTypeName != null) 'fullTypeName': fullTypeName, |
| if (innerException != null) 'innerException': innerException, |
| if (message != null) 'message': message, |
| if (stackTrace != null) 'stackTrace': stackTrace, |
| if (typeName != null) 'typeName': typeName, |
| }; |
| } |
| |
| /// An ExceptionFilterOptions is used to specify an exception filter together |
| /// with a condition for the setExceptionsFilter request. |
| class ExceptionFilterOptions { |
| /// An optional expression for conditional exceptions. |
| /// The exception will break into the debugger if the result of the condition |
| /// is true. |
| final String? condition; |
| |
| /// ID of an exception filter returned by the 'exceptionBreakpointFilters' |
| /// capability. |
| final String filterId; |
| |
| static ExceptionFilterOptions fromJson(Map<String, Object?> obj) => |
| ExceptionFilterOptions.fromMap(obj); |
| |
| ExceptionFilterOptions({ |
| this.condition, |
| required this.filterId, |
| }); |
| |
| ExceptionFilterOptions.fromMap(Map<String, Object?> obj) |
| : condition = obj['condition'] as String?, |
| filterId = obj['filterId'] as String; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['condition'] is! String?) { |
| return false; |
| } |
| if (obj['filterId'] is! String) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (condition != null) 'condition': condition, |
| 'filterId': filterId, |
| }; |
| } |
| |
| /// Arguments for 'exceptionInfo' request. |
| class ExceptionInfoArguments extends RequestArguments { |
| /// Thread for which exception information should be retrieved. |
| final int threadId; |
| |
| static ExceptionInfoArguments fromJson(Map<String, Object?> obj) => |
| ExceptionInfoArguments.fromMap(obj); |
| |
| ExceptionInfoArguments({ |
| required this.threadId, |
| }); |
| |
| ExceptionInfoArguments.fromMap(Map<String, Object?> obj) |
| : threadId = obj['threadId'] as int; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['threadId'] is! int) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'threadId': threadId, |
| }; |
| } |
| |
| /// Response to 'exceptionInfo' request. |
| class ExceptionInfoResponse extends Response { |
| static ExceptionInfoResponse fromJson(Map<String, Object?> obj) => |
| ExceptionInfoResponse.fromMap(obj); |
| |
| ExceptionInfoResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| ExceptionInfoResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// An ExceptionOptions assigns configuration options to a set of exceptions. |
| class ExceptionOptions { |
| /// Condition when a thrown exception should result in a break. |
| final ExceptionBreakMode breakMode; |
| |
| /// A path that selects a single or multiple exceptions in a tree. If 'path' |
| /// is missing, the whole tree is selected. |
| /// By convention the first segment of the path is a category that is used to |
| /// group exceptions in the UI. |
| final List<ExceptionPathSegment>? path; |
| |
| static ExceptionOptions fromJson(Map<String, Object?> obj) => |
| ExceptionOptions.fromMap(obj); |
| |
| ExceptionOptions({ |
| required this.breakMode, |
| this.path, |
| }); |
| |
| ExceptionOptions.fromMap(Map<String, Object?> obj) |
| : breakMode = obj['breakMode'] as ExceptionBreakMode, |
| path = (obj['path'] as List?) |
| ?.map((item) => |
| ExceptionPathSegment.fromJson(item as Map<String, Object?>)) |
| .toList(); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['breakMode'] is! ExceptionBreakMode) { |
| return false; |
| } |
| if ((obj['path'] is! List || |
| (obj['path'].any((item) => !ExceptionPathSegment.canParse(item))))) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'breakMode': breakMode, |
| if (path != null) 'path': path, |
| }; |
| } |
| |
| /// An ExceptionPathSegment represents a segment in a path that is used to match |
| /// leafs or nodes in a tree of exceptions. |
| /// If a segment consists of more than one name, it matches the names provided |
| /// if 'negate' is false or missing or |
| /// it matches anything except the names provided if 'negate' is true. |
| class ExceptionPathSegment { |
| /// Depending on the value of 'negate' the names that should match or not |
| /// match. |
| final List<String> names; |
| |
| /// If false or missing this segment matches the names provided, otherwise it |
| /// matches anything except the names provided. |
| final bool? negate; |
| |
| static ExceptionPathSegment fromJson(Map<String, Object?> obj) => |
| ExceptionPathSegment.fromMap(obj); |
| |
| ExceptionPathSegment({ |
| required this.names, |
| this.negate, |
| }); |
| |
| ExceptionPathSegment.fromMap(Map<String, Object?> obj) |
| : names = (obj['names'] as List).map((item) => item as String).toList(), |
| negate = obj['negate'] as bool?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if ((obj['names'] is! List || |
| (obj['names'].any((item) => item is! String)))) { |
| return false; |
| } |
| if (obj['negate'] is! bool?) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'names': names, |
| if (negate != null) 'negate': negate, |
| }; |
| } |
| |
| /// Properties of a breakpoint passed to the setFunctionBreakpoints request. |
| class FunctionBreakpoint { |
| /// An optional expression for conditional breakpoints. |
| /// It is only honored by a debug adapter if the capability |
| /// 'supportsConditionalBreakpoints' is true. |
| final String? condition; |
| |
| /// An optional expression that controls how many hits of the breakpoint are |
| /// ignored. |
| /// The backend is expected to interpret the expression as needed. |
| /// The attribute is only honored by a debug adapter if the capability |
| /// 'supportsHitConditionalBreakpoints' is true. |
| final String? hitCondition; |
| |
| /// The name of the function. |
| final String name; |
| |
| static FunctionBreakpoint fromJson(Map<String, Object?> obj) => |
| FunctionBreakpoint.fromMap(obj); |
| |
| FunctionBreakpoint({ |
| this.condition, |
| this.hitCondition, |
| required this.name, |
| }); |
| |
| FunctionBreakpoint.fromMap(Map<String, Object?> obj) |
| : condition = obj['condition'] as String?, |
| hitCondition = obj['hitCondition'] as String?, |
| name = obj['name'] as String; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['condition'] is! String?) { |
| return false; |
| } |
| if (obj['hitCondition'] is! String?) { |
| return false; |
| } |
| if (obj['name'] is! String) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (condition != null) 'condition': condition, |
| if (hitCondition != null) 'hitCondition': hitCondition, |
| 'name': name, |
| }; |
| } |
| |
| /// Arguments for 'goto' request. |
| class GotoArguments extends RequestArguments { |
| /// The location where the debuggee will continue to run. |
| final int targetId; |
| |
| /// Set the goto target for this thread. |
| final int threadId; |
| |
| static GotoArguments fromJson(Map<String, Object?> obj) => |
| GotoArguments.fromMap(obj); |
| |
| GotoArguments({ |
| required this.targetId, |
| required this.threadId, |
| }); |
| |
| GotoArguments.fromMap(Map<String, Object?> obj) |
| : targetId = obj['targetId'] as int, |
| threadId = obj['threadId'] as int; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['targetId'] is! int) { |
| return false; |
| } |
| if (obj['threadId'] is! int) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'targetId': targetId, |
| 'threadId': threadId, |
| }; |
| } |
| |
| /// Response to 'goto' request. This is just an acknowledgement, so no body |
| /// field is required. |
| class GotoResponse extends Response { |
| static GotoResponse fromJson(Map<String, Object?> obj) => |
| GotoResponse.fromMap(obj); |
| |
| GotoResponse({ |
| Object? body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| GotoResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// A GotoTarget describes a code location that can be used as a target in the |
| /// 'goto' request. |
| /// The possible goto targets can be determined via the 'gotoTargets' request. |
| class GotoTarget { |
| /// An optional column of the goto target. |
| final int? column; |
| |
| /// An optional end column of the range covered by the goto target. |
| final int? endColumn; |
| |
| /// An optional end line of the range covered by the goto target. |
| final int? endLine; |
| |
| /// Unique identifier for a goto target. This is used in the goto request. |
| final int id; |
| |
| /// Optional memory reference for the instruction pointer value represented by |
| /// this target. |
| final String? instructionPointerReference; |
| |
| /// The name of the goto target (shown in the UI). |
| final String label; |
| |
| /// The line of the goto target. |
| final int line; |
| |
| static GotoTarget fromJson(Map<String, Object?> obj) => |
| GotoTarget.fromMap(obj); |
| |
| GotoTarget({ |
| this.column, |
| this.endColumn, |
| this.endLine, |
| required this.id, |
| this.instructionPointerReference, |
| required this.label, |
| required this.line, |
| }); |
| |
| GotoTarget.fromMap(Map<String, Object?> obj) |
| : column = obj['column'] as int?, |
| endColumn = obj['endColumn'] as int?, |
| endLine = obj['endLine'] as int?, |
| id = obj['id'] as int, |
| instructionPointerReference = |
| obj['instructionPointerReference'] as String?, |
| label = obj['label'] as String, |
| line = obj['line'] as int; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['column'] is! int?) { |
| return false; |
| } |
| if (obj['endColumn'] is! int?) { |
| return false; |
| } |
| if (obj['endLine'] is! int?) { |
| return false; |
| } |
| if (obj['id'] is! int) { |
| return false; |
| } |
| if (obj['instructionPointerReference'] is! String?) { |
| return false; |
| } |
| if (obj['label'] is! String) { |
| return false; |
| } |
| if (obj['line'] is! int) { |
| return false; |
| } |
| return true; |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (column != null) 'column': column, |
| if (endColumn != null) 'endColumn': endColumn, |
| if (endLine != null) 'endLine': endLine, |
| 'id': id, |
| if (instructionPointerReference != null) |
| 'instructionPointerReference': instructionPointerReference, |
| 'label': label, |
| 'line': line, |
| }; |
| } |
| |
| /// Arguments for 'gotoTargets' request. |
| class GotoTargetsArguments extends RequestArguments { |
| /// An optional column location for which the goto targets are determined. |
| final int? column; |
| |
| /// The line location for which the goto targets are determined. |
| final int line; |
| |
| /// The source location for which the goto targets are determined. |
| final Source source; |
| |
| static GotoTargetsArguments fromJson(Map<String, Object?> obj) => |
| GotoTargetsArguments.fromMap(obj); |
| |
| GotoTargetsArguments({ |
| this.column, |
| required this.line, |
| required this.source, |
| }); |
| |
| GotoTargetsArguments.fromMap(Map<String, Object?> obj) |
| : column = obj['column'] as int?, |
| line = obj['line'] as int, |
| source = Source.fromJson(obj['source'] as Map<String, Object?>); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['column'] is! int?) { |
| return false; |
| } |
| if (obj['line'] is! int) { |
| return false; |
| } |
| if (!Source.canParse(obj['source'])) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| if (column != null) 'column': column, |
| 'line': line, |
| 'source': source, |
| }; |
| } |
| |
| /// Response to 'gotoTargets' request. |
| class GotoTargetsResponse extends Response { |
| static GotoTargetsResponse fromJson(Map<String, Object?> obj) => |
| GotoTargetsResponse.fromMap(obj); |
| |
| GotoTargetsResponse({ |
| required Map<String, Object?> body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| GotoTargetsResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['body'] is! Map<String, Object?>) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Arguments for 'initialize' request. |
| class InitializeRequestArguments extends RequestArguments { |
| /// The ID of the debug adapter. |
| final String adapterID; |
| |
| /// The ID of the (frontend) client using this adapter. |
| final String? clientID; |
| |
| /// The human readable name of the (frontend) client using this adapter. |
| final String? clientName; |
| |
| /// If true all column numbers are 1-based (default). |
| final bool? columnsStartAt1; |
| |
| /// If true all line numbers are 1-based (default). |
| final bool? linesStartAt1; |
| |
| /// The ISO-639 locale of the (frontend) client using this adapter, e.g. en-US |
| /// or de-CH. |
| final String? locale; |
| |
| /// Determines in what format paths are specified. The default is 'path', |
| /// which is the native format. |
| final String? pathFormat; |
| |
| /// Client supports the invalidated event. |
| final bool? supportsInvalidatedEvent; |
| |
| /// Client supports memory references. |
| final bool? supportsMemoryReferences; |
| |
| /// Client supports progress reporting. |
| final bool? supportsProgressReporting; |
| |
| /// Client supports the runInTerminal request. |
| final bool? supportsRunInTerminalRequest; |
| |
| /// Client supports the paging of variables. |
| final bool? supportsVariablePaging; |
| |
| /// Client supports the optional type attribute for variables. |
| final bool? supportsVariableType; |
| |
| static InitializeRequestArguments fromJson(Map<String, Object?> obj) => |
| InitializeRequestArguments.fromMap(obj); |
| |
| InitializeRequestArguments({ |
| required this.adapterID, |
| this.clientID, |
| this.clientName, |
| this.columnsStartAt1, |
| this.linesStartAt1, |
| this.locale, |
| this.pathFormat, |
| this.supportsInvalidatedEvent, |
| this.supportsMemoryReferences, |
| this.supportsProgressReporting, |
| this.supportsRunInTerminalRequest, |
| this.supportsVariablePaging, |
| this.supportsVariableType, |
| }); |
| |
| InitializeRequestArguments.fromMap(Map<String, Object?> obj) |
| : adapterID = obj['adapterID'] as String, |
| clientID = obj['clientID'] as String?, |
| clientName = obj['clientName'] as String?, |
| columnsStartAt1 = obj['columnsStartAt1'] as bool?, |
| linesStartAt1 = obj['linesStartAt1'] as bool?, |
| locale = obj['locale'] as String?, |
| pathFormat = obj['pathFormat'] as String?, |
| supportsInvalidatedEvent = obj['supportsInvalidatedEvent'] as bool?, |
| supportsMemoryReferences = obj['supportsMemoryReferences'] as bool?, |
| supportsProgressReporting = obj['supportsProgressReporting'] as bool?, |
| supportsRunInTerminalRequest = |
| obj['supportsRunInTerminalRequest'] as bool?, |
| supportsVariablePaging = obj['supportsVariablePaging'] as bool?, |
| supportsVariableType = obj['supportsVariableType'] as bool?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['adapterID'] is! String) { |
| return false; |
| } |
| if (obj['clientID'] is! String?) { |
| return false; |
| } |
| if (obj['clientName'] is! String?) { |
| return false; |
| } |
| if (obj['columnsStartAt1'] is! bool?) { |
| return false; |
| } |
| if (obj['linesStartAt1'] is! bool?) { |
| return false; |
| } |
| if (obj['locale'] is! String?) { |
| return false; |
| } |
| if (obj['pathFormat'] is! String?) { |
| return false; |
| } |
| if (obj['supportsInvalidatedEvent'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsMemoryReferences'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsProgressReporting'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsRunInTerminalRequest'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsVariablePaging'] is! bool?) { |
| return false; |
| } |
| if (obj['supportsVariableType'] is! bool?) { |
| return false; |
| } |
| return RequestArguments.canParse(obj); |
| } |
| |
| Map<String, Object?> toJson() => { |
| 'adapterID': adapterID, |
| if (clientID != null) 'clientID': clientID, |
| if (clientName != null) 'clientName': clientName, |
| if (columnsStartAt1 != null) 'columnsStartAt1': columnsStartAt1, |
| if (linesStartAt1 != null) 'linesStartAt1': linesStartAt1, |
| if (locale != null) 'locale': locale, |
| if (pathFormat != null) 'pathFormat': pathFormat, |
| if (supportsInvalidatedEvent != null) |
| 'supportsInvalidatedEvent': supportsInvalidatedEvent, |
| if (supportsMemoryReferences != null) |
| 'supportsMemoryReferences': supportsMemoryReferences, |
| if (supportsProgressReporting != null) |
| 'supportsProgressReporting': supportsProgressReporting, |
| if (supportsRunInTerminalRequest != null) |
| 'supportsRunInTerminalRequest': supportsRunInTerminalRequest, |
| if (supportsVariablePaging != null) |
| 'supportsVariablePaging': supportsVariablePaging, |
| if (supportsVariableType != null) |
| 'supportsVariableType': supportsVariableType, |
| }; |
| } |
| |
| /// Response to 'initialize' request. |
| class InitializeResponse extends Response { |
| static InitializeResponse fromJson(Map<String, Object?> obj) => |
| InitializeResponse.fromMap(obj); |
| |
| InitializeResponse({ |
| Capabilities? body, |
| required String command, |
| String? message, |
| required int requestSeq, |
| required int seq, |
| required bool success, |
| }) : super( |
| seq: seq, |
| requestSeq: requestSeq, |
| success: success, |
| command: command, |
| message: message, |
| body: body, |
| ); |
| |
| InitializeResponse.fromMap(Map<String, Object?> obj) : super.fromMap(obj); |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (!Capabilities.canParse(obj['body'])) { |
| return false; |
| } |
| return Response.canParse(obj); |
| } |
| |
| @override |
| Map<String, Object?> toJson() => { |
| ...super.toJson(), |
| }; |
| } |
| |
| /// Properties of a breakpoint passed to the setInstructionBreakpoints request |
| class InstructionBreakpoint { |
| /// An optional expression for conditional breakpoints. |
| /// It is only honored by a debug adapter if the capability |
| /// 'supportsConditionalBreakpoints' is true. |
| final String? condition; |
| |
| /// An optional expression that controls how many hits of the breakpoint are |
| /// ignored. |
| /// The backend is expected to interpret the expression as needed. |
| /// The attribute is only honored by a debug adapter if the capability |
| /// 'supportsHitConditionalBreakpoints' is true. |
| final String? hitCondition; |
| |
| /// The instruction reference of the breakpoint. |
| /// This should be a memory or instruction pointer reference from an |
| /// EvaluateResponse, Variable, StackFrame, GotoTarget, or Breakpoint. |
| final String instructionReference; |
| |
| /// An optional offset from the instruction reference. |
| /// This can be negative. |
| final int? offset; |
| |
| static InstructionBreakpoint fromJson(Map<String, Object?> obj) => |
| InstructionBreakpoint.fromMap(obj); |
| |
| InstructionBreakpoint({ |
| this.condition, |
| this.hitCondition, |
| required this.instructionReference, |
| this.offset, |
| }); |
| |
| InstructionBreakpoint.fromMap(Map<String, Object?> obj) |
| : condition = obj['condition'] as String?, |
| hitCondition = obj['hitCondition'] as String?, |
| instructionReference = obj['instructionReference'] as String, |
| offset = obj['offset'] as int?; |
| |
| static bool canParse(Object? obj) { |
| if (obj is! Map<String, dynamic>) { |
| return false; |
| } |
| if (obj['condition'] is! String?) { |
| return false; |
| } |
| if (obj['hitCondition'] is! String?) { |
|