debug: show only user goroutines by default
Discussed in https://github.com/golang/vscode-go/discussions/1754
Originally posted by suzmue September 7, 2021 Using a debugger to debug a Go program reveals a lot of the Go runtime implementation details to the user. Several goroutines that belong to the runtime appear in the call stack, cluttering the view and making a simple program seem very complicated.
For example when debugging a simple hello world program, 5 different goroutines appear in the callstack:
Program stopped on a breakpoint in main.go:

Call stack:

This proposal is to (by default) only show the user goroutines in the call stack. When using this new default, the call stack for hello world will only show a single goroutine, as would be expected from a simple program with no concurrency:
This would be controlled by a setting to allow users that really want to see the system goroutines to include them using the launch configuration.
https://go-review.googlesource.com/c/vscode-go/+/359402 was submitted to enable this in Nightly
Should we enable this in the stable release?
Is there a way to enable this by default for all debugging sessions? 90% of my debugging is done via tests - I'd really like to be able to enable this when debugging a test, without having to create a launch.json entry for the test.
Change https://go.dev/cl/534955 mentions this issue: package.json: allow updating hideSystemGoroutines from stack context
@firelizzard18 sorry for the delay but adding the hideSystemGoroutines to the user settings in go.delveConfig should do this for all tests:
"go.delveConfig": {
"hideSystemGoroutines": true
}
Added the feature to be able to toggle the threads from the context menu:
@suzmue Is there any extra work you planned to do during this cycle? cl/534955 made the feature accessible. Do you want to hide the system goroutines by default?