-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: various debug fixes and VS Code compatibility enhancements #11984
Conversation
15fdf2a
to
90f99b0
Compare
Hi, is there any update on this PR? Can somebody please help with the review? Thank you! |
- feat: added support for `debug/toolbar` and `debug/variables/context`, - feat: added support for `debugState` when context (eclipse-theia#11871), - feat: can customize debug session timeout, and error handling (eclipse-theia#11879), - fix: the `debugType` context that is not updated, - fix: `configure` must happen after receiving capabilities (eclipse-theia#11886), - fix: added missing conext menu in the _Variables_ view, - fix: handle `setFunctionBreakboints` response with no `body` (eclipse-theia#11885), - fix: `DebugExt` fires `didStart` event on `didCreate` (eclipse-theia#11916), - fix: validate editor selection based on the text model (eclipse-theia#11880) Closes eclipse-theia#11871 Closes eclipse-theia#11879 Closes eclipse-theia#11885 Closes eclipse-theia#11886 Closes eclipse-theia#11916 Closes eclipse-theia#11880 Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
@marcdumais-work and @JonasHelming, could you please help move this PR forward? We at Arduino would like to get these fixes in Theia. Could you tell me the procedure for contacting other interested parties in the verification? Something like the community did here: #10333. Thank you! |
In my case (Ubuntu) pressing F5 will trigger the error in the devConsole, is it expected? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First reading of the code with some suggestions and questions.
/** | ||
* Invoked when sending the `terminate` request to the debugger is rejected or timed out. | ||
*/ | ||
protected handleTerminateError(err: unknown): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces new API, and I don't really see why. What's the use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will help downstream to customize the error handling without overriding the entire stop
method and copy-pasting code from Theia to downstream. This generally simplifies the Theia version bumps for extenders.
What's the use case?
I can add dummy customization to the api-samples
extension.
Thank you!
No. It does not. I see that the For the time being, I have opened an issue and will provide a workaround against the negative integer properties: microsoft/vscode-mock-debug#85. |
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Thanks a lot for the help! I pushed some changes based on the API review and also added a workaround for the |
The collection of contributed commands was written in a convoluted way, this commit makes it more straightforward with just 2 loops.
The ternary implementation is stricly equivalent to the `Math.max` function, so use that instead.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code now LGTM after some rewrites, changes work as described.
:) Thanks for the help |
@thegecko, would you be interested in checking if this PR does not break anything with your debug adapter as you did here: #10333 (review). Thank you! |
I can |
OK, browser-based debug has been broken in the latest (1.33.0 release). I need to investigate this before checking your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this changeset hasn't broken Arm's browser debugger, but haven't tested the additional functionality.
By the way @kittaakos please reach out if you want any information with testing the browser-based arm debugger yourself: |
@thegecko would it be possible to design some tests that would break when we break front end debugging? Or are the breakages to diverse? |
I was thinking about this. One key thing which often breaks browser debugging is accidental inclusion of node libraries. I'd hope we can mitigate that at build time with the correct webpack configs. I wonder if a simple inline debug adapter test harness could be created (perhaps based on mock-debug) which could be used to test the UI in browser mode? |
@paul-marechal Do you plan on merging this before the release? |
- revert debug feature patching (eclipse-theia/theia#11984) - revert menu ordering hack (eclipse-theia/theia#8377) Signed-off-by: Akos Kitta <[email protected]>
What it does
debug/toolbar
anddebug/variables/context
,debugState
when context (vscode: add support fordebug/toolbar
,debug/variables/context
menus contribution anddebugState
when
clause context #11871),vscode-mock-debug
#11879),debugType
context that was not updated on session stop,configure
must happen after receiving capabilities ([debug]: Debug session might be configured with an empty capabilities object #11886),setFunctionBreakboints
response with nobody
([debug] Theia does not stop on breakpoints with the debugger provided by thevscode.mock-debug
extension #11885),DebugExt
firesdidStart
event ondidCreate
([debug] debug-ext prematurely firesdidStart
event ondidCreate
#11916),"stopOnEntry": true
in thelaunch.json
#11880)Closes #11871
Closes #11879
Closes #11885
Closes #11886
Closes #11916
Closes #11880
How to test
vscode.mock-debug
extension from my fork: https://github.com/kittaakos/vscode-mock-debug/blob/theia/mock-debug-0.51.0.vsix. Here is the diff with the changes from the upstream version: microsoft/vscode-mock-debug@main...kittaakos:vscode-mock-debug:theia../vscode-mock-debug/sampleWorkspace
folder as a workspace in Theia. There is a readme file in it and thelaunch.json
in the.vscode
folder.readme.md
opens, and the top stack frame is the first line of the readme file. Check theDevTools
console; there is noError: Illegal value for lineNumber
. (#11880)debug_001.mp4
debugType
anddebugState
dependent content menu from the VSIX. Click on it. It works. You also see two additional debug toolbar items—one with the ❤️codicon
and the other with text. Click on them, and both work. (#11871)debug_002.mp4
For reviewers:
This 👆 requires a more complex setup and another VSIX (
marus25.cortex-debug-1.5.1.vsix
from https://downloads.arduino.cc/marus25.cortex-debug/marus25.cortex-debug-1.5.1.vsix). The fix cannot be verified with themock-debug
extension. Also, I used a physical board (Arduino Zero) where the code runs. The code runs on the device, and the debugger talks to it via dgb. I am happy to provide the steps to set up the toolchain, but the board is needed. Let me know it's required.Review checklist
Reminder for reviewers