aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/server.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/server.lua')
-rw-r--r--lua/nvim-lsp-installer/server.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua
index edc80253..5aa75825 100644
--- a/lua/nvim-lsp-installer/server.lua
+++ b/lua/nvim-lsp-installer/server.lua
@@ -31,6 +31,9 @@ M.Server.__index = M.Server
-- Use this to defer setting up server specific things until they're actually
-- needed, like custom commands.
--
+-- @field pre_setup (function) An optional function to be executed prior to calling lspconfig's setup().
+-- Use this to defer setting up server specific things until they're actually needed.
+--
function M.Server:new(opts)
return setmetatable({
name = opts.name,
@@ -39,10 +42,14 @@ function M.Server:new(opts)
_default_options = opts.default_options,
_pre_install_check = opts.pre_install_check,
_post_setup = opts.post_setup,
+ _pre_setup = opts.pre_setup,
}, M.Server)
end
function M.Server:setup(opts)
+ if self._pre_setup then
+ 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.