fix(lsp): only install if not already available
This commit is contained in:
+5
-4
@@ -320,21 +320,22 @@ function M:setup()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if vim.fn.executable(self.lspconfig.cmd[1]) == 1 then
|
||||||
|
self:configure_client()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if self.mason then
|
if self.mason then
|
||||||
self:install(function (success)
|
self:install(function (success)
|
||||||
if success then
|
if success then
|
||||||
self:configure_client()
|
self:configure_client()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
|
||||||
if vim.fn.executable(self.lspconfig.cmd[1]) == 1 then
|
|
||||||
self:configure_client()
|
|
||||||
else
|
else
|
||||||
utils.warn(self.name .. " not installed, disabling", module_name)
|
utils.warn(self.name .. " not installed, disabling", module_name)
|
||||||
self.enable = false
|
self.enable = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
--- Register autocmd for setting up LSP server upon entering a buffer of related filetype
|
--- Register autocmd for setting up LSP server upon entering a buffer of related filetype
|
||||||
function M:register()
|
function M:register()
|
||||||
|
|||||||
Reference in New Issue
Block a user