mirror of
https://github.com/arkorty/Neolite.git
synced 2026-03-17 16:51:42 +00:00
Update lua/lsp-config.lua
This commit is contained in:
@@ -1,52 +1,54 @@
|
||||
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
||||
if not lspconfig_status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local mason_status_ok, mason = pcall(require, "mason")
|
||||
if not mason_status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local mason_lspconfig_status_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
|
||||
if not mason_lspconfig_status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
mason.setup({})
|
||||
mason.setup({
|
||||
ensure_installed = { "stylya", "rustfmt", "clang-format", "black", "prettier" },
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = { "lua_ls", "rust_analyzer", "clangd" },
|
||||
ensure_installed = { "lua_ls", "rust_analyzer", "clangd", "pyright", "marksman" },
|
||||
})
|
||||
|
||||
local cnl_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if not cnl_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
function(server)
|
||||
lspconfig[server].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
--["rust_analyzer"] = function()
|
||||
-- local rt_ok, rust_tools = pcall(require, "rust-tools")
|
||||
-- if rt_ok then
|
||||
-- rust_tools.setup({})
|
||||
-- end
|
||||
--end,
|
||||
function(server)
|
||||
lspconfig[server].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
--["rust_analyzer"] = function()
|
||||
-- local rt_ok, rust_tools = pcall(require, "rust-tools")
|
||||
-- if rt_ok then
|
||||
-- rust_tools.setup({})
|
||||
-- end
|
||||
--end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user