-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: unimported completions only returned on second call to Completion #44764
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
Comments
Pulling out the relevant pieces of the log:
I'm seeing what looks like 2 of the same /cc @heschik |
The completion request took 101ms which almost certainly means it timed out while scanning the filesystem. I don't see a reason to think there's a bug offhand. |
I'm not sure I follow that logic, because the second call took 102ms. That said I'm fairly sure there is some sort of issue here, not least because I'm using
(for some The first completion request fairly consistently (90%+) fails every time I open a new Vim+ |
Calls to completion will be prone to slowness while the disk is being scanned, but that doesn't mean they can't return results. The second one happened to find some packages that matched before the scan was done. There is not, and has never been, an attempt to share the goimports cache across workspaces. Rob has filed #44863 for that. I don't see anything else to do here, so closing. |
Thanks, in the context of #44863 and the discussion we had around that I now understand the current behaviour. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Start by adding
github.com/kr/pretty
to your module cache:Then separately create the following setup:
Edit
main.go
as follows:and trigger completion with the cursor in the position shown by
_
.What did you expect to see?
Unimported completion results that include
github.com/kr/pretty
.What did you see instead?
No results. I only see results if I trigger a second completion request.
Logs:
cc @stamblerre
FYI @leitzler
The text was updated successfully, but these errors were encountered: