Closed jose-elias-alvarez closed 2 years ago
Thank you
I just assumed it would be a string, it looks like it is always a table. Should be safe to remove the check for string.
It might be nice to format the message the same as the build in handler does.
local client = vim.lsp.get_client_by_id(ctx.client_id)
local client_name = client and client.name or string.format("client_id=%d", ctx.client_id)
vim.api.nvim_err_write(client_name .. ': ' .. tostring(err.code) .. ': ' .. err.message)
Also, can you rebase the PR against develop please.
Closing in favor of #27.
Thanks for the plugin! It's nice to have an out-of-the-box async formatting solution. While testing it out, I ran into the following error:
It seems like at least some servers (ESLint, for example) send errors as tables, which aren't currently handled. This PR adds handling for the table case.
For reference, the specification says that document formatting requests errors have the following structure:
Neovim's built-in handlers only handle tables, so it may be possible to drop string handling altogether.