commit 93efd62658e5db23dcf25e5396603af348c811cb
parent 1dd64f16dabfb8e2cf42c37025e056c913fb92e4
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date: Wed, 8 Dec 2021 14:46:43 +0100
feat(lsp): add dictionnaries to ltex
And add a neat way of specifying those.
Diffstat:
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/dict/default.txt b/dict/default.txt
@@ -0,0 +1,3 @@
+MaxMCSat
+MaxPMCSat
+Vigouroux
diff --git a/dict/fr.txt b/dict/fr.txt
diff --git a/lua/lsp_config.lua b/lua/lsp_config.lua
@@ -200,13 +200,33 @@ local specials = {
enabled = { "latex", "tex", "bib", "markdown", },
language = "auto",
diagnosticSeverity = "information",
+ dictionary = (function ()
+ local files = {}
+ for _, file in ipairs(vim.api.nvim_get_runtime_file("dict/*", true)) do
+ local lang = vim.fn.fnamemodify(file, ":t:r")
+ local vals = {}
+ for line in io.lines(file) do
+ table.insert(vals, line)
+ end
+ files[lang] = vals
+ end
+
+ if files.default then
+ for lang,_ in pairs(files) do
+ if lang ~= "default" then
+ vim.list_extend(files[lang], files.default)
+ end
+ end
+ files.default = nil
+ end
+ return files
+ end)(),
setenceCacheSize = 2000,
additionalRules = {
enablePickyRules = true,
motherTongue = "fr",
},
trace = { server = "verbose" },
- dictionary = {},
disabledRules = {},
hiddenFalsePositives = {},
},