You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(Discussion) Possible to launch multiple debuggers? #4507
I'm interested in understanding what it would take to be able to run multiple debuggers at once in the same vscode instance.
For example, simultaneously debugging a rails app's ruby code (eg, with the recently featuredruby debugger) and its javascript code (eg, with vs-chrome-debug). I'm envisioning breakpoints in both server and client code, with the respective debugger handling the respective file types.
How feasible is this? What kind of undertaking would it be to be able to activate more than one launch.json configuration entry at once?
factormystic you can run multiple debuggers easily by opening more VS Code windows. Every window supports one debugger. The only limitation is that you cannot run more than one debugger from a single project folder, because VS Code doesn't allow you to open a project folder in more than one window (we are planning to lift the limitation).
But there is a simple workaround: create sub folders in your project folder and open these in different VS Code windows.
I'm aware that it should be possible with multiple instances, by awkwardly opening different folders. That's kind of a hack and not particularly exciting, even though it is possible.
The really exciting thing is the prospect of being able to run multiple debuggers at once in the same vs code instance, as I said.
Much like it would not be very exciting if VS Code only allowed one type of syntax highlighting per instance, but instead loads separate syntax highlighting per file type.
So again the question is, what kind of difficulties would be associated with launching a debugger not exclusively in a VS Code instance, but basically on a per file type (or other) basis?
factormystic VS Code supports one window and one extension host process per renderer:
The VS Code debugger could easily manage multiple debug adapters, however they all would have to live in one window. Before going this route, we have would have to improve the UI support (multiple windows, etc.).
Supporting multiple debugger instances in separate windows by using multiple renderer processes is trivial. We would just have to remove one line of code. This will come next.
We are all using a single VS Code application with 4+ projects and 2 and 3 debuggers open. I don't view this setup as "awkward" as any other application with multiple windows.
Running multiple debuggers behind one renderer process makes sense if the debuggers are actually operating in a coordinated way, but currently they are not. So the advantage of this approach is more of theoretical value for now.
Interesting, thank you for explaining that Andre Weinand (@weinand). I agree that even more value would be had if separate debuggers were coordinated, but I disagree that such a thing is necessary to get value out of multiple debuggers.
Again to my example, if I'm debugging a rails app & javascript, if I can place breakpoints in a controller and in the frontend right before an ajax request, it's not extremely necessary that control flow be automatically transferred from the js debugger to the ruby debugger or some magic like that... I can just wait for the ruby debugger's breakpoint to be hit.
And, as you say, debugging the same project in multiple windows gets a lot of the way there and is already planned, which will be nice.
Activity
jrieken commentedon Mar 21, 2016
fyi Andre Weinand (@weinand) Isidor Nikolic (@isidorn)
weinand commentedon Mar 21, 2016
factormystic you can run multiple debuggers easily by opening more VS Code windows. Every window supports one debugger. The only limitation is that you cannot run more than one debugger from a single project folder, because VS Code doesn't allow you to open a project folder in more than one window (we are planning to lift the limitation).
But there is a simple workaround: create sub folders in your project folder and open these in different VS Code windows.
factormystic commentedon Mar 21, 2016
I'm aware that it should be possible with multiple instances, by awkwardly opening different folders. That's kind of a hack and not particularly exciting, even though it is possible.
The really exciting thing is the prospect of being able to run multiple debuggers at once in the same vs code instance, as I said.
Much like it would not be very exciting if VS Code only allowed one type of syntax highlighting per instance, but instead loads separate syntax highlighting per file type.
So again the question is, what kind of difficulties would be associated with launching a debugger not exclusively in a VS Code instance, but basically on a per file type (or other) basis?
weinand commentedon Mar 21, 2016
factormystic VS Code supports one window and one extension host process per renderer:
The VS Code debugger could easily manage multiple debug adapters, however they all would have to live in one window. Before going this route, we have would have to improve the UI support (multiple windows, etc.).
Supporting multiple debugger instances in separate windows by using multiple renderer processes is trivial. We would just have to remove one line of code. This will come next.
We are all using a single VS Code application with 4+ projects and 2 and 3 debuggers open. I don't view this setup as "awkward" as any other application with multiple windows.
Running multiple debuggers behind one renderer process makes sense if the debuggers are actually operating in a coordinated way, but currently they are not. So the advantage of this approach is more of theoretical value for now.
factormystic commentedon Mar 24, 2016
Interesting, thank you for explaining that Andre Weinand (@weinand). I agree that even more value would be had if separate debuggers were coordinated, but I disagree that such a thing is necessary to get value out of multiple debuggers.
Again to my example, if I'm debugging a rails app & javascript, if I can place breakpoints in a controller and in the frontend right before an ajax request, it's not extremely necessary that control flow be automatically transferred from the js debugger to the ruby debugger or some magic like that... I can just wait for the ruby debugger's breakpoint to be hit.
And, as you say, debugging the same project in multiple windows gets a lot of the way there and is already planned, which will be nice.