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

Comments

@muirdm
Copy link

@muirdm 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
Copy link

@gopherbot gopherbot commented May 21, 2020

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 this to the Unreleased milestone May 21, 2020
@stamblerre stamblerre removed this from the Unreleased milestone May 21, 2020
@stamblerre stamblerre added this to the gopls/v0.5.0 milestone 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

@gopherbot gopherbot commented Dec 7, 2020

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

@stamblerre stamblerre removed this from the gopls/unplanned milestone Dec 7, 2020
@stamblerre stamblerre added this to the gopls/v0.6.0 milestone Dec 7, 2020
@gopherbot gopherbot closed this in a835c87 Dec 7, 2020
marwan-at-work added 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants