vscode-statusbar-debugger icon indicating copy to clipboard operation
vscode-statusbar-debugger copied to clipboard

Support compound debugging

Open nvmkpk opened this issue 7 years ago • 17 comments

Here is my launch.json file:

{
    // Use IntelliSense to learn about possible Node.js debug attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Server",
            "program": "${workspaceRoot}/startup.js"
        },
        {
            "type": "chrome",
            "request": "launch",
            "name": "Client",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceRoot}"
        }
    ],
    "compounds": [
        {
            "name": "Application",
            "configurations": ["Server", "Client"]
        }
    ]
}

The default debugger toolbar shows a dropdown to switch the context between 'Server' and 'Client'. This is missing in the status bar when this extension is installed.

nvmkpk avatar Aug 24 '17 23:08 nvmkpk

I'm not sure I understood it correctly, do you basically want a dropdown for switching context in the statusbar?

fabiospampinato avatar Aug 24 '17 23:08 fabiospampinato

@nvmkpk is this the dropdown you're talking about?

screen shot 2017-08-26 at 16 58 23

fabiospampinato avatar Aug 26 '17 14:08 fabiospampinato

Got it, I think you're actually talking about this:

screen shot 2017-08-26 at 16 59 51

Unfortunately there's no way to currently implement this since VSC doesn't expose this kind of information via the API, I opened an issue about it, maybe if you drop a ":+1:" there they'll put more effort into fixing it (https://github.com/Microsoft/vscode/issues/30810).

fabiospampinato avatar Aug 26 '17 15:08 fabiospampinato

Can you please look into this again?

Previously VSC didn't do anything when selecting a running debugger in the Call Stack. But now it does in fact switch the focus:

Maybe they did expose it already?

Also it would be cool if the said select was embedded into the extension logo button. Right now clicking on it stops the current debugger. What good 2 stop buttons are?

Thank you.

Spown avatar Mar 04 '18 17:03 Spown

Also, semiunrelated minirequest:

Can you make the button assume the longest debugger name (i.e. make it's width static as long as no new debuggers are added or present ones stopped), so that the following control buttons wouldn't jump left and right?

Spown avatar Mar 04 '18 17:03 Spown

@Spown unfortunately they still haven't exposed information about compound debugging. Also there's no API for adding a "select" element in the statusbar. The way I imagine it would work is that a quickpick would get opened that would allow you to switch debugger.

The first button is a "toggle" button, so it will start or stop debugging, depending on the situation. The other stop button is there for consistency, you can hide it with the "statusbarDebugger.actions" setting if you want.

Can you open a separate issue about the button's width?

fabiospampinato avatar Mar 04 '18 17:03 fabiospampinato

The first button is a "toggle" button, so it will start or stop debugging, depending on the situation.

"is" or "will"? Right now in a compound debugging it stops the selected one and when pressed again on the remaining one it calls the pallette to choose a debugger to run (just like in case when no debuggers are running).

Spown avatar Mar 04 '18 17:03 Spown

"is" or "will"?

I'm not sure I understood this. If there's a session running and you click the button it will stop the session, if there's no session running and you click the button it will start a new session (possibly asking you which configuration to use, if there are more than 1). You can customize this via the statusbarDebugger.command setting.

fabiospampinato avatar Mar 04 '18 17:03 fabiospampinato

"is" or "will"? I'm not sure I understood this.

I didn't know what are you were referring to. How it is (you think) it works right now or how it will be when (if) the requested feature will be implemented.

If there's a session running and you click the button it will stop the session, if there's no session running and you click the button it will start a new session (possibly asking you which configuration to use, if there are more than 1)

Ok, so no it's clear. This is not what's happening. If I have a compound session of 2 debuggers running:

  • click on the button -> stops the currently selected one and the other one gets selected
  • clicking on the button (that now has the name of the remaining debugger) doesn't stop it -> it calls the palette to chose what debugger to run

Spown avatar Mar 04 '18 18:03 Spown

Does clicking the "stop" icon in the default floating debugger toolbar actually stop both debuggers?

fabiospampinato avatar Mar 04 '18 19:03 fabiospampinato

yes, these controls work perfectly fine.

Spown avatar Mar 04 '18 19:03 Spown

Then I would consider this a bug. I'll see what I can do about it.

fabiospampinato avatar Mar 04 '18 20:03 fabiospampinato

@Spown I should have fixed the problem you reported in v1.4.1. I can't fix the rest since they still haven't exposed more state about compound debugging.

fabiospampinato avatar Apr 28 '18 00:04 fabiospampinato

Thank you. But I still can't see how it is useful right now... It's effectively yet another stop button. Wouldn't it make more sense to make it call the top palette with the debuggers to choose regardless of the state - make it more akin to the standard debugger dropdown select & run widget?

Spown avatar Apr 28 '18 09:04 Spown

If you're talking about the default statusbar item for launching a debug configuration, I've stated here why I don't like the way it works.

I think this extension currently works the way it's supposed to, but it doesn't support compound configurations, this will be fixed as soon as they expose the necessary state, you may want to drop a comment here.

You can hide the actual stop button via the settings if you like.

fabiospampinato avatar Apr 28 '18 10:04 fabiospampinato

Also a suggestion in case the API was implemented during our lifetimes: In addition to select/dropdown of the running debugger sessions let the bug icon cycle-switch through them.

This would be particularly useful in case of just 2 running debuggers, which is a very common setup. This would probably require splitting statusbarDebugger.command in two - one is for when nothing is running and one when at least one is already runng. The first one is pretty much the current statusbarDebugger.command. For the later the default setting would be to stop the currently selected running debugger (for the lagacy reasons), another setting would be calling for the running debugger selector and the third one - for cycling through them.

Thank you.

Spown avatar Feb 07 '19 18:02 Spown

@Spown Unfortunately it doesn't look like they have any interest in implementing this https://github.com/Microsoft/vscode/issues/30810

fabiospampinato avatar Feb 07 '19 19:02 fabiospampinato