Closed miranquil closed 12 months ago
Thank you for the report.
This looks like a regression in unimported completion, however I can't quite reproduce the behavior you're seeing. I don't see the duplicated completion items, for example.
I see a couple bugs, which is that we don't populate a placeholder for type parameters, and aren't honoring the usePlaceholders setting.
Are you working in GOPATH mode (as it appears from the import path of the dao package)? Does the issue reproduce when you work within a module?
Sorry English is not my native language so I'm not sure I've quite understanded what "GOPATH mode" means.
The main project is already go mod init
and also the dao
package. And on the other hand my project is working with go.work
.
Project's go.work:
go 1.18
use (
.
component
dao
)
There's nothing about dao in Project's go.mod.
Also I've found that only the dao
suffers from this issue. The packages like internal packages works well(excluding the placeholders' behavior).
I'm not sure if I have provided enough information. Please let me know if I can provice anything else.
Change https://go.dev/cl/506935 mentions this issue: gopls/internal/lsp/source/completion: placeholders for type params
Change https://go.dev/cl/506936 mentions this issue: gopls/internal/lsp/source/completion: honor usePlaceholders
I've sent CLs to fix the two problems @findleyr identified in https://github.com/golang/go/issues/60959#issuecomment-1604398224. I've reproduced the third problem (duplicates) and confirmed that the cause is the presence of test variants in the known
map used by unimported completions. I'll send a fix momentarily.
Change https://go.dev/cl/506937 mentions this issue: gopls/internal/lsp/source/completion: avoid duplicates from variants
OMG it's Donovan!!!! I'm so excited for this.
gopls version
go env
What did you do?
First, I have a project in struct like this:
I'm trying to call
dao.GWhereFirst
fromteaching_auth.go
.And I'm sure that
"ui.completion.usePlaceholders"
isfalse
in settings.What did you expect to see?
Regular suggestions, and no placeholders placed when I press ENTER.
And after founding out this issue, I rollbacked gopls to v0.11.0, which runs perfectly:![good](https://github.com/golang/go/assets/25676311/3c5ee925-7de9-4de7-a519-23ba8391e8d2)
What did you see instead?
The interesting thing is that if I delete the code generated with "import dao" left, then everything works fine. Just like the gif shows.
Editor and settings
VSCode
settings:
Logs
I've added
-logFile=/Users/miranquil/go.log
togo.languageServerFlag
. But after same operations nothing was written into this file.