Skip to content
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

Debug Transient State gets closed. #72

Open
prochri opened this issue Nov 27, 2022 · 4 comments
Open

Debug Transient State gets closed. #72

prochri opened this issue Nov 27, 2022 · 4 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation upstream Issues related to upstream dependencies

Comments

@prochri
Copy link

prochri commented Nov 27, 2022

Bug description

I am trying to create a debug transient state to help me debug. When I start debugging and trigger the step over command, the menu reappears for a short menu but then disappears, leaving me outside of the transient menu.

To Reproduce

  1. Add a which key transient menu, like this:
    "whichkey.transient": {
        "debug": {
            "title": "Debug transient",
            "bindings": [
                {
                    "key": "s",
                    "name": "Step over",
                    "icon": "debug-step-over",
                    "command": "workbench.action.debug.stepOver"
                }
// [...]
  1. Start debugging and stop at a breakpoint
  2. Open the transient menu
  3. Press 's' to step over

Expected behavior

The menu should be active after the step over is completed.

@prochri prochri added the bug Something isn't working label Nov 27, 2022
@stevenguh
Copy link
Member

Will take a look in a few weeks, I remembered I tried this a while back and something stopped me from using transient for the debug menu.

@stevenguh
Copy link
Member

Tinkering with waiting additional delay after command execution or with ignoreFocusOut option of QuickPick API.

I think this is what's happening...

  1. Awaiting workbench.action.debug.* only issue the command to LSP
  2. which-key then display the QuickPick menu.
  3. LSP comes back and steals the focus; hence, closes the QuickPick menu.

A workaround is to add some delay to each command, but this is not that reliable as the delay is probably from the LSP.

@stevenguh stevenguh added the upstream Issues related to upstream dependencies label Mar 4, 2023
@prochri
Copy link
Author

prochri commented Oct 10, 2023

I played around with this again trying to find a solution by tracking the DAP (not LSP when nitpicking!) state. While this kind of worked sometimes, I found a much better solution:

Setting the VSCode option debug.focusEditorOnBreak to false, should make the transient menu workas is in my initial tests!

@prochri prochri closed this as completed Oct 10, 2023
@stevenguh
Copy link
Member

Interesting found! Reopen this for future investigation and then if that works well maybe update the default binding and documentations

@stevenguh stevenguh reopened this Oct 11, 2023
@stevenguh stevenguh added the documentation Improvements or additions to documentation label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation upstream Issues related to upstream dependencies
Projects
None yet
Development

No branches or pull requests

2 participants