Skip to content
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

debug: Is there a way to step into a new coroutine when using a handler? #3181

Open
jacksonfu opened this issue Feb 18, 2024 · 0 comments
Open
Labels
Debug Issues related to the debugging functionality of the extension. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@jacksonfu
Copy link

Is your feature request related to a problem? Please describe.
hi
Sometime, dont clearly know which handler to call, so dont eaily to directly break at the func.
VS Code Go extension:v0.41.0

type handler func(s string)
func myHandler(s string) {
	fmt.Println(s) // not stop at this line
}
func main() {
    h := handler(myHandler)
    go h("Hello, World!")// set a breakpoint on this line and use step into
    time.Sleep(8 * time.Second)// but stop at this line
}

issue1

Describe the solution you'd like

await call(sth)

Like debuging js through chrome, we can set a breakpoint either on await or on call. (Maybe inappropriate analogy)

Describe alternatives you've considered

  1. If there a viable alternative to jump through the value of variable. Also like debuging js through chrome, if the value is a callable obj, we can directly jump into the function and can also set the breakpoint.
    issue1

  2. If we can monitor when a new coroutine start to run.

Additional context
It works fine if I use as follow:

go func(){
h("Hello, World!")}() // set breakpoint on this line, but kind of tedious

Many thanks to you!

@gopherbot gopherbot added this to the Untriaged milestone Feb 18, 2024
@hyangah hyangah added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Debug Issues related to the debugging functionality of the extension. FeatureRequest labels Feb 21, 2024
@suzmue suzmue modified the milestones: Untriaged, vscode-go/backlog Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debug Issues related to the debugging functionality of the extension. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants