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

Open
muirrn opened this issue Jun 9, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@muirrn
Copy link

commented Jun 9, 2019

In this code

package foo

func foo() {
	foo(a ...interface{})
	f<>
}

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

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