diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/_generated/filetype_map.lua | 8 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/_generated/metadata.lua | 3 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/server.lua | 14 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/erlangls/init.lua | 4 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/tflint/init.lua | 45 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/vala_ls/init.lua | 5 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/ui/status-win/init.lua | 10 |
7 files changed, 42 insertions, 47 deletions
diff --git a/lua/nvim-lsp-installer/_generated/filetype_map.lua b/lua/nvim-lsp-installer/_generated/filetype_map.lua index 36ee383f..cb1f59d2 100644 --- a/lua/nvim-lsp-installer/_generated/filetype_map.lua +++ b/lua/nvim-lsp-installer/_generated/filetype_map.lua @@ -41,9 +41,9 @@ return { ["html-eex"] = { "tailwindcss" }, jade = { "tailwindcss" }, java = { "jdtls" }, - javascript = { "denols", "ember", "eslint", "eslintls", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, + javascript = { "denols", "ember", "eslint", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, ["javascript.jsx"] = { "denols", "eslint", "tsserver" }, - javascriptreact = { "denols", "eslint", "eslintls", "graphql", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, + javascriptreact = { "denols", "eslint", "graphql", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, json = { "jsonls", "rome" }, kotlin = { "kotlin_language_server" }, leaf = { "tailwindcss" }, @@ -90,9 +90,9 @@ return { terraform = { "terraformls", "tflint" }, tex = { "ltex", "texlab" }, twig = { "tailwindcss" }, - typescript = { "angularls", "denols", "ember", "eslint", "eslintls", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, + typescript = { "angularls", "denols", "ember", "eslint", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, ["typescript.tsx"] = { "angularls", "denols", "eslint", "rome", "tsserver" }, - typescriptreact = { "angularls", "denols", "eslint", "eslintls", "graphql", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, + typescriptreact = { "angularls", "denols", "eslint", "graphql", "rome", "stylelint_lsp", "tailwindcss", "tsserver" }, vala = { "vala_ls" }, vb = { "omnisharp" }, vim = { "vimls" }, diff --git a/lua/nvim-lsp-installer/_generated/metadata.lua b/lua/nvim-lsp-installer/_generated/metadata.lua index 4476f145..b2af35af 100644 --- a/lua/nvim-lsp-installer/_generated/metadata.lua +++ b/lua/nvim-lsp-installer/_generated/metadata.lua @@ -61,9 +61,6 @@ return { eslint = { filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue" } }, - eslintls = { - filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact" } - }, fortls = { filetypes = { "fortran" } }, diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua index 69fc2447..cd04cb51 100644 --- a/lua/nvim-lsp-installer/server.lua +++ b/lua/nvim-lsp-installer/server.lua @@ -14,7 +14,7 @@ local M = {} M.get_server_root_path = servers.get_server_install_path ---@alias ServerDeprecation {message:string, replace_with:string|nil} ----@alias ServerOpts {name:string, root_dir:string, homepage:string|nil, deprecated:ServerDeprecation, installer:ServerInstallerFunction|ServerInstallerFunction[], default_options:table, pre_setup:fun()|nil, post_setup:fun()|nil, languages: string[]} +---@alias ServerOpts {name:string, root_dir:string, homepage:string|nil, deprecated:ServerDeprecation, installer:ServerInstallerFunction|ServerInstallerFunction[], default_options:table, languages: string[]} ---@class Server ---@field public name string @The server name. This is the same as lspconfig's server names. @@ -25,8 +25,6 @@ M.get_server_root_path = servers.get_server_install_path ---@field private _installer ServerInstallerFunction ---@field private _on_ready_handlers fun(server: Server)[] ---@field private _default_options table @The server's default options. This is used in @see Server#setup. ----@field private _pre_setup fun()|nil @Function to be called in @see Server#setup, before trying to setup. ----@field private _post_setup fun()|nil @Function to be called in @see Server#setup, after successful setup. M.Server = {} M.Server.__index = M.Server @@ -42,28 +40,18 @@ function M.Server:new(opts) _on_ready_handlers = {}, _installer = type(opts.installer) == "function" and opts.installer or installers.pipe(opts.installer), _default_options = opts.default_options, - _pre_setup = opts.pre_setup, - _post_setup = opts.post_setup, }, M.Server) end ---Sets up the language server via lspconfig. This function has the same signature as the setup function in nvim-lspconfig. ---@param opts table @The lspconfig server configuration. function M.Server:setup_lsp(opts) - if self._pre_setup then - log.fmt_debug("Calling pre_setup for server=%s", self.name) - self._pre_setup() - end -- We require the lspconfig server here in order to do it as late as possible. -- The reason for this is because once a lspconfig server has been imported, it's -- automatically registered with lspconfig and causes it to show up in :LspInfo and whatnot. local lsp_server = require("lspconfig")[self.name] if lsp_server then lsp_server.setup(vim.tbl_deep_extend("force", self._default_options, opts or {})) - if self._post_setup then - log.fmt_debug("Calling post_setup for server=%s", self.name) - self._post_setup() - end else error( ( diff --git a/lua/nvim-lsp-installer/servers/erlangls/init.lua b/lua/nvim-lsp-installer/servers/erlangls/init.lua index b7a88919..d5273a5d 100644 --- a/lua/nvim-lsp-installer/servers/erlangls/init.lua +++ b/lua/nvim-lsp-installer/servers/erlangls/init.lua @@ -30,7 +30,9 @@ return function(name, root_dir) end, }, default_options = { - cmd = { path.concat { root_dir, "_build", "default", "bin", ("erlang_ls%s"):format(erlang_ls_file_ext) } }, + cmd = { + path.concat { root_dir, "_build", "default", "bin", ("erlang_ls%s"):format(erlang_ls_file_ext) }, + }, }, } end diff --git a/lua/nvim-lsp-installer/servers/tflint/init.lua b/lua/nvim-lsp-installer/servers/tflint/init.lua index 24775902..d7fce6b4 100644 --- a/lua/nvim-lsp-installer/servers/tflint/init.lua +++ b/lua/nvim-lsp-installer/servers/tflint/init.lua @@ -33,28 +33,29 @@ return function(name, root_dir) }, default_options = { cmd = { bin_path, "--langserver" }, + commands = { + TFLintInit = { + function() + notify "Installing TFLint plugins…" + process.spawn( + bin_path, + { + args = { "--init" }, + cwd = path.cwd(), + stdio_sink = process.simple_sink(), + }, + vim.schedule_wrap(function(success) + if success then + notify "Successfully installed TFLint plugins." + else + notify "Failed to install TFLint plugins." + end + end) + ) + end, + description = "Runs tflint --init in the current working directory.", + }, + }, }, - post_setup = function() - function _G.lsp_installer_tflint_init() - notify "Installing TFLint plugins…" - process.spawn( - bin_path, - { - args = { "--init" }, - cwd = path.cwd(), - stdio_sink = process.simple_sink(), - }, - vim.schedule_wrap(function(success) - if success then - notify "Successfully installed TFLint plugins." - else - notify "Failed to install TFLint." - end - end) - ) - end - - vim.cmd [[ command! TFLintInit call v:lua.lsp_installer_tflint_init() ]] - end, } end diff --git a/lua/nvim-lsp-installer/servers/vala_ls/init.lua b/lua/nvim-lsp-installer/servers/vala_ls/init.lua index 94f8c6dc..b32a9fc2 100644 --- a/lua/nvim-lsp-installer/servers/vala_ls/init.lua +++ b/lua/nvim-lsp-installer/servers/vala_ls/init.lua @@ -23,7 +23,10 @@ return function(name, root_dir) context.capture(function(ctx) return installers.pipe { std.untarxz_remote(ctx.github_release_file), - std.rename(("vala-language-server-%s"):format(ctx.requested_server_version), "vala-language-server"), + std.rename( + ("vala-language-server-%s"):format(ctx.requested_server_version), + "vala-language-server" + ), } end), function(_, callback, ctx) diff --git a/lua/nvim-lsp-installer/ui/status-win/init.lua b/lua/nvim-lsp-installer/ui/status-win/init.lua index 67319afa..06f3f366 100644 --- a/lua/nvim-lsp-installer/ui/status-win/init.lua +++ b/lua/nvim-lsp-installer/ui/status-win/init.lua @@ -88,7 +88,12 @@ local function Help(is_current_settings_expanded, vader_saber_ticks) Ui.EmptyLine(), Ui.HlTextNode { { { "Problems with server functionality", "LspInstallerLabel" } }, - { { "Please refer to each language server's own homepage for further assistance.", "LspInstallerMuted" } }, + { + { + "Please refer to each language server's own homepage for further assistance.", + "LspInstallerMuted", + }, + }, }, Ui.EmptyLine(), Ui.HlTextNode { @@ -120,8 +125,7 @@ local function Header(props) { { props.is_showing_help and props.help_command_text or "", "LspInstallerHighlighted" }, { - props.is_showing_help - and "nvim-lsp-installer" .. (" "):rep(#props.help_command_text) + props.is_showing_help and "nvim-lsp-installer" .. (" "):rep(#props.help_command_text) or "nvim-lsp-installer", props.is_showing_help and "LspInstallerHighlighted" or "LspInstallerHeader", }, |
