You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement support for startDebugging in Eclipse LSP4E, using the dapDebugServer.js build by vscode-js-debug.
But after many attempts, I didn't yet manage to figure out from the spec and the code what should be done to properly handle the startDebugging request.
The specification mentions "debug session", but what is a "debug session" exactly? Particularly, how do I start a new "debug session"? Should I send initialized again, or send only launch; should I reuse the same connection or spawn a new debug adapter...? It would be great if the spec could clarify when does a new debug session start, and how to start one as a reaction of startDebugging.
But after many attempts, I didn't yet manage to figure out from the spec and the code what should be done to properly handle the startDebugging request.
Particularly, how do I start a new "debug session"? Should I send initialized again, or send only launch; should I reuse the same connection or spawn a new debug adapter...?
You just have to go to each and every server vendor and ask their interpretation, which differs depending on their particular interpretation.
vscode-js-debug: you should connect to the same socked, and initialise as normal. You should not start a new instance of adapter (though, the authors agree you could based on the spec)
debugpy: you must dive into the opaque data and implement a vscode-specific bit of logic. You must not start a new debug adapter instance, like the spec says you should, you must always connect to the host/port via TCP that you pulled out of the opaque data in a completely server-specific way.
There may be others, I've not seen them.
So, in short, while I think the spec is actually very clear about what clients must do, the implementations don't actually implement that, despite the long and tedious discussion that we all had about this on the original proposal.
Should I send initialized again, or send only launch
this is easy to answer. You should perform the full sequence as if a completely independent debug adapter, i.e. you should send initilialze,get response, sent launch (or attach depending on the startDebugging request), and the usual breakpoints, initializationDone, etc. dance.
this is easy to answer. You should perform the full sequence as if a completely independent debug adapter
OK thanks. It was my first interpretation from the spec; so it looks like the spec is clear enough on what to send; what is less clear is where or how to send it; and it looks like this remain adapter-specific.
The issue you link are closed. Would it make sense to open a new one to make the spec clearer on how both server and clients should handle multi-sessions instead and fill the gap so there is no more room for interpretation?
I agree that further clarification is required in the spec, as the only 2 implementations I've seen so far don't seem to agree on its interpretation, and at least 3 independent client authors (including you and me) struggled to get them working.
Activity
puremourning commentedon Apr 14, 2023
You're not the only one.
You just have to go to each and every server vendor and ask their interpretation, which differs depending on their particular interpretation.
There may be others, I've not seen them.
So, in short, while I think the spec is actually very clear about what clients must do, the implementations don't actually implement that, despite the long and tedious discussion that we all had about this on the original proposal.
puremourning commentedon Apr 14, 2023
this is easy to answer. You should perform the full sequence as if a completely independent debug adapter, i.e. you should send initilialze,get response, sent launch (or attach depending on the startDebugging request), and the usual breakpoints, initializationDone, etc. dance.
So each "session" is completely independent.
mickaelistria commentedon Apr 14, 2023
OK thanks. It was my first interpretation from the spec; so it looks like the spec is clear enough on what to send; what is less clear is where or how to send it; and it looks like this remain adapter-specific.
The issue you link are closed. Would it make sense to open a new one to make the spec clearer on how both server and clients should handle multi-sessions instead and fill the gap so there is no more room for interpretation?
puremourning commentedon Apr 14, 2023
I agree that further clarification is required in the spec, as the only 2 implementations I've seen so far don't seem to agree on its interpretation, and at least 3 independent client authors (including you and me) struggled to get them working.