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: bad completion insertion after syntax error #32510

muirdm opened this issue Jun 9, 2019 · 1 comment


Copy link

@muirdm muirdm commented Jun 9, 2019

In this code

package foo

func foo() {
	foo(a ...interface{})

Completing "f" to "foo" ends up inserting "ffoo" instead of "foo". This is because the syntax error on the previous line completely obscures the "f" *ast.Ident, so we don't detect it properly as the prefix. Perhaps if we are in a BadExpr we could "manually" detect the surrounding identifier so completion still works to some degree?

/cc @stamblerre

@gopherbot gopherbot added this to the Unreleased milestone Jun 9, 2019
@gopherbot gopherbot added the gopls label Jun 9, 2019
@stamblerre stamblerre changed the title x/tools/cmd/gopls: bad completion insertion after syntax error x/tools/gopls: bad completion insertion after syntax error Jul 2, 2019
@stamblerre stamblerre added help wanted and removed Suggested labels Aug 8, 2019

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 12, 2019

Change mentions this issue: internal/lsp: fix completion prefix detection with syntax errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.