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: completion breaks with keyword prefixes #34332

Open
muirrn opened this issue Sep 16, 2019 · 3 comments

Comments

@muirrn
Copy link

commented Sep 16, 2019

For example:

  variance := 123
  var<>
@gopherbot gopherbot added this to the Unreleased milestone Sep 16, 2019
@gopherbot

This comment has been minimized.

Copy link

commented Sep 16, 2019

Thank you for filing a gopls issue! Please take a look at the Troubleshooting section of the gopls Wiki page, and make sure that you have provided all of the relevant information here.

@sebsebmc

This comment has been minimized.

Copy link

commented Sep 18, 2019

I think this is another case where the parser doesn't return an *ast.Ident and as a result the text to match against is "". It might be worthwhile to get the preceding token (work backwards until a non [a-zA-Z0-9_] character) as a fallback.

@sebsebmc

This comment has been minimized.

Copy link

commented Oct 11, 2019

In the case of "var", "const", "type", and "import" we get a *ast.GenDecl that we can take the token out of and make an *ast.Ident to pass to setSurrounding. This at least gets us lexical completions on these keywords. If this seems like a reasonable fix I can submit this patch.

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