Fix "oneOf" parsing, update to protocol version 1.58 (#85)
* fix "oneOf" parsing in protocol_gen * update protocol version to 1.58.0
This commit is contained in:
parent
88e8952014
commit
87f8b4a06b
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@
|
||||
// Generated with protocol_gen.go -- do not edit this file.
|
||||
// go run scripts/protocol_gen/protocol_gen.go
|
||||
//
|
||||
// DAP version 1.46.0
|
||||
// DAP version 1.58.0
|
||||
|
||||
#include "dap/protocol.h"
|
||||
|
||||
@ -53,6 +53,12 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(LoadedSourceEvent,
|
||||
DAP_FIELD(reason, "reason"),
|
||||
DAP_FIELD(source, "source"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(MemoryEvent,
|
||||
"memory",
|
||||
DAP_FIELD(count, "count"),
|
||||
DAP_FIELD(memoryReference, "memoryReference"),
|
||||
DAP_FIELD(offset, "offset"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(ModuleEvent,
|
||||
"module",
|
||||
DAP_FIELD(module, "module"),
|
||||
|
@ -15,7 +15,7 @@
|
||||
// Generated with protocol_gen.go -- do not edit this file.
|
||||
// go run scripts/protocol_gen/protocol_gen.go
|
||||
//
|
||||
// DAP version 1.46.0
|
||||
// DAP version 1.58.0
|
||||
|
||||
#include "dap/protocol.h"
|
||||
|
||||
@ -49,6 +49,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ConfigurationDoneRequest, "configurationDone");
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(ContinueRequest,
|
||||
"continue",
|
||||
DAP_FIELD(singleThread, "singleThread"),
|
||||
DAP_FIELD(threadId, "threadId"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(DataBreakpointInfoRequest,
|
||||
@ -68,6 +69,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(DisassembleRequest,
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(DisconnectRequest,
|
||||
"disconnect",
|
||||
DAP_FIELD(restart, "restart"),
|
||||
DAP_FIELD(suspendDebuggee, "suspendDebuggee"),
|
||||
DAP_FIELD(terminateDebuggee,
|
||||
"terminateDebuggee"));
|
||||
|
||||
@ -103,10 +105,14 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(
|
||||
DAP_FIELD(linesStartAt1, "linesStartAt1"),
|
||||
DAP_FIELD(locale, "locale"),
|
||||
DAP_FIELD(pathFormat, "pathFormat"),
|
||||
DAP_FIELD(supportsArgsCanBeInterpretedByShell,
|
||||
"supportsArgsCanBeInterpretedByShell"),
|
||||
DAP_FIELD(supportsInvalidatedEvent, "supportsInvalidatedEvent"),
|
||||
DAP_FIELD(supportsMemoryEvent, "supportsMemoryEvent"),
|
||||
DAP_FIELD(supportsMemoryReferences, "supportsMemoryReferences"),
|
||||
DAP_FIELD(supportsProgressReporting, "supportsProgressReporting"),
|
||||
DAP_FIELD(supportsRunInTerminalRequest, "supportsRunInTerminalRequest"),
|
||||
DAP_FIELD(supportsStartDebuggingRequest, "supportsStartDebuggingRequest"),
|
||||
DAP_FIELD(supportsVariablePaging, "supportsVariablePaging"),
|
||||
DAP_FIELD(supportsVariableType, "supportsVariableType"));
|
||||
|
||||
@ -125,6 +131,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ModulesRequest,
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(NextRequest,
|
||||
"next",
|
||||
DAP_FIELD(granularity, "granularity"),
|
||||
DAP_FIELD(singleThread, "singleThread"),
|
||||
DAP_FIELD(threadId, "threadId"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(PauseRequest,
|
||||
@ -141,15 +148,20 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(RestartFrameRequest,
|
||||
"restartFrame",
|
||||
DAP_FIELD(frameId, "frameId"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(RestartRequest, "restart");
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(RestartRequest,
|
||||
"restart",
|
||||
DAP_FIELD(arguments, "arguments"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(ReverseContinueRequest,
|
||||
"reverseContinue",
|
||||
DAP_FIELD(singleThread, "singleThread"),
|
||||
DAP_FIELD(threadId, "threadId"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(RunInTerminalRequest,
|
||||
"runInTerminal",
|
||||
DAP_FIELD(args, "args"),
|
||||
DAP_FIELD(argsCanBeInterpretedByShell,
|
||||
"argsCanBeInterpretedByShell"),
|
||||
DAP_FIELD(cwd, "cwd"),
|
||||
DAP_FIELD(env, "env"),
|
||||
DAP_FIELD(kind, "kind"),
|
||||
@ -211,14 +223,21 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(StackTraceRequest,
|
||||
DAP_FIELD(startFrame, "startFrame"),
|
||||
DAP_FIELD(threadId, "threadId"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StartDebuggingRequest,
|
||||
"startDebugging",
|
||||
DAP_FIELD(configuration, "configuration"),
|
||||
DAP_FIELD(request, "request"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StepBackRequest,
|
||||
"stepBack",
|
||||
DAP_FIELD(granularity, "granularity"),
|
||||
DAP_FIELD(singleThread, "singleThread"),
|
||||
DAP_FIELD(threadId, "threadId"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StepInRequest,
|
||||
"stepIn",
|
||||
DAP_FIELD(granularity, "granularity"),
|
||||
DAP_FIELD(singleThread, "singleThread"),
|
||||
DAP_FIELD(targetId, "targetId"),
|
||||
DAP_FIELD(threadId, "threadId"));
|
||||
|
||||
@ -229,6 +248,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(StepInTargetsRequest,
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StepOutRequest,
|
||||
"stepOut",
|
||||
DAP_FIELD(granularity, "granularity"),
|
||||
DAP_FIELD(singleThread, "singleThread"),
|
||||
DAP_FIELD(threadId, "threadId"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(TerminateRequest,
|
||||
@ -250,4 +270,11 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(VariablesRequest,
|
||||
DAP_FIELD(variablesReference,
|
||||
"variablesReference"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(WriteMemoryRequest,
|
||||
"writeMemory",
|
||||
DAP_FIELD(allowPartial, "allowPartial"),
|
||||
DAP_FIELD(data, "data"),
|
||||
DAP_FIELD(memoryReference, "memoryReference"),
|
||||
DAP_FIELD(offset, "offset"));
|
||||
|
||||
} // namespace dap
|
||||
|
@ -15,7 +15,7 @@
|
||||
// Generated with protocol_gen.go -- do not edit this file.
|
||||
// go run scripts/protocol_gen/protocol_gen.go
|
||||
//
|
||||
// DAP version 1.46.0
|
||||
// DAP version 1.58.0
|
||||
|
||||
#include "dap/protocol.h"
|
||||
|
||||
@ -85,6 +85,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(
|
||||
DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"),
|
||||
DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"),
|
||||
DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"),
|
||||
DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"),
|
||||
DAP_FIELD(supportTerminateDebuggee, "supportTerminateDebuggee"),
|
||||
DAP_FIELD(supportedChecksumAlgorithms, "supportedChecksumAlgorithms"),
|
||||
DAP_FIELD(supportsBreakpointLocationsRequest,
|
||||
@ -116,14 +117,16 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(
|
||||
DAP_FIELD(supportsRestartRequest, "supportsRestartRequest"),
|
||||
DAP_FIELD(supportsSetExpression, "supportsSetExpression"),
|
||||
DAP_FIELD(supportsSetVariable, "supportsSetVariable"),
|
||||
DAP_FIELD(supportsSingleThreadExecutionRequests,
|
||||
"supportsSingleThreadExecutionRequests"),
|
||||
DAP_FIELD(supportsStepBack, "supportsStepBack"),
|
||||
DAP_FIELD(supportsStepInTargetsRequest, "supportsStepInTargetsRequest"),
|
||||
DAP_FIELD(supportsSteppingGranularity, "supportsSteppingGranularity"),
|
||||
DAP_FIELD(supportsTerminateRequest, "supportsTerminateRequest"),
|
||||
DAP_FIELD(supportsTerminateThreadsRequest,
|
||||
"supportsTerminateThreadsRequest"),
|
||||
DAP_FIELD(supportsValueFormattingOptions,
|
||||
"supportsValueFormattingOptions"));
|
||||
DAP_FIELD(supportsValueFormattingOptions, "supportsValueFormattingOptions"),
|
||||
DAP_FIELD(supportsWriteMemoryRequest, "supportsWriteMemoryRequest"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(LaunchResponse, "");
|
||||
|
||||
@ -167,7 +170,9 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SetDataBreakpointsResponse,
|
||||
"",
|
||||
DAP_FIELD(breakpoints, "breakpoints"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExceptionBreakpointsResponse, "");
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExceptionBreakpointsResponse,
|
||||
"",
|
||||
DAP_FIELD(breakpoints, "breakpoints"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExpressionResponse,
|
||||
"",
|
||||
@ -206,6 +211,8 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(StackTraceResponse,
|
||||
DAP_FIELD(stackFrames, "stackFrames"),
|
||||
DAP_FIELD(totalFrames, "totalFrames"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StartDebuggingResponse, "");
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StepBackResponse, "");
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StepInResponse, "");
|
||||
@ -228,4 +235,9 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(VariablesResponse,
|
||||
"",
|
||||
DAP_FIELD(variables, "variables"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(WriteMemoryResponse,
|
||||
"",
|
||||
DAP_FIELD(bytesWritten, "bytesWritten"),
|
||||
DAP_FIELD(offset, "offset"));
|
||||
|
||||
} // namespace dap
|
||||
|
@ -15,7 +15,7 @@
|
||||
// Generated with protocol_gen.go -- do not edit this file.
|
||||
// go run scripts/protocol_gen/protocol_gen.go
|
||||
//
|
||||
// DAP version 1.46.0
|
||||
// DAP version 1.58.0
|
||||
|
||||
#include "dap/protocol.h"
|
||||
|
||||
@ -83,6 +83,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(
|
||||
DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"),
|
||||
DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"),
|
||||
DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"),
|
||||
DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"),
|
||||
DAP_FIELD(supportTerminateDebuggee, "supportTerminateDebuggee"),
|
||||
DAP_FIELD(supportedChecksumAlgorithms, "supportedChecksumAlgorithms"),
|
||||
DAP_FIELD(supportsBreakpointLocationsRequest,
|
||||
@ -114,17 +115,20 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(
|
||||
DAP_FIELD(supportsRestartRequest, "supportsRestartRequest"),
|
||||
DAP_FIELD(supportsSetExpression, "supportsSetExpression"),
|
||||
DAP_FIELD(supportsSetVariable, "supportsSetVariable"),
|
||||
DAP_FIELD(supportsSingleThreadExecutionRequests,
|
||||
"supportsSingleThreadExecutionRequests"),
|
||||
DAP_FIELD(supportsStepBack, "supportsStepBack"),
|
||||
DAP_FIELD(supportsStepInTargetsRequest, "supportsStepInTargetsRequest"),
|
||||
DAP_FIELD(supportsSteppingGranularity, "supportsSteppingGranularity"),
|
||||
DAP_FIELD(supportsTerminateRequest, "supportsTerminateRequest"),
|
||||
DAP_FIELD(supportsTerminateThreadsRequest,
|
||||
"supportsTerminateThreadsRequest"),
|
||||
DAP_FIELD(supportsValueFormattingOptions,
|
||||
"supportsValueFormattingOptions"));
|
||||
DAP_FIELD(supportsValueFormattingOptions, "supportsValueFormattingOptions"),
|
||||
DAP_FIELD(supportsWriteMemoryRequest, "supportsWriteMemoryRequest"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(CompletionItem,
|
||||
"",
|
||||
DAP_FIELD(detail, "detail"),
|
||||
DAP_FIELD(label, "label"),
|
||||
DAP_FIELD(length, "length"),
|
||||
DAP_FIELD(selectionLength, "selectionLength"),
|
||||
@ -160,6 +164,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(VariablePresentationHint,
|
||||
"",
|
||||
DAP_FIELD(attributes, "attributes"),
|
||||
DAP_FIELD(kind, "kind"),
|
||||
DAP_FIELD(lazy, "lazy"),
|
||||
DAP_FIELD(visibility, "visibility"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(ValueFormat, "", DAP_FIELD(hex, "hex"));
|
||||
@ -197,6 +202,15 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(Module,
|
||||
DAP_FIELD(symbolStatus, "symbolStatus"),
|
||||
DAP_FIELD(version, "version"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(LaunchRequestArguments,
|
||||
"",
|
||||
DAP_FIELD(restart, "__restart"),
|
||||
DAP_FIELD(noDebug, "noDebug"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(AttachRequestArguments,
|
||||
"",
|
||||
DAP_FIELD(restart, "__restart"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(Scope,
|
||||
"",
|
||||
DAP_FIELD(column, "column"),
|
||||
@ -283,8 +297,12 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(StackFrameFormat,
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StepInTarget,
|
||||
"",
|
||||
DAP_FIELD(column, "column"),
|
||||
DAP_FIELD(endColumn, "endColumn"),
|
||||
DAP_FIELD(endLine, "endLine"),
|
||||
DAP_FIELD(id, "id"),
|
||||
DAP_FIELD(label, "label"));
|
||||
DAP_FIELD(label, "label"),
|
||||
DAP_FIELD(line, "line"));
|
||||
|
||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(Thread,
|
||||
"",
|
||||
|
@ -152,6 +152,7 @@ type definition struct {
|
||||
Description string `json:"description"`
|
||||
Properties properties `json:"properties"`
|
||||
Required []string `json:"required"`
|
||||
OneOf []*definition `json:"oneOf"`
|
||||
AllOf []*definition `json:"allOf"`
|
||||
Ref string `json:"$ref"`
|
||||
OpenEnum []string `json:"_enum"`
|
||||
@ -486,6 +487,28 @@ func (r *root) getType(def *definition) (builtType cppType, err error) {
|
||||
return ref.def.cppType, nil
|
||||
}
|
||||
|
||||
if len(def.OneOf) != 0 {
|
||||
args := []string{}
|
||||
deps := []cppType{}
|
||||
for i := 0; i < len(def.OneOf); i++ {
|
||||
if def.OneOf[i] == nil {
|
||||
return nil, fmt.Errorf("Item %d in oneOf is nil", i)
|
||||
}
|
||||
|
||||
elTy, err := r.getType(def.OneOf[i])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
deps = append(deps, elTy)
|
||||
args = append(args, elTy.Name())
|
||||
}
|
||||
return &cppBasicType{
|
||||
name: "variant<" + strings.Join(args, ", ") + ">",
|
||||
desc: def.Description,
|
||||
deps: deps,
|
||||
}, nil
|
||||
}
|
||||
|
||||
v := reflect.ValueOf(def.Ty)
|
||||
|
||||
if v.Kind() == reflect.Interface {
|
||||
|
Loading…
x
Reference in New Issue
Block a user