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/internal/lsp: don't complete in unterminated string literals #31557

Closed
muirdm opened this issue Apr 18, 2019 · 2 comments
Closed

x/tools/internal/lsp: don't complete in unterminated string literals #31557

muirdm opened this issue Apr 18, 2019 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@muirdm
Copy link

muirdm commented Apr 18, 2019

Similar to comments, I don't think it is useful to complete within string literals:

var fooBarBaz int
fmt.Println("foo<>

I'm not certain it is easy to detect this case, though, since it is a syntax error.

Alternatively, we could try to complete based on words in other nearby string literals, but I don't imagine that would end up being too useful, and might be outside the purview of a Go language server.

@gopherbot gopherbot added this to the Unreleased milestone Apr 18, 2019
@muirdm muirdm changed the title x/tools/internal/lsp: don't complete in string literals x/tools/internal/lsp: don't complete in unterminated string literals Apr 19, 2019
@muirdm
Copy link
Author

muirdm commented Apr 19, 2019

I now see this is only an issue for unterminated string literals. Updated title.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Apr 24, 2019
@stamblerre
Copy link
Contributor

It's not possible to add a test for this in the context of the packagestest framework (can't put a marker after an unterminated string literal), but I believe this issue was fixed by https://golang.org/cl/173518. Please reopen if I am mistaken.

@golang golang locked and limited conversation to collaborators May 14, 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.
Projects
None yet
Development

No branches or pull requests

3 participants