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/gopls: AllImportsFixes misbehavior edge case #47328
Comments
Thanks for filing this issue! I tried to reproduce, but am not able. Before trying to replicate your exact set-up, I think we should try a couple things: |
Thanks for checking will do... |
I managed to have my emacs Using a release version of gopls instead of master fixes the problem! So the edge case only exhibits in master. I'm happy myself for now. If anyone interested to dig deeper in this edge case, please let me know. thx! |
Great to hear, but we'd of course be very interested in fixing a bug at master :) Could you try with gopls built at the current master? It's it possible your gopls was very old? |
OK. The following is after a fresh From my Emacs lsp-log buffer:
The |
@suntong can you please share the output of |
NP.
This is the only go & gopls that I have.
|
It looks like that gopls ( Please follow the installation instruction as described in
Then, if the problem keeps occurring, please share the gopls trace again. Thanks! FYI it's no longer recommended to use EDIT: update the installation instruction to get the unstable version built at the master. |
FWIW, I suspected that the problem is sergi/go-diff@v1.2. It would be nice to verify that gopls works at master when not installed with |
Yep, I used the installation instruction from @hyangah to get the unstable version built at the master, getting exact output of Thanks a lot everyone! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, I'm using the latest gopls go code repo directly.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Edit a special
.go
file under Emacs, using the LSP + go mode, using the following hook when saving the file:What did you expect to see?
lsp-organize-imports and lsp-format-buffer do their jobs as expected.
What did you see instead?
My go code structure was totally messed up after the save:
and the changes doesn't make sense at all.
Steps to duplicate it
go-openwechat/owc-insight@63988c7
Further explanation:
Both edits will cause the .go file to be dramatically changed as above picture.
The change on both of my two machines are exactly the same.
This is really a simple file/repo, and I have no idea how to make the case even simpler.
So please download the simple go project and make the above simple change and see what you got.
Thanks a lot for your help.
Further discussion:
In my Emacs
lsp-log
buffer, I saw the error message iswhich is pointing to:
Don't know if the unusual uppercase package name has anything to do with the problem.
The text was updated successfully, but these errors were encountered: