-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
require("go.format").goimport() does not format code any longer #439
Comments
Sounds to me you might have multiple formater/import auto command hooked. |
I have the same behavior: |
I have the same problem |
what config you are using? Could you confirm no other auto-format plugin was enabled when you testing the commands? |
My current config: https://github.com/dn-kolesnikov/dotfiles/tree/master/nvim/.config/nvim |
I face the same issue. I tried to force formatting by executing I have I have pulled latest updates and the issue still persists. Just noticed LSP logs logging this on
Let me know if there is anything I could help you to fix the issue. |
I have the same problem. |
My current config: |
There must be something wrong. But go import can be use difference source, e.g. gopls/gopls_subcommand/goimport/gofumpt
And reproduce the issue by running Also please check
|
I`m trying your config, same behavior GoImport only imported, GoFmt - formated |
Would you check if the latest version fixed this? |
Yes! Thanks! Working awesome! |
It seems gofmt works, but goimport not work |
Same problem here, I just updated the plugin and it does not work anymore. I updated my config based on the readme, to no avail. Any way to revert the update I did (using Lazy)? |
Would you post your config? @zyriab |
@ray-x Thanks for the help and sorry! |
I'm at my wit's end for this as well. Whenever I try to run
|
on possibility is import capability was disabled. or your version of gopls does not support go import. Also, you can still use following config |
Thanks @ray-x ! This
config = function()
require('go').setup({
goimports = 'goimports',
})
end, |
what is the version of gopls ( |
Here goes:
|
I did a quick look at the version you provided but failed to reproduce it. I'll keep an eye on it. |
I have the same problem. My gopls and nvim versions are the same as saikocat. |
|
require("go.format").goimports() not work for me. |
Lately, my setup which is exactly like described in https://github.com/ray-x/go.nvim?tab=readme-ov-file#run-gofmt--goimport-on-save stopped working.
It still organizes imports, but is not doing any formating.
Same problem, if I call the lua function manually.
:lua require("go.format").goimport()
just organizes the import, no formating:lua require("go.format").gofmt()
formats (and intererstingly enough at least adds a missing import "fmt")The text was updated successfully, but these errors were encountered: