microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.53k stars 28.11k forks source link

Debugger UX should show stack for current thread instead of a treeview with all threads #214824

Open WardenGnaw opened 3 weeks ago

WardenGnaw commented 3 weeks ago

Originally by @davidfowl

Debugging any ASP.NET Core application using devkit (I turned off just my code as well), I see something like this:

image

Can we make it show the thread we're stepping show up there and not all threads? I don't know if that means have a thread switcher UX or another "multiple threads with stacks UX".


The feature here is for VS Code to provide a way to not show all threads and their CallStacks, just a single CallStack of the current thread and something to toggle between threads.

Related: https://github.com/dotnet/vscode-csharp/issues/7216

roblourens commented 3 weeks ago

Is this basically just https://github.com/microsoft/vscode/issues/116109? I see that @davidfowl said they are different requests, but they seem at least closely related to me

davidfowl commented 3 weeks ago

It's similar on the surface but not practically. Visual Studio's default debugging experience supports multiple threads and a "current stack trace". These are usually physical threads and the number of them is usually manageable in a UI like a dropdown.

For the uninitiated in Visual Studio experience, here's a video for what exists:

https://github.com/microsoft/vscode/assets/95136/1ee443b7-1132-49fc-afe5-8cfa99ebfe31

Notice the callstack window is just the stack and you are able to switch threads. Which changes both the callstack and the editor. This is a one at a time view. This is an enhancement to what exists in VS code.

What this issue is about is more like the Parallel tasks view or the tasks window in Visual Studio. Lets call it the "green thread" view. The main difference is the scale. You don't have 1M threads to switch between, you have 10K "green threads/goroutines/tasks", and that might be completely normal. These "green threads" are logical threads with logical stacks and can share the same view, but the better view for these types of systems is one that groups common stacks together to manage the scale.

See https://learn.microsoft.com/en-us/visualstudio/debugger/using-the-parallel-stacks-window?view=vs-2022#tasks-view for more information