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: Inconsistent deep completion for io.ErrUnexpectedEOF #35062

Closed
psanford opened this issue Oct 22, 2019 · 4 comments
Closed

x/tools/gopls: Inconsistent deep completion for io.ErrUnexpectedEOF #35062

psanford opened this issue Oct 22, 2019 · 4 comments
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.
Milestone

Comments

@psanford
Copy link

With deep completions enabled I was trying to complete io.u<> to io.ErrUnexpectedEOF in the following code:

package foo

import (
	"io"
)

func IsEOF(e error) bool {
	if e == io.EOF {
		return true
	}

	if e == io.u<>

	return false
}

This resulted in a single suggested completion: io.ErrUnexpectedEOF.Error().

However if I type io.un<>:

package foo

import (
	"io"
)

func IsEOF(e error) bool {
	if e == io.EOF {
		return true
	}

	if e == io.un<>

	return false
}

I get two suggestions: [io.ErrUnexpectedEOF, io.ErrUnexpectedEOF.Error()].

What did you see instead?

I expected the completions to be the same for both cases.

I'm using gopls built from master as of today.

/cc @muirrn @stamblerre

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Oct 22, 2019
@gopherbot gopherbot added this to the Unreleased milestone Oct 22, 2019
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Oct 22, 2019
@stamblerre
Copy link
Contributor

/cc @muirrn

@golang golang deleted a comment from gopherbot Oct 22, 2019
@gopherbot
Copy link

Change https://golang.org/cl/202638 mentions this issue: internal/lsp: fix fuzzy matcher inconsistency

@muirdm
Copy link

muirdm commented Oct 22, 2019

@psanford can you try the above CL? You will need to grab both commits.

@psanford
Copy link
Author

With the changes applied io.u<> now suggests just io.ErrUnexpectedEOF. which seems correct to me.

I think my core concern was getting a deeper suggestion when matching on characters only found in the shallower field (and not getting the shallower completion as an option). I think you've addressed that issue here.

@golang golang locked and limited conversation to collaborators Oct 21, 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

4 participants