I recently moved to the built-in LSP server configuration. I cannot get the LSP to format code/text for the life of me. All I get is the unhelpful message: [LSP] Format request failed, no matching language server.
with nothing helpful in the logs.
For example, I have this in .config/nvim/init.lua
:
vim.lsp.enable("tinymist")
vim.lsp.enable("ruff")
[…]
vim.api.nvim_create_autocmd("BufWritePost", {
callback = function()
vim.lsp.buf.format()
end
})
and in .config/nvim/lsp/tinymist.lua
, the following:
return {
cmd = { "tinymist" },
filetypes = { "typst" },
settings = {
formatterMode = "typstyle",
},
}
Neither Python nor typist files get formatted. However, both ruff
and tinymist
do have formatting.
Thus, two burning questions:
- What the H*** am I doing wrong?
- How can I debug these problems in the future?