Open firelizzard18 opened 3 years ago
Thanks for the feature request @firelizzard18
go generate
can take arbitrary commands that don't have to be go run
commands. For example,
//go:generate goyacc -o gopher.go -p parser gopher.y
Do you mean debugging the go generate
command itself, or the command go generate
will run (in your example, my_generator package, maybe)?
For the latter, if handling commands that explicitly call go run
is sufficient, I think it's feasible. The extension needs to detect the explicit invocation of go run
... and somehow implement go generate's command line parsing and populate a launch request.
For the latter, if handling commands that explicitly call go run is sufficient, I think it's feasible.
That's the idea.
somehow implement go generate's command line parsing
What about go generate -n
? That will print the commands that go generate would run, without running them, thus making it easy to use go generate's command line parsing directly.
Would love to see this.
Is your feature request related to a problem? Please describe. I am working on a generator. The generator has bugs that I need to debug.
Describe the solution you'd like When my code has a go generate comment starting with
go run
, as ingo run ../my_generator
, I want an additional code lens,debug go generate
, to show up after therun go generate
lens. This lens would start a debug session that executes the same code as thego run
command.Describe alternatives you've considered I've created a normal debug entry that runs my generator, but this is annoying when I am messing with flags. It would be really nice to have a lens to click on and totally forgo the launch configuration.