Closed HiramTheHero closed 1 month ago
It's a bit unintuitive at first, but the problem is that settings.ltex.enabled
only tell ltex which filetypes to check, but not nvim. What happens here is not really a bug, you just need to tell nvim-lspconfig when to startup ltex by adding typst
to the list of filetypes.
The server_configurations/ltex.lua
file you manually edited basically does that, but you can do that already more simply in the setup
call like this:
local lspconfig = require("lspconfig")
lspconfig.ltex.setup({
filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" }, -- <-- add this
settings = {
ltex = {
enabled = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
}
}
})
Ah! I see. This works perfectly with my config as well. Thank you so much!
Description
Hello all,
Thank you for working on this software. It is excellent.
ltex
is supposed to be able to scan other filetypes through itsltex.enabled
configuration option. I haven't been able to get this work without modifying the default config file. I've been trying to extendltex
to activate on a file with a.typ
ending (which indicates atypst
file).Note that, in my situation, the
typst
file format is added through thetypst.vim
package. This is the code for it usinglazy.nvim
My
init.lua
has the following config options forltex
:Whenever I go to a file with a
.typ
extension (for atypst
file), theltex
LSP doesn't get started. The only way I've found to fix this is to addtypst
to thefiletypes
section within the default config located at~/.local/share/nvim/lazy/nvim-lspconfig/lua/lspconfig/server_configurations/ltex.lua
To clarify, I change this:
To this:
It would be nice to enable different files through just the user options. Every time I update
nvim-lspconfig
I have to re-add the'typst'
entry in the base config file.I apologize if my explanation is confusing. I'm happy to clarify if needed.