2021-11-26 18:19:36 +02:00
|
|
|
local lsp_installer = require("nvim-lsp-installer")
|
|
|
|
|
|
|
|
-- Register a handler that will be called for all installed servers.
|
|
|
|
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
|
|
|
|
lsp_installer.on_server_ready(function(server)
|
|
|
|
local opts = {}
|
|
|
|
print(server.name)
|
|
|
|
|
|
|
|
-- (optional) Customize the options passed to the server
|
|
|
|
if server.name == "sumneko_lua" then
|
|
|
|
local runtime_path = vim.split(package.path, ';')
|
|
|
|
opts = {
|
|
|
|
settings = {
|
|
|
|
Lua = {
|
|
|
|
runtime = {
|
|
|
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
|
|
|
version = 'LuaJIT',
|
|
|
|
-- Setup your lua path
|
|
|
|
path = runtime_path
|
|
|
|
},
|
|
|
|
diagnostics = {
|
|
|
|
-- Get the language server to recognize the `vim` global
|
|
|
|
globals = {'vim'}
|
|
|
|
},
|
|
|
|
workspace = {
|
|
|
|
-- Make the server aware of Neovim runtime files
|
|
|
|
library = vim.api.nvim_get_runtime_file("", true)
|
|
|
|
},
|
|
|
|
-- Do not send telemetry data containing a randomized but unique identifier
|
|
|
|
telemetry = {enable = false}
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2021-11-26 18:19:36 +02:00
|
|
|
-- This setup() function is exactly the same as lspconfig's setup function.
|
|
|
|
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
|
|
|
server:setup(opts)
|
|
|
|
end)
|