0.0.1
This commit is contained in:
commit
36c66e33e6
17 changed files with 348 additions and 0 deletions
58
lua/plugins/mason.lua
Normal file
58
lua/plugins/mason.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ "williamboman/mason.nvim" },
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
{ "hrsh7th/nvim-cmp" },
|
||||
},
|
||||
|
||||
config = function()
|
||||
-- Mason
|
||||
require("mason").setup()
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- Capabilities (для nvim-cmp)
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
local ok, cmp_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if ok then
|
||||
capabilities = cmp_lsp.default_capabilities(capabilities)
|
||||
end
|
||||
|
||||
-- Mason-LSP
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"clangd",
|
||||
"rust_analyzer",
|
||||
"ts_ls",
|
||||
},
|
||||
|
||||
handlers = {
|
||||
-- дефолт для всех серверов
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
|
||||
-- кастом для lua
|
||||
["lua_ls"] = function()
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue