-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Breakpoint contains empty source
#66
Comments
I haven't checked other types in this repository, but I can look up if this is also an issue elsewhere. |
Thanks for the bug report. |
The spec is a bit vague, but I think it's there:
Taken together, I think it makes sense to read it as "when present, the source field updates existing values". Note: All fields in the |
Thanks @corneliusweig for helping with interpreting the spec (cc @weinand to confirm the interpretation of the breakpoint I guess the proposed change will affect only the shape of the messages produced by debug adapter (e.g. Delve), and clients (e.g. VS Code) will continue to work with old/new versions of Delve. So, the impact on the Delve and editors that use Delve DAP is not concerning once There are a couple of debug adapters using go-dap outside Delve https://pkg.go.dev/github.com/google/go-dap?tab=importedby From my quick search, I believe they can quickly resolve the incompatibility when they upgrade the dependencies. IMO the change to fix the bug is acceptable, but I want to hear opinion from @polinasok @suzmue @aarzilli @derekparker |
I agree that fixing this bug makes sense. Some initial investigation in the vscode source VS Code seems that it handles undefined differently than zero (https://github.com/microsoft/vscode/blob/9dba5385c7aefebe3756ed413da7fedf1868a71c/src/vs/workbench/contrib/debug/common/debugModel.ts#L966). Delve does not yet use BreakpointEvents to update breakpoints. Delve sends all information about breakpoints through the response to the setBreakpoints requests. |
Thank you! I tentatively created a PR for this trivial change. If this is fixed for
|
The DAP client may distinguish between a nil source and an empty source, clearing the source information if it is present and empty. Make the Source field on the breakpoint a pointer since it is optional. Fixes google#66
This updates the gentypes to make the Source field of Breakpoint a pointer in the generated Go types. For google#66
* go.mod: update github.com/google/go-dap to v0.7.0 Updates google/go-dap#66 * Run go mod tidy
The Breakpoint is defined as
It says
"source,omitempty"
, but an empty object is serialised as:This means that
BreakpointEvent
types with missing source are serialised with an empty source object, which clears the breakpoint location in the UI.Can the
Source
field be changed to a pointer field instead?The text was updated successfully, but these errors were encountered: