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

x/tools/cmd/gopls: stop signature help inside an argument closure body #31633

Closed
zombiezen opened this issue Apr 23, 2019 · 3 comments
Closed
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@zombiezen
Copy link
Contributor

I've noticed when creating sub-tests in VSCode that when I finish doing completions that it opens a hover for the T.Run function arguments. This isn't useful to me, but in general hovers are useful for me, so I don't want to turn off hovers.

Repro case, type the following:

package foo

import "testing"

func TestFoo(t *testing.T) {
  t.Run("Bar", func(t *testing.T) {
    t.Log("hey")
    <>
  })
}

At the cursor location <>, VSCode will keep a hover open for Run(name string, f func(t *testing.T)) bool.

@gopherbot gopherbot added this to the Unreleased milestone Apr 23, 2019
@zombiezen
Copy link
Contributor Author

/cc @ianthehat @stamblerre

@ianthehat ianthehat added the gopls Issues related to the Go language server, gopls. label Apr 23, 2019
@stamblerre stamblerre changed the title x/tools/cmd/gopls: stop hover inside a argument closure body x/tools/cmd/gopls: stop signature help inside an argument closure body Apr 23, 2019
@stamblerre stamblerre added the Suggested Issues that may be good for new contributors looking for work to do. label May 31, 2019
@gopherbot
Copy link

Change https://golang.org/cl/184260 mentions this issue: internal/lsp: hide signature help in function literals

@zombiezen
Copy link
Contributor Author

Thank you!

movie-travel-code pushed a commit to movie-travel-code/tools that referenced this issue Jul 11, 2019
Often anonymous functions can be passed as arguments to a function. In
these cases, it can be annoying for a user to see signature help for the
entire duration of their writing this function. This change detects if
the user is typing in a function literal and disables signature help in
that case.

Fixes golang/go#31633

Change-Id: I7166910739b6e1ec0da2ec852336136b81d13be0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184260
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
@golang golang locked and limited conversation to collaborators Jul 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants