Migrate to native lsp config and other misc stuff
This commit is contained in:
parent
50031cba0e
commit
2b05047eb9
21 changed files with 82 additions and 40 deletions
|
|
@ -15,17 +15,20 @@ return {
|
|||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
local lspconfig = require('lspconfig')
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
}
|
||||
for _, v in ipairs(vim.api.nvim_get_runtime_file('lua/lsp/*', true)) do
|
||||
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/" .. name)
|
||||
if lspconfig[name].setup ~= nil then
|
||||
lspconfig[name].setup(vim.tbl_deep_extend("force", cfg, { capabilities }))
|
||||
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
|
||||
|
|
@ -37,11 +40,12 @@ return {
|
|||
|
||||
opts = {
|
||||
tools_to_install = {
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue