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
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@muirdm
Copy link

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
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels 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
Copy link

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
@golang golang locked and limited conversation to collaborators Dec 22, 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. 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