1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
-- Prueft, ob alle genannten Kommandos im PATH liegen.
local function have_all(commands)
for _, command in ipairs(commands) do
if vim.fn.executable(command) == 0 then return false end
end
return true
end
return {
{
"neovim/nvim-lspconfig",
dependencies = { "saghen/blink.cmp" },
lazy = false,
config = function()
local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
-- gilt fuer alle Server und wird mit den serverspezifischen Configs gemerged
vim.lsp.config("*", {
capabilities = capabilities,
})
vim.lsp.config.lua_ls = {
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
diagnostics = {
globals = { "vim" },
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME .. "/lua",
vim.fn.stdpath("config") .. "/lua",
},
},
telemetry = {
enable = false,
},
},
},
}
vim.lsp.config.clangd = {
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--completion-style=detailed",
"--header-insertion=iwyu",
"--header-insertion-decorators",
"--pch-storage=memory",
"--all-scopes-completion",
"--inlay-hints",
"--function-arg-placeholders",
"--fallback-style=llvm",
},
}
vim.lsp.config.vtsls = {
settings = {
typescript = {
updateImportsOnFileMove = { enabled = "always" },
suggest = {
completeFunctionCalls = true,
},
inlayHints = {
enumMemberValues = { enabled = true },
functionLikeReturnTypes = { enabled = true },
parameterNames = { enabled = "all" },
parameterTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
variableTypes = { enabled = false },
},
},
javascript = {
suggest = {
completeFunctionCalls = true,
},
inlayHints = {
parameterNames = { enabled = "all" },
},
},
},
}
vim.lsp.config.basedpyright = {
settings = {
basedpyright = {
analysis = {
diagnosticMode = "openFilesOnly",
inlayHints = {
callArgumentNames = true,
},
typeCheckingMode = "basic", -- oder "strict" für strenger
autoSearchPaths = true,
useLibraryCodeForTypes = true,
},
},
},
}
vim.lsp.config.ansiblels = {
filetypes = { "yaml.ansible" }, -- Erkennung: siehe config.filetypes
settings = {
ansible = {
python = {
interpreterPath = "python3",
},
validation = {
lint = {
enabled = true,
path = "ansible-lint",
},
},
},
},
}
local servers = {
"basedpyright", -- npm install -g basedpyright, brew install basedpyright
"bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck
"clangd", -- pkg install llvm
"html", -- npm install -g vscode-langservers-extracted
"jsonls", -- npm install -g vscode-langservers-extracted
"lua_ls", -- pkg install lua-language-server, brew install lua-language-server
"prismals", -- npm install -g @prisma/language-server
"vtsls", -- npm install -g @vtsls/language-server
}
if have_all({ "ansible-language-server", "ansible-lint", "ansible" }) then
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
end
vim.lsp.enable(servers)
end,
},
}
|