x/tools/gopls: organizeImports does not find package after changing its name #67973
Labels
gopls/imports
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
gopls version
go env
What did you do?
I created a tiny Go project with the following 3 files:
go.mod:
hello1.go:
internal/foo/foo.go:
Note how internal/foo/foo.go contains “package bar”, which I’ll later correct.
What did you see happen?
I opened Emacs on hello1.go, then:
foo.Bar()
tofunc main()
, save the file to trigger organizeImportsinternal/foo/foo
import is not added.What did you expect to see?
I would have expected gopls to add the internal/foo/foo import.
Restarting gopls using
M-x eglot
helps — afterwards the organizeImports action succeeds.Editor and settings
Emacs 29 with go-ts-mode and eglot
Logs
The text was updated successfully, but these errors were encountered: