0

I have been updating my configuration to use the native LSP setup in Neovim 0.11 but have ran into an issue with the LTeX/LTeX+ language servers, which are used for spellchecking. Both are essentially identical, with LTeX+ being an actively maintained fork that is a drop-in replacement for LTeX.

For both markdown and bib files, the configuration works as expected for both LSPs and I get correct spellchecking. For tex files however, the LSP attaches to the buffer just as with markdown and bib, but no diagnostics are shown whatsoever. The output of checkhealth vim.lsp reads:

vim.lsp: Active Clients ~ - ltex (id: 1) - Version: ? (no serverInfo.version response) - Root directory: nil - Command: { "ltex-ls" } - Settings: {} - Attached buffers: 1 

In the case of LTeX:

I was able to replicate this issue with no other plugins loaded whatsoever by opening the different filetypes with nvim -u minimal.lua <file.filetype>, where the contents of minimal.lua is:

vim.lsp.config("ltex", { cmd = { "ltex-ls" }, filetypes = { "bib", "tex", "markdown" }, root_markers = { { ".git" } }, }) vim.lsp.enable({ "ltex" }) vim.opt.rtp:prepend(vim.fn.stdpath("data") .. "/lazy/lazy.nvim") require("lazy").setup({ "mason-org/mason.nvim", opts = {}, }) 

This assumes the use of the lazy.nvim package manager and mason to install the LSPs.

With this I can be sure that no other plugins are messing with the LSP somehow.

To do the same test with LTeX+, ltex becomes ltex_plus and ltex-ls become ltex-ls-plus in the minimal.lua.

1 Answer 1

1

Checking the log file at ~/.local/state/nvim/lsp.log revealed the message

[ERROR][2025-08-05 15:22:46] ...p/_transport.lua:36 "rpc" "ltex-ls" "stderr" "Aug 05, 2025 3:22:46 PM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment\nFINE: Skipping text check as LTeX has been disabled for files with code language ID 'tex' via ltex.enabled\n" 

With the LSP attached to a tex filetype.

I was able to get the spellchecking working for tex and bib filetypes by overriding the defaults for the enabled setting as follows:

vim.lsp.config("ltex_plus", { cmd = { "ltex-ls-plus" }, filetypes = { "bib", "tex" }, root_markers = { { ".git" } }, settings = { ltex = { enabled = { "latex", "tex" }, }, }, }) 

Where the "latex" and "tex" keys are required for bib and tex filetypes respectively. This was not something that needed to be done when using nvim-lspconfig. This same configuration can be adapted to regular LTeX with the same changes as specified in my question.

(I do think it is strange that bib files are associated with the latex language and not biblatex.)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.