81 lines
2.9 KiB
Lua
81 lines
2.9 KiB
Lua
vim.diagnostic.config({
|
|
virtual_lines = false,
|
|
virtual_text = false,
|
|
signs = {
|
|
text = {
|
|
[vim.diagnostic.severity.ERROR] = "",
|
|
[vim.diagnostic.severity.WARN] = "",
|
|
[vim.diagnostic.severity.HINT] = "",
|
|
[vim.diagnostic.severity.INFO] = "",
|
|
},
|
|
},
|
|
})
|
|
|
|
return {
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
config = function()
|
|
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
|
|
local name = vim.fn.fnamemodify(v, ':t:r')
|
|
local cfg = require("lsp_extend/" .. name)
|
|
if vim.lsp.config[name] ~= nil then
|
|
vim.lsp.config(name, vim.tbl_deep_extend("force", cfg, {
|
|
settings = { [name] = { capabilities } }
|
|
}))
|
|
vim.lsp.enable(name)
|
|
else
|
|
vim.notify("LSP server " .. name .. " does not have a setup function", vim.log.levels.ERROR)
|
|
end
|
|
end
|
|
end
|
|
},
|
|
{
|
|
"williamboman/mason.nvim",
|
|
|
|
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",
|
|
"golangci-lint-langserver", "golangci-lint"
|
|
}
|
|
},
|
|
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()
|
|
local null_ls = require("null-ls")
|
|
|
|
null_ls.setup({
|
|
sources = {
|
|
null_ls.builtins.diagnostics.dotenv_linter,
|
|
null_ls.builtins.diagnostics.editorconfig_checker,
|
|
null_ls.builtins.diagnostics.proselint,
|
|
null_ls.builtins.diagnostics.alex
|
|
},
|
|
})
|
|
end
|
|
}
|
|
}
|