-
Notifications
You must be signed in to change notification settings - Fork 11
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
Dape compatibility #95
base: master
Are you sure you want to change the base?
Conversation
With https://github.com/svaante/dape, I run into issues in termination phase when connected via `attach` request. When I looked at implementations of DAP in other languages (llvm), they report `supportsTerminateRequest` as false, so that the DAP client doesn't try to send the termination request, that currently seems to have an undefined behavior when attached. After this change, I'm able to run the following code to start the server I can attach to from dape: ``` session = DebugAdapter.DebugSession(conn) session.capabilities.supportsTerminateRequest = false DebugAdapter.run(session) ```
In DAP protocol, the arguments key is optional. With dape, I run into issues when in this case, the DebugAdapter has failed with: ``` ERROR: KeyError: key "arguments" not found Stacktrace: [1] getindex @ ./dict.jl:498 [inlined] [2] dispatch_msg(x::DebugAdapter.DAPRPC.DAPEndpoint{Sockets.TCPSocket, Sockets.TCPSocket}, dispatcher::DebugAdapter.DAPRPC.MsgDispatcher, msg::Dict{String, Any}) @ DebugAdapter.DAPRPC ~/active/projects/julia/DebugAdapter.jl/src/DAPRPC/typed.jl:86 [3] (::DebugAdapter.var"#132#161"{Dict{String, Any}, Nothing, DebugAdapter.DAPRPC.MsgDispatcher, DebugAdapter.DAPRPC.DAPEndpoint{Sockets.TCPSocket, Sockets.TCPSocket}})() @ DebugAdapter ~/active/projects/julia/DebugAdapter.jl/src/packagedef.jl:134 ``` Also, for optional fields, the dape client sometimes sends null values instead of omitting the key. Making the code a big more defensive sounds like good idea and if fixes the issue for me.
Use DebugAdapter.jl + dape to provide debugging capabilities from repl. Requires julia-vscode/DebugAdapter.jl#95 to be merged first.
I tried to understand what this would fix, but I'm not succeeding :) I think the idea here is that we don't handle some message correctly that could contain a |
A sepecific case that I've hit was originated here https://github.com/svaante/dape/blob/master/dape.el#L2418 (but there are other similar cases). I first meant to send a PR to dape to use boolean instead, but then, when looking at the specification https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Disconnect, there is a difference between false value and null/missing key (letting the implementation to make a choice). Given dape works fine with other DAP implementations, making the code here a bit more resilient looked like a better approach. |
I don't think sending |
You are right. Not TypeScripter myself, but given the DAP protocol is defined via TS, it seems it doesn't like I will need to send a PR to dape to fix that. Note the issue with
Would the other changes be acceptable, any changes suggested there? |
Can you explain a bit more why that would be useful? In my mind the list of supported features is kind of hard coded simply by the choice of what features we implement?
So, I think technically that is already supported, albeit in a bit of an inconsistent way.
Union{T,Nothing} . Having said that, I guess it would actually be more consistent to use Missing instead there, as we have used that throughout for the ? TypeScript case.
|
The particular case I've hit was at the end of Thanks for the pointers about the alternative way of handling the missing arguments, I will try looking at leveraging that approach. |
When trying to get DebugAdapter running with https://github.com/svaante/dape, I came across some issues and capabilities I needed to support it fully, both with
launch
andattach
requests.