nvim-config11/lua/plugins/lsp.lua

83 lines
2.9 KiB
Lua
Raw Normal View History

2025-03-27 08:18:20 +00:00
vim.diagnostic.config({
2025-08-06 17:12:25 +01:00
virtual_lines = false,
virtual_text = false,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "󰅙",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.HINT] = "󰌵",
[vim.diagnostic.severity.INFO] = "",
},
},
2025-03-27 08:18:20 +00:00
})
return {
2025-03-31 11:19:48 +01:00
{
"neovim/nvim-lspconfig",
config = function()
2025-04-04 14:59:29 +01:00
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
vim.lsp.config('*', { capabilities })
for _, v in ipairs(vim.api.nvim_get_runtime_file('lua/lsp_extend/*', true)) do
2025-03-31 11:19:48 +01:00
local name = vim.fn.fnamemodify(v, ':t:r')
local cfg = require("lsp_extend/" .. name)
if vim.lsp.config[name] ~= nil then
2025-09-28 16:40:52 +00:00
if cfg ~= nil and next(cfg) ~= nil then
vim.lsp.config(name, cfg)
end
vim.lsp.enable(name)
2025-07-16 19:16:58 +00:00
else
2025-09-28 16:40:52 +00:00
vim.notify("LSP server " .. name .. " configuration could not load from lspconfig.",
vim.log.levels.ERROR)
2025-07-16 19:16:58 +00:00
end
2025-03-31 11:19:48 +01:00
end
end
},
2025-03-27 08:18:20 +00:00
{
"williamboman/mason.nvim",
2025-03-27 08:18:20 +00:00
opts = {
tools_to_install = {
"tree-sitter-cli", "lua-language-server", "vtsls", "ruff",
"mypy", "black", "pyright", "emmet-language-server",
"tailwindcss-language-server", "eslint-lsp", "lemminx",
"gopls", "prettierd", "dotenv-linter", "editorconfig-checker",
"rust-analyzer", "taplo", "kulala-fmt", "json-lsp",
"harper-ls", "proselint", "alex", "yaml-language-server",
2025-08-20 01:54:27 +01:00
"golangci-lint-langserver", "golangci-lint"
2025-03-27 08:18:20 +00:00
}
},
config = function(_, opts)
require("mason").setup()
local mason_registry = require("mason-registry")
mason_registry.refresh()
for _, tool in pairs(opts.tools_to_install) do
local package = mason_registry.get_package(tool)
if not package:is_installed() then
package:install()
end
end
end
},
{
"nvimtools/none-ls.nvim",
dependencies = { "nvimtools/none-ls-extras.nvim" },
config = function()
2025-03-27 08:18:20 +00:00
local null_ls = require("null-ls")
2025-07-16 19:16:58 +00:00
2025-03-27 08:18:20 +00:00
null_ls.setup({
sources = {
2025-03-27 12:48:32 +00:00
null_ls.builtins.diagnostics.dotenv_linter,
null_ls.builtins.diagnostics.editorconfig_checker,
2025-04-01 18:05:47 +01:00
null_ls.builtins.diagnostics.proselint,
null_ls.builtins.diagnostics.alex
2025-03-27 08:18:20 +00:00
},
})
end
}
}