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/gopls: invalid completions on RHS of ":=" #39203

Closed
muirdm opened this issue May 21, 2020 · 2 comments
Closed

x/tools/gopls: invalid completions on RHS of ":=" #39203

muirdm opened this issue May 21, 2020 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. help wanted Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@muirdm
Copy link

muirdm commented May 21, 2020

On gopls master (91d71f6):

fooBar := fo<> 

You get a completion for "fooBar" which doesn't make sense since "fooBar" isn't declared yet. We have a similar special case check for "var" declarations, so we probably just need to apply it to ":=" as well. ":=" is a bit trickier since some of the LHS values might already be declared.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label May 21, 2020
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label May 21, 2020
@gopherbot gopherbot added this to the Unreleased milestone May 21, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 May 21, 2020
@stamblerre stamblerre removed this from the gopls/v0.5.0 milestone Jun 24, 2020
@stamblerre stamblerre added this to the gopls/unplanned milestone Oct 21, 2020
@gopherbot
Copy link

Change https://golang.org/cl/275693 mentions this issue: internal/lsp/source: omit assign stmt LHS in RHS completion

marwan-at-work pushed a commit to marwan-at-work/tools that referenced this issue Dec 23, 2020
In the below example:

    fooBar := fooB<>

We will no longer suggest "fooBar" at <>.

Fixes golang/go#39203.

Change-Id: Ie1450397ce3de4f21fb0862c1a4f0fe2812325fd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/275693
Run-TryBot: Muir Manders <muir@mnd.rs>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Robert Findley <rfindley@google.com>
@golang golang locked and limited conversation to collaborators Dec 7, 2021
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. help wanted Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants