Closed afterlook closed 1 month ago
You can diagnostic=false
so go.nvim will not run config for you.
Also the output of :lua=vim.diagnostics.config()
looks alright:
I did set diagnostic=false
, but nothing changed.
I also ran :lua=vim.diagnostics.config()
with go.nvim + gopls and gopls alone. In both cases update_in_insert
is set to false
, but still whenever I run vanilla gopls I get all the diagnostics/errors on every keystroke in insert mode
.
Appreciate the quick response and taking interest, love the plugin btw.
Also for more context, I'm not even seeing the expected behaviour of update_in_insert=false
, which is updating diagnostics on leaving the insert mode
- nothing happens.
Sounds like a neovim bug if lua=vim.diagnostics.config() shows update_in_insert=false but you get different behavior. Are you using 0.10 release?
Sounds like a neovim bug if lua=vim.diagnostics.config() shows update_in_insert=false but you get different behavior. Are you using 0.10 release?
Nope, still on version 0.9.5
.
And just to clarify, I'm only getting different behaviour with the plugin, vanilla gopls works as expected.
I'm able to reproduce the behavior with this config.
{
'ray-x/go.nvim',
dependencies = { -- optional packages
'ray-x/guihua.lua',
'neovim/nvim-lspconfig',
'nvim-treesitter/nvim-treesitter',
},
config = function()
require('go').setup({
lsp_cfg = true,
})
end,
event = { 'CmdlineEnter' },
ft = { 'go', 'gomod' },
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
},
Exact steps:
undefined: fmt
You can check the code here:
https://github.com/ray-x/go.nvim/blob/294d65c93514f14fbbe8af0545ab8918d939acdb/lua/go/gopls.lua#L341
And you can override those settings.
I did not see similar behaviour
The gopls setup of go.nvim is not the default one. Supose you are using master version, default diagnostic trigger is file Save
when update_in_insert=false,
Okay cool, didn't know about that interaction with update_in_insert
. Managed to get diagnostics running this way.
Thank you!
This can be closed.
So it seems that
update_in_insert
fromdiagnostic
is not working at all for me and in the meantime it works just fine if I remove the setup and attach clean gopls to my buffer. Diagnostics update just fine, but only when I save the buffer and as soon as I do any keystroke in insert mode, all diagnostics disappear completely.Any pointers on what might be wrong? Pretty sure it's something wrong with my config or worse, nasty interaction from other plugin...
Config: