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

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

zombiezen opened this issue Apr 23, 2019 · 3 comments

Comments

@zombiezen
Copy link
Contributor

@zombiezen zombiezen commented Apr 23, 2019

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

@zombiezen zombiezen commented Apr 23, 2019

@ianthehat ianthehat added the 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
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 29, 2019

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

@zombiezen
Copy link
Contributor Author

@zombiezen zombiezen commented Jul 8, 2019

Thank you!

movie-travel-code added 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.