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: take address automatically for completion candidates #36132

Closed
muirdm opened this issue Dec 13, 2019 · 1 comment
Closed

x/tools/gopls: take address automatically for completion candidates #36132

muirdm opened this issue Dec 13, 2019 · 1 comment
Labels

Comments

@muirdm
Copy link

@muirdm muirdm commented Dec 13, 2019

In cases like:

type B interface {
	Banana()
}

type impl struct{}

func (*impl) Banana() {}

func _() {
	var b B
	var myImpl impl
	b = <>
}

You don't get the desired candidate "&myImpl" because we don't automatically take a reference for completion candidates. I propose we count "myImpl" as a matching candidate and automatically include an additional edit to prepend the "&" reference operator. That way you can start typing "my<>" and complete straight to "&myImpl".

@gopherbot gopherbot added this to the Unreleased milestone Dec 13, 2019
@golang golang deleted a comment from gopherbot Dec 13, 2019
@stamblerre stamblerre modified the milestones: Unreleased, gopls unplanned Dec 16, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 22, 2019

Change https://golang.org/cl/212399 mentions this issue: internal/lsp: support taking address for completion candidates

@muirdm muirdm changed the title x/tools/gopls: take reference automatically for completion candidates x/tools/gopls: take address automatically for completion candidates Dec 22, 2019
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
You can’t perform that action at this time.