Fix executable names when checking for language servers

This commit is contained in:
Evie Litherland-Smith 2023-06-13 08:28:20 +01:00
parent e14970c8e6
commit 932dfdd4b8

View file

@ -51,31 +51,12 @@ local config = function()
} }
local lsp = require("lspconfig") local lsp = require("lspconfig")
if vim.fn.executable("pyright") == 1 then lsp["pyright"].setup(lsp_config) end if vim.fn.executable("pyright") == 1 then lsp["pyright"].setup(lsp_config) end
if vim.fn.executable("ruff_lsp") == 1 then lsp["ruff_lsp"].setup(lsp_config) end if vim.fn.executable("ruff-lsp") == 1 then lsp["ruff_lsp"].setup(lsp_config) end
if vim.fn.executable("lua-language-server") == 1 then lsp["lua_ls"].setup(lsp_config) end if vim.fn.executable("lua-language-server") == 1 then lsp["lua_ls"].setup(lsp_config) end
if vim.fn.executable("fortls") == 1 then lsp["fortls"].setup(lsp_config) end if vim.fn.executable("fortls") == 1 then lsp["fortls"].setup(lsp_config) end
if vim.fn.executable("yamlls") == 1 then lsp["yamlls"].setup(lsp_config) end if vim.fn.executable("yaml-language-server") == 1 then lsp["yamlls"].setup(lsp_config) end
if vim.fn.executable("vimls") == 1 then lsp["vimls"].setup(lsp_config) end if vim.fn.executable("vim-language-server") == 1 then lsp["vimls"].setup(lsp_config) end
if vim.fn.executable("bashls") == 1 then lsp["bashls"].setup(lsp_config) end if vim.fn.executable("bash-language-server") == 1 then lsp["bashls"].setup(lsp_config) end
-- local servers = {
-- {"pyright"},
-- {"ruff_lsp"},
-- {"nil_ls"},
-- {"lua_langauge_server", "lua_ls"},
-- {"fortls"},
-- {"yamlls"},
-- {"vimls"},
-- {"bashls"},
-- }
-- for _, name in ipairs(servers) do
-- if vim.fn.executable(name[0]) == 1 then
-- require("lspconfig")[name[1]].setup {
-- on_attach = on_attach,
-- flags = lsp_flags,
-- capabilities = capabilities,
-- }
-- end
-- end
local builtins = require "null-ls.builtins" local builtins = require "null-ls.builtins"
local cspell = require "cspell" local cspell = require "cspell"