-
Notifications
You must be signed in to change notification settings - Fork 185
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
vscode-mock-debug
sends StackFrame#column: 0
response although the debug client sends columnsStartAt1: true
for initialize
#85
Comments
1 task
kittaakos
pushed a commit
to kittaakos/theia
that referenced
this issue
Jan 18, 2023
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
paul-marechal
added a commit
to eclipse-theia/theia
that referenced
this issue
Jan 24, 2023
* fix: various debug fixes and VS Code compatibility enhancements - feat: added support for `debug/toolbar` and `debug/variables/context`, - feat: added support for `debugState` when context (#11871), - feat: can customize debug session timeout, and error handling (#11879), - fix: the `debugType` context that is not updated, - fix: `configure` must happen after receiving capabilities (#11886), - fix: added missing conext menu in the _Variables_ view, - fix: handle `setFunctionBreakboints` response with no `body` (#11885), - fix: `DebugExt` fires `didStart` event on `didCreate` (#11916), - fix: validate editor selection based on the text model (#11880) Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: use when context for command node filtering Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * chore: removed test debug VSIX Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: revert `timeout` check Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: clarification on the possible `'debugState'` Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: use hard-coded debugger `clientID` and `clientName` Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: use review-requested method name Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: changed method name + added doc Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: `stopTimeout` is a default `ctor` argument Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: incorrect method name Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: both `didCreate` and `didStart` must be API Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: call both on create and start Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * fix: workaround for microsoft/vscode-mock-debug#85 Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * simplify writing The collection of contributed commands was written in a convoluted way, this commit makes it more straightforward with just 2 loops. * use `Math.max` to clamp values into positives The ternary implementation is stricly equivalent to the `Math.max` function, so use that instead. * fix default option value handling Assigning a default option object to set default values is problematic as said default values will be discarded if any option object is passed. Instead default values must be handled in conjuction of whatever options are passed to functions. Signed-off-by: Akos Kitta <a.kitta@arduino.cc> Co-authored-by: Paul Maréchal <paul.marechal@ericsson.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi There,
This is more like a question, but I could not get my head around whether
vscode-mock-debug
violates the DAP constraints or not. Please help to figure out if this sample adapter implementation behaves correctly.When I start the
Debug readme.md
launch configuration on thesampleWorkspace
as described in the docs, I can see that the debugger will send the following response for the'stackTrace'
request back to the client:StackFrame#column from the specs:
Since my debug client is initialized with
linesStartAt1: true
andcolumnsStartAt1: true
, I would expect that the debugger won't send0
if thesource
is available.This is not a problem in VS Code because the range to reveal is adjusted based on the backing
ITextModel
before dispatching therevealRange
API call.0
will be mapped to1
. So there are no errors if"stopOnEntry": true
is in thelunach.json
and the debugger starts and stops at the entry point.But there are other implementations. For example, in Eclipse Theia, the client knows that the debug sessions are initialized with
linesStartAt1: true
andcolumnsStartAt1: true
and will expect 1-basedline
andcolumn
values as defined in the specs. Theia will map the position of the StackFrame to an LSP (0-based) position, then when revealing the range in themonaco
editor, Theia will convert the 0-based LSP position to a 1-basedmonaco
position. Unfortunately, it does not work reliably as thevscode-mock-debug
unexpectedly sendscolumn: 0
althoughcolumnsStartAt1: true
.One can argue that it's the client's responsibility to map the
Position
of the stack frame to the appropriate one, and I have tried to "repair" the position based on theITextModel
, but it does not work. For example, a{ line: 0, character: -1 }
is not a validPosition
in the LSP word, as the properties must be unsigned integers.Question:
Is the
vscode-mock-debugger
DAP compliant when it's using the defaultcol: number = 0
0 value for the column when creating theStackFrame
instance here:vscode-mock-debug/src/mockDebug.ts
Line 386 in 95d0052
Thank you!
The text was updated successfully, but these errors were encountered: