refactor: extract LSP servers and mason tool extras

This commit is contained in:
Brian Henderson 2026-04-14 21:29:09 +02:00
parent 2d05423ac2
commit 4e2e35ed6a
No known key found for this signature in database
3 changed files with 28 additions and 27 deletions

View File

@ -641,26 +641,6 @@ require('lazy').setup({
Lua = {}, Lua = {},
}, },
}, },
-- my customizations
clangd = {},
gopls = {},
pyright = {
settings = {
pyright = {
-- Using Ruff's import organizer
disableOrganizeImports = true,
},
python = {
analysis = {
-- Ignore all files for analysis to exclusively use Ruff for linting
ignore = { '*' },
},
},
},
},
ts_ls = {},
ruff = {},
} }
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
@ -673,13 +653,6 @@ require('lazy').setup({
local ensure_installed = vim.tbl_keys(servers or {}) local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, { vim.list_extend(ensure_installed, {
-- You can add other tools here that you want Mason to install -- You can add other tools here that you want Mason to install
-- my customizations
'markdownlint',
'mypy',
'jq',
'prettier',
'codelldb',
}) })
require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-tool-installer').setup { ensure_installed = ensure_installed }

View File

@ -0,0 +1,16 @@
vim.lsp.config('pyright', {
settings = {
pyright = { disableOrganizeImports = true },
python = { analysis = { ignore = { '*' } } },
},
})
return {
{
'mason-org/mason-lspconfig.nvim',
opts = {
ensure_installed = { 'clangd', 'gopls', 'pyright', 'ts_ls', 'ruff' },
automatic_enable = true,
},
},
}

View File

@ -0,0 +1,12 @@
vim.api.nvim_create_autocmd('User', {
pattern = 'VeryLazy', once = true,
callback = function()
local mr = require 'mason-registry'
mr.refresh(function()
local p = mr.get_package 'codelldb'
if not p:is_installed() then p:install() end
end)
end,
})
return {}