aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nvim/lua/plugins/lsp.lua23
1 files changed, 20 insertions, 3 deletions
diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua
index e0ad450..1e552d4 100644
--- a/nvim/lua/plugins/lsp.lua
+++ b/nvim/lua/plugins/lsp.lua
@@ -1,3 +1,12 @@
1-- Prueft, ob alle genannten Kommandos im PATH liegen.
2local function have_all(commands)
3 for _, command in ipairs(commands) do
4 if vim.fn.executable(command) == 0 then return false end
5 end
6
7 return true
8end
9
1return { 10return {
2 { 11 {
3 "neovim/nvim-lspconfig", 12 "neovim/nvim-lspconfig",
@@ -97,6 +106,9 @@ return {
97 filetypes = { "yaml.ansible" }, -- Erkennung: siehe config.filetypes 106 filetypes = { "yaml.ansible" }, -- Erkennung: siehe config.filetypes
98 settings = { 107 settings = {
99 ansible = { 108 ansible = {
109 python = {
110 interpreterPath = "python3",
111 },
100 validation = { 112 validation = {
101 lint = { 113 lint = {
102 enabled = true, 114 enabled = true,
@@ -107,8 +119,7 @@ return {
107 }, 119 },
108 } 120 }
109 121
110 vim.lsp.enable({ 122 local servers = {
111 "ansiblels", -- npm install -g @ansible/ansible-language-server & (brew install ansible-lint, pkg install sysutils/py-ansible-lint)
112 "basedpyright", -- npm install -g basedpyright, brew install basedpyright 123 "basedpyright", -- npm install -g basedpyright, brew install basedpyright
113 "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck 124 "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck
114 "clangd", -- pkg install llvm 125 "clangd", -- pkg install llvm
@@ -117,7 +128,13 @@ return {
117 "lua_ls", -- pkg install lua-language-server, brew install lua-language-server 128 "lua_ls", -- pkg install lua-language-server, brew install lua-language-server
118 "prismals", -- npm install -g @prisma/language-server 129 "prismals", -- npm install -g @prisma/language-server
119 "vtsls", -- npm install -g @vtsls/language-server 130 "vtsls", -- npm install -g @vtsls/language-server
120 }) 131 }
132
133 if have_all({ "ansible-language-server", "ansible-lint", "ansible" }) then
134 table.insert(servers, 1, "ansiblels") -- npm install -g @ansible/ansible-language-server; brew install ansible-lint ansible, pkg install sysutils/py-ansible-lint sysutils/ansible
135 end
136
137 vim.lsp.enable(servers)
121 end, 138 end,
122 }, 139 },
123} 140}