Closed kmx1 closed 5 months ago
Adding my 2 cents here:
the way the code currently works seems to be OK on my work laptop (macos), but we're using a Go packages driver there, so maybe that has some impact on automatically importing packages.
On my personal (linux) machine for projects that just use gopls as-is, your diff fixed imports on Lfmt
for me.
Fixed with roughly the same diff in v0.12.0.
Note that acme-lsp has moved: go install 9fans.net/acme-lsp/cmd/acme-lsp@latest
for the fix.
when using the latest gopls and latest acme-lsp the automatic importing of go modules breaks
this is probably caused by a change in the gopls protocol, i tried several older version too (about 0.12 - 0.14) but it sill was broken
i traced the error to the
CompatibleCodeActions
function ininternal/lsp/utils.go
and implemented a very very quick and dirty fix to remedy the issue. https://github.com/kmx1/acme-lsp/commit/dea92a6f057827d71db4cb7581a7768b6ba567ff the type switch never got into thecase protocol.CodeActionOptions
although it should probably be fixed in the protocol package? if that is even the cause
but maybe this should be done by someone who has a more thorough understanding of the LSP protocol and gopls
i hope that helps and thank you for this project