Cleanup conditional language server installs
This commit is contained in:
parent
727ebc81a8
commit
9d5b798385
@ -1,3 +1,42 @@
|
|||||||
|
-- Language servers
|
||||||
|
local ensure_installed = {
|
||||||
|
'clangd', -- C/C++
|
||||||
|
'lua_ls', -- Lua
|
||||||
|
'opencl_ls', -- OpenCL
|
||||||
|
}
|
||||||
|
|
||||||
|
if vim.fn.executable('npm') == 1 then
|
||||||
|
local ensure_install_from_npm = {
|
||||||
|
'ansiblels', -- Ansible
|
||||||
|
'bashls', -- Bash
|
||||||
|
'docker_compose_language_service', -- Docker Compose
|
||||||
|
'dockerls', -- Dockerfile
|
||||||
|
'html', -- HTML
|
||||||
|
'jsonls', -- JSON
|
||||||
|
'vimls', -- VimScript
|
||||||
|
'yamlls', -- YAML
|
||||||
|
}
|
||||||
|
for _, package in ipairs(ensure_install_from_npm) do
|
||||||
|
table.insert(ensure_installed, package)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim.fn.executable('pip') == 1 then
|
||||||
|
local ensure_install_from_pip = {
|
||||||
|
'cmake', -- CMake
|
||||||
|
'esbonio', -- Sphinx
|
||||||
|
'pyright', -- Python
|
||||||
|
'ruff_lsp', -- Python
|
||||||
|
}
|
||||||
|
for _, package in ipairs(ensure_install_from_pip) do
|
||||||
|
table.insert(ensure_installed, package)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim.fn.has('win32') == 1 then
|
||||||
|
table.insert(ensure_installed, 'powershell_es')
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
@ -33,38 +72,6 @@ return {
|
|||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
require('mason').setup()
|
require('mason').setup()
|
||||||
local ensure_installed = {
|
|
||||||
-- Language servers
|
|
||||||
'clangd', -- C/C++
|
|
||||||
'cmake', -- CMake
|
|
||||||
'lua_ls', -- Lua
|
|
||||||
'opencl_ls', -- OpenCL
|
|
||||||
}
|
|
||||||
if vim.fn.executable('npm') == 1 then
|
|
||||||
local npm_ensure_installed = {
|
|
||||||
-- Language servers
|
|
||||||
'ansiblels', -- Ansible
|
|
||||||
'bashls', -- Bash
|
|
||||||
'docker_compose_language_service', -- Docker Compose
|
|
||||||
'dockerls', -- Dockerfile
|
|
||||||
'html', -- HTML
|
|
||||||
'jsonls', -- JSON
|
|
||||||
'vimls', -- VimScript
|
|
||||||
'yamlls', -- YAML
|
|
||||||
}
|
|
||||||
for _, package in ipairs(npm_ensure_installed) do
|
|
||||||
table.insert(ensure_installed, package)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- TODO: Where to put these?
|
|
||||||
-- Language servers
|
|
||||||
-- 'esbonio', -- Sphinx
|
|
||||||
-- 'pyright', -- Python
|
|
||||||
-- 'ruff_lsp', -- Python
|
|
||||||
-- 'lemminx', -- XML
|
|
||||||
if vim.fn.has('win32') then
|
|
||||||
table.insert(ensure_installed, 'powershell_es')
|
|
||||||
end
|
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
automatic_installation = false,
|
automatic_installation = false,
|
||||||
ensure_installed = ensure_installed,
|
ensure_installed = ensure_installed,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user