diff options
| author | William Boman <william@redwill.se> | 2021-11-08 15:50:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-08 15:50:23 +0100 |
| commit | c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d (patch) | |
| tree | 4c601e6e0a16b8b53cba4a8e23f39a935e1c4aee /lua/nvim-lsp-installer/server.lua | |
| parent | remove deprecated eslintls (diff) | |
| download | mason-c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d.tar mason-c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d.tar.gz mason-c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d.tar.bz2 mason-c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d.tar.lz mason-c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d.tar.xz mason-c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d.tar.zst mason-c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d.zip | |
remove {pre,post}_setup functions (#250)
Diffstat (limited to 'lua/nvim-lsp-installer/server.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/server.lua | 14 |
1 files changed, 1 insertions, 13 deletions
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( ( |
