fix(lsp): ltex_plus → ltex_ls_plus

- Naming conflicts with lspconfig: the `filetypes` field was overwritten
  by lspconfig.
This commit is contained in:
2025-04-30 14:42:54 +02:00
parent 44be63bc2e
commit 031e7694a5
2 changed files with 13 additions and 1 deletions

70
lsp/ltex_ls_plus.lua Normal file
View File

@ -0,0 +1,70 @@
local language_id_mapping = {
bib = 'bibtex',
pandoc = 'markdown',
plaintex = 'tex',
rnoweb = 'rsweave',
rst = 'restructuredtext',
tex = 'latex',
text = 'plaintext',
norg = 'neorg',
}
local function get_language_id(_, filetype)
return language_id_mapping[filetype] or filetype
end
return {
cmd = { 'ltex-ls-plus' },
filetypes = {
'markdown',
'pandoc',
'latex',
'text',
'norg',
'gitcommit',
'jj',
'jjdescription',
'rst',
'typst'
},
get_language_id = get_language_id,
single_file_support = true,
settings = {
ltex = {
enabled = {
'markdown',
'pandoc',
'latex',
'text',
'norg',
'gitcommit',
'jj',
'jjdescription',
'rst',
'typst'
},
language = "auto",
diagnosticSeverity = "information",
checkFrequency = "save",
sentenceCacheSize = 2000,
additionalRules = {
enablePickyRules = true,
motherTongue = "fr",
},
enabledRules = {
en = { "EN_CONSISTENT_APOS" },
},
disabledRules = {
fr = { "APOS_TYP", "FRENCH_WHITESPACE", "CHANGE", "ISSUE", },
en = { "DASH_RULE", "TWO_HYPHENS", "CHANGE", "ISSUE", "CHECK",
"ACTUALLY", "CONSISTENT", },
},
dictionary = {
fr = { "CryptPad", "Chouhartem",
-- field names
"authors", "categories", "created", "updated", "title", "meta" },
en = { "CryptPad", },
}
}
}
}