Closed disidrosi closed 2 years ago
Hello @disidrosi,
Please define a path for your ltex file and try again. You can use a relative path to store data in your working directory or an absolute path to store common data. Do you have the server running? You can check it with :LspInfo
Hi @barreiroleo, thanks for the reply.
I tried setting a path, and this indeed gets rid of the second error, but the five lines "Error catching ltex client" remain. The server is also running correctly, as shown by :LspInfo
(see below). Diagnostics are displayed correctly on each buffer, and are updated also after resetting with :lua vim.diagnostic.reset()
.
Sorry, I read fast on your initial post. I notice your config doesn't follow the recommendation what is in the docs.
require("lspconfig").ltex.setup {
capabilities = your_capabilities,
on_attach = function(client, bufnr)
-- your other on_attach functions.
require("ltex_extra").setup{...}
end,
settings = {...}
}
You can see that idea is passing a callback function to execute when "on_attach" event is happening. In your snippet, you're calling to ltex_extra setup when the ltex specification is given to lspconfig, not when the server is attaching, so ltex is never gonna be up when ltex_extra is trying to catch it.
require('lspconfig').ltex.setup {
on_attach = on_attach, -- Here goes the function
capabilities = capabilities,
require('ltex_extra').setup{ ... } , -- This is calling to ltex_extra when there isn't a server attached
settings = {...}
}
Thank you very much! I should have read more carefully too, because indeed changing the placement of the callback function solved the problem.
Excellent, I hope you find the plugin useful.
Describe the bug When opened, nvim displays five messages reporting "Error catching ltex client", followed by an analogous error message (see screenshots below). However, ltex_extra seems to work as expected on both Markdown and TeX files. The plugin is configured with the default:
For completeness, here is also the attach function that I'm using, which is taken from
Kickstart.nvim
(see link):