Closed thatanjan closed 1 year ago
Can you check if this occurs in current neovim stable release as well for you? If not this could be some bug in the nightly version.
@SmiteshP I have tried the stable version but getting the same problem
@thatanjan @navxio Is this occuring for any specific language? I am not able to reproduce this issue 🤔
@SmiteshP Apparently it happens with both lua and python for me.. I'm using neodev / lspconfig.pyright if that helps..
Here's the whole thing: https://github.com/navxio/dots/blob/trunk/.config/nvim/init.lua
@thatanjan @navxio Is this occuring for any specific language? I am not able to reproduce this issue thinking
@SmiteshP I have tried on ts
, tsx
, less
, py
. Basically, it occurs on all filetypes if you have lsp server installed for that file.
@thatanjan @navxio Can you guys checkout the debug branch, have auto_attach=true in config and then open any file that shows this issue. Then run :messages
command and paste the output here?
And for now as a work around you may use manual attachments instead
@SmiteshP here is the output.
{
buf = 1,
data = {
client_id = 1
},
event = "LspAttach",
file = "/home/anjan/.dotfiles/.config/qtile/config.py",
id = 80,
match = "/home/anjan/.dotfiles/.config/qtile/config.py"
}
{
buf = 1,
event = "LspAttach",
file = "*",
id = 80,
match = "/home/anjan/.dotfiles/*"
}
Error detected while processing LspAttach Autocommands for "*":
E5108: Error executing lua vim/_editor.lua:0: LspAttach Autocommands for "*"..script nvim_exec2() called at LspAttach Autocommands for "*":0: Vim(echomsg):E114: Missing quo
te: "Error in packer_compiled: ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:118: LspAttach Autocommands for \"*\"..LspAttach Autocommands for \"*\": Vim(appe
nd):Error executing lua callback: ...ck/packer/start/nvim-navbuddy/lua/nvim-navbuddy/init.lua:368: attempt to index field 'data' (a nil value)
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:179: in function <...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:175>
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_exec_autocmds'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1665: in function '_on_attach'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1472: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Aah I see whats happening!
The first autocommand being triggered is correct
{
buf = 1,
data = {
client_id = 1
},
event = "LspAttach",
file = "/home/anjan/.dotfiles/.config/qtile/config.py",
id = 80,
match = "/home/anjan/.dotfiles/.config/qtile/config.py"
}
But something is triggering the second autocommand as well which doesn't contain the data for some reason. Cannot definitively say whats causing this since I cannot reproduce the error, but perhaps some plugins you both have in common is doing it? Anyways, I can add a small check to ensure that data field is not null to fix the issue.
Latest commit should have fixed this issue for you guys
I still have the problem.
Did you switch to master branch again?
Did you switch to master branch again?
Yes.
Huh weird.. The if else check I added should prevent this error 🤔 Can you paste the error message again? is it the same error? Also can you double check if you are on latest commit of master.
Yes, I am using the master branch with the latest commit. Here is the error
E5108: Error executing lua vim/_editor.lua:0: LspAttach Autocommands for "*"..script nvim_exec2() called at LspAttach Autocommands for "*":0: Vim(echomsg):E114: Missing quote: "Error in packer_compiled: ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:118: LspAttach Autocommands for \"*\"..LspAttach Autocommands for \"*\": Vim(append):Error executing lua callback: ...ck/packer/start/nvim-navbuddy/lua/nvim-navbuddy/init.lua:367: attempt to index field 'data' (a nil value)
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:179: in function <...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:175>
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_exec_autocmds'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1687: in function '_on_attach'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1454: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Just found out that the problem was with the Lspsaga plugin with Packer. Check this issue. https://github.com/nvimdev/lspsaga.nvim/issues/1128
I installed this plugin with the following code.
I am getting this error when I open a file. But the plugin just works fine after that.
My neovim version: NVIM v0.10.0-dev-533+g7e301ed5b Config repo: https://github.com/thatanjan/neovim-config