From 85b9c5aca56b4b5c2b3164fde3a868c68606a2f3 Mon Sep 17 00:00:00 2001 From: William Boman Date: Sun, 31 Oct 2021 00:27:29 +0200 Subject: fix(ltex): add lspconfig server entry This was accidentally removed earlier, ltex has not been merged upstream yet. --- lua/nvim-lsp-installer/servers/ltex/init.lua | 51 +++++++++++++++++----------- 1 file changed, 31 insertions(+), 20 deletions(-) (limited to 'lua') diff --git a/lua/nvim-lsp-installer/servers/ltex/init.lua b/lua/nvim-lsp-installer/servers/ltex/init.lua index 1c24ec4b..14680e0a 100644 --- a/lua/nvim-lsp-installer/servers/ltex/init.lua +++ b/lua/nvim-lsp-installer/servers/ltex/init.lua @@ -4,9 +4,6 @@ local std = require "nvim-lsp-installer.installers.std" local context = require "nvim-lsp-installer.installers.context" local Data = require "nvim-lsp-installer.data" local platform = require "nvim-lsp-installer.platform" -local installers = require "nvim-lsp-installer.installers" - -local uv = vim.loop local coalesce, when = Data.coalesce, Data.when @@ -48,25 +45,39 @@ return function(name, root_dir) end), std.chmod("+x", { "ltex-ls" }), }, - default_options = { - filetypes = { "tex", "bib", "markdown" }, - cmd = { path.concat { root_dir, script_name } }, - settings = { - ltex = { - enabled = { "latex", "tex", "bib", "markdown" }, - checkFrequency = "edit", - language = "en", - diagnosticSeverity = "information", - setenceCacheSize = 2000, - additionalRules = { - enablePickyRules = true, - motherTongue = "en", + pre_setup = function() + local configs = require "lspconfig/configs" + local util = require "lspconfig/util" + + if configs.ltex then + return + end + + configs.ltex = { + default_config = { + filetypes = { "tex", "bib", "markdown" }, + root_dir = util.find_git_ancestor, + settings = { + ltex = { + enabled = { "latex", "tex", "bib", "markdown" }, + checkFrequency = "edit", + language = "en", + diagnosticSeverity = "information", + setenceCacheSize = 2000, + additionalRules = { + enablePickyRules = true, + motherTongue = "en", + }, + dictionary = {}, + disabledRules = {}, + hiddenFalsePositives = {}, + }, }, - dictionary = {}, - disabledRules = {}, - hiddenFalsePositives = {}, }, - }, + } + end, + default_options = { + cmd = { path.concat { root_dir, script_name } }, }, } end -- cgit v1.2.3-70-g09d2