feat(lsp): Begone mason.nvim
This commit is contained in:
parent
8c4b705df9
commit
6e0b394896
2 changed files with 21 additions and 57 deletions
|
@ -1,16 +1,5 @@
|
|||
return {
|
||||
{ import = "plugins/languages" },
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
config = function() end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
|
@ -51,51 +40,27 @@ return {
|
|||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
-- default handler
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
-- overrides
|
||||
["rust_analyzer"] = function()
|
||||
require("lazy").load({ plugins = { "rust-tools.nvim" } })
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
if vim.fn.executable("lua-language-server") ~= 0 then
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
})
|
||||
end,
|
||||
["ltex"] = function()
|
||||
lspconfig.ltex.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "auto",
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
})
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue