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
Milestone

Comments

@psanford
Copy link

@psanford psanford commented Oct 22, 2019

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 label Oct 22, 2019
@gopherbot gopherbot added this to the Unreleased milestone Oct 22, 2019
@gopherbot gopherbot added the Tools label Oct 22, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Oct 22, 2019

/cc @muirrn

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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 22, 2019

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

@muirdm

This comment has been minimized.

Copy link

@muirdm muirdm commented Oct 22, 2019

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

@psanford

This comment has been minimized.

Copy link
Author

@psanford psanford commented Oct 22, 2019

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.

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
4 participants
You can’t perform that action at this time.