ojroques/nvim-lspfuzzy

Error expected table, got number when doing vim.lsp.buf.declaration

petejodo opened this issue · 3 comments

I'm a bit new to lua configuration but this is about as far as I got...

My setup is basic e.g. require('lspfuzzy').setup {} and when running vim.lsp.buf.declaration() is giving me this error. The result parameter in the returned handler in make_location_handler is of type number for some reason 🤷‍♂️

local debug = require("debug")                                                                                                                     
xpcall(function() vim.lsp.buf.declaration() end, function() print(debug.traceback()) end)
EOF
stack traceback:
^I[string ":lua"]:2: in function <[string ":lua"]:2>
^I[C]: in function 'assert'
^Ivim/shared.lua:199: in function 'tbl_isempty'
^I...im/site/pack/packer/start/nvim-lspfuzzy/lua/lspfuzzy.lua:135: in function 'handler' <-------------
^I/usr/share/nvim/runtime/lua/vim/lsp.lua:1276: in function 'request'
^I/usr/share/nvim/runtime/lua/vim/lsp/buf.lua:69: in function 'declaration'
^I[string ":lua"]:2: in function <[string ":lua"]:2>
^I[C]: in function 'xpcall'
^I[string ":lua"]:2: in main chunk

Yes it happens when the language server has no support for declarations which is the case here.

The error message is not very helpful I agree, I will change it asap.

I've added a wrapper for handlers that catch errors and print their messages.

Awesome, thanks for the quick response