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.debug.startDebugging should support named automatic (dynamic) and global (user settings) debug configurations #109083
Comments
@isidorn is there any reason why dynamic and user launch configs are not supported? |
They are not supported because we did not implement it. I do not think there are any real blockers. However there are open questions: So the idea would be that calling Dynamic launch configurations: how would we know which debug extension you are reffering to? If you just pass the NAME we would have to ask for dynamic configurations from each adapter and see if any of the returned configurations match the NAME? |
@isidorn both suggestions make sense. |
That sounds reasonable to me, yes.
One might turn the By the way, I noticed now that launch configurations can also be added from So maybe my alternative approach is the better suited one:
With this, the developer would pull all (including dynamic, if optionally requested) debug configurations, pick the one they want, and pass that to I don't care to much about the exact solution, but I would like to be able to programmatically start all debug configurations that the user can start, and that does not seem possible currently. |
Please note that there is no deterministic way to enumerate "all dynamic launch configs" because they depend on the context. |
Good point. I am thinking about a user command that would enumerate these configs, so maybe there is a way to pass on that command's context to the enumeration; or maybe enumeration simply uses the current GUI context. |
the "context" for a dynamic launch config is "everything that is available to an extension". So it is unbounded and not known in advance. |
I understand this as "there is no one
When an extension's command is called, it can enumerate (in each call) all possible debug configurations at this point in time. (It does not need to be "deterministic" in the sense that I would enumerate them only once and cache them.) This should mirror pretty much what the user would see it the used the "Run" dropdown at that same point in time, shouldn't it? |
If an extension tries to enumerate "all possible debug configurations at this point in time" it has to activate all extensions that provide dynamic launch configs. This is costly because many extensions download big amounts of additional code and data on activation. Doing all of this only to get a list of "all possible launch configs" is a waste of time and effort. VS Code's UI (= "Debug: Select and Start debugging") in this area is different: only statically available launch configs are listed. For dynamic launch configs we only list the extensions that provides them. Only if a user explicitly selects an extension, VS Code activates and asks the extension to provide the dynamic launch configs. So instead of activating all extensions, typically none or only one is activated. |
Thanks, I understand that. Still:
|
@bersbersbers please consider a quicker way to select a launch config: When working with a script file in programming language A (R), just press F1, then type "Select..." and pick the "Select and Start debugging" action. In the QuickPick either
When doing this another time, the last selected launch config will show up at the top of the list without having to go through the two step process again. |
Thank you for this suggestion. Unfortunately, in terms of usability, this (F1, "sel", Enter, searching for the right entry and using arrow keys [note that omnibox filtering does not apply to names of extensions with dynamic debug configurations], Enter) is lightyears away from simply pressing F5. |
Sure, my suggestion was not meant to be a quicker replacement for "F5".
And after having done this once, both dynamic launch configs (for R and for Python) will appear as "recent" entries in the "Select and Start debugging" quickpick, and can be found with name filtering. I don't see how your imaginary extension can be "lightyears ahead" of this... But anyway. We do not have any plans do provide API for enumerating dynamic launch configs. |
I see. Well, I find both too elaborate for repeated daily use. Sure, I see why it's acceptable out of the box, and why you don't want to spend resources on exposing such (GUI) functionality. But the fact that I cannot even write my own extension for a shortcut is somewhat disappointing.
This is not the case for me, neither 1 nor 2:
But even if it were ...
... an extension could provide a command that picks the best-matching (by whatever criteria, configurable or not) out of the available debug configurations and runs that. Always assuming that all debug configurations accessible by the user through the GUI can also be accessed programmatically...
... and since that is not (planned to be) the case, of course an extension cannot do this (completely). It would be great to at least have support for global and workspace launch configurations, though. |
This is a bug (or an incomplete implementation). I have create issue #110009 for this.
yes, that's the reason why we will leave this issue open. |
It seems to me that the new
I do wonder: the release notes for 1.15 said
Is this statement still true?
|
@bersbersbers yes, the new "startDebugging" verb of the "serverReadyAction" is restricted. @connor4312 we need to document this. |
I'd like to use
vscode.debug.startDebugging
to switch between debuggers (compare #97921, where the proposed solution is to write an extension - I'd like to try this).Unfortunately,
vscode.debug.startDebugging
is restricted to named configurations fromlaunch.json
files: that means, global (a.k.a. user settings)launch
configurations are not supported, and neither are automatic (a.k.a. dynamic) debug configurations. This is according to the documentation here:https://code.visualstudio.com/api/references/vscode-api#debug
A similar request has been made in #77782, but that was hidden in an issue about very specific compound configurations. The core issue is much broader.
Alternatively, there should be a way to query all debug configurations available to the user in the Run dropdown, without having to parse all possible
json
files.The text was updated successfully, but these errors were encountered: