refactor: migrate to vim.lsp.config/enable
This commit is contained in:
@@ -48,33 +48,27 @@ M.capabilities.textDocument.completion.completionItem = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
M.defaults = function()
|
M.defaults = function()
|
||||||
|
vim.lsp.config("*", { capabilities = M.capabilities, on_init = M.on_init, on_attach = M.on_attach })
|
||||||
|
|
||||||
dofile(vim.g.base46_cache .. "lsp")
|
dofile(vim.g.base46_cache .. "lsp")
|
||||||
require("nvchad.lsp").diagnostic_config()
|
require("nvchad.lsp").diagnostic_config()
|
||||||
|
|
||||||
require("lspconfig").lua_ls.setup {
|
vim.lsp.config("lua_ls", {
|
||||||
on_attach = M.on_attach,
|
|
||||||
capabilities = M.capabilities,
|
|
||||||
on_init = M.on_init,
|
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
diagnostics = {
|
|
||||||
globals = { "vim" },
|
|
||||||
},
|
|
||||||
workspace = {
|
workspace = {
|
||||||
library = {
|
library = {
|
||||||
vim.fn.expand "$VIMRUNTIME/lua",
|
vim.fn.expand "$VIMRUNTIME/lua",
|
||||||
vim.fn.expand "$VIMRUNTIME/lua/vim/lsp",
|
|
||||||
vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types",
|
vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types",
|
||||||
vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy",
|
vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy",
|
||||||
"${3rd}/luv/library",
|
"${3rd}/luv/library",
|
||||||
},
|
},
|
||||||
maxPreload = 100000,
|
|
||||||
preloadFileSize = 10000,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable "lua_ls"
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
Reference in New Issue
Block a user