Remove deprecation warning about lspconfig
This commit is contained in:
parent
1ae28d39ec
commit
8075ec0091
2 changed files with 25 additions and 27 deletions
|
|
@ -53,7 +53,8 @@ with builtins;
|
||||||
|
|
||||||
# cosmetic improvements
|
# cosmetic improvements
|
||||||
catppuccin-nvim
|
catppuccin-nvim
|
||||||
vim-illuminate
|
vim-illuminate # highlight cursor-word
|
||||||
|
nvim-web-devicons
|
||||||
{
|
{
|
||||||
plugin = rainbow;
|
plugin = rainbow;
|
||||||
config = ''
|
config = ''
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,6 @@
|
||||||
local nvim_lsp = require("lspconfig")
|
vim.lsp.config('*', {
|
||||||
--
|
capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
-- https://vonheikemen.github.io/devlog/tools/setup-nvim-lspconfig-plus-nvim-cmp/
|
})
|
||||||
local lsp_defaults = nvim_lsp.util.default_config
|
|
||||||
lsp_defaults.capabilities = vim.tbl_deep_extend(
|
|
||||||
'force',
|
|
||||||
lsp_defaults.capabilities,
|
|
||||||
require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
desc = "LSP actions",
|
desc = "LSP actions",
|
||||||
|
|
@ -61,7 +55,7 @@ vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
nvim_lsp.diagnosticls.setup {
|
vim.lsp.config("diagnosticls", {
|
||||||
cmd = { "@diagnostic_server@/bin/diagnostic-languageserver", '--stdio' },
|
cmd = { "@diagnostic_server@/bin/diagnostic-languageserver", '--stdio' },
|
||||||
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'css', 'scss', 'markdown', 'pandoc',
|
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'css', 'scss', 'markdown', 'pandoc',
|
||||||
'prisma' },
|
'prisma' },
|
||||||
|
|
@ -140,17 +134,17 @@ nvim_lsp.diagnosticls.setup {
|
||||||
prisma = 'prettier'
|
prisma = 'prettier'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
vim.lsp.enable("diagnosticls");
|
||||||
|
|
||||||
nvim_lsp.elmls.setup {
|
vim.lsp.config("elmls", {})
|
||||||
}
|
|
||||||
|
|
||||||
local capabilitiesWithoutFomatting = vim.lsp.protocol.make_client_capabilities()
|
local capabilitiesWithoutFomatting = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilitiesWithoutFomatting.textDocument.formatting = false
|
capabilitiesWithoutFomatting.textDocument.formatting = false
|
||||||
capabilitiesWithoutFomatting.textDocument.rangeFormatting = false
|
capabilitiesWithoutFomatting.textDocument.rangeFormatting = false
|
||||||
capabilitiesWithoutFomatting.textDocument.range_formatting = false
|
capabilitiesWithoutFomatting.textDocument.range_formatting = false
|
||||||
|
|
||||||
nvim_lsp.ts_ls.setup {
|
vim.lsp.config("ts_ls", {
|
||||||
cmd = { "typescript-language-server", '--stdio' },
|
cmd = { "typescript-language-server", '--stdio' },
|
||||||
init_options = {
|
init_options = {
|
||||||
hostInfo = "neovim",
|
hostInfo = "neovim",
|
||||||
|
|
@ -158,16 +152,19 @@ nvim_lsp.ts_ls.setup {
|
||||||
preferences = { quotePreference = "single", allowIncompleteCompletions = false },
|
preferences = { quotePreference = "single", allowIncompleteCompletions = false },
|
||||||
capabilities = capabilitiesWithoutFomatting
|
capabilities = capabilitiesWithoutFomatting
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
nvim_lsp.elixirls.setup {
|
vim.lsp.config("elixirls", {
|
||||||
cmd = { "elixir-ls" },
|
cmd = { "elixir-ls" },
|
||||||
}
|
})
|
||||||
nvim_lsp.nixd.setup {
|
|
||||||
cmd = { "@nixd@/bin/nixd" },
|
|
||||||
}
|
|
||||||
nvim_lsp.rust_analyzer.setup {}
|
|
||||||
|
|
||||||
nvim_lsp.lua_ls.setup {
|
vim.lsp.config("nixd", {
|
||||||
|
cmd = { "@nixd@/bin/nixd" },
|
||||||
|
});
|
||||||
|
vim.lsp.enable("nixd");
|
||||||
|
|
||||||
|
vim.lsp.config("rust_analyzer", {})
|
||||||
|
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
cmd = { "@lua_ls@/bin/lua-language-server" },
|
cmd = { "@lua_ls@/bin/lua-language-server" },
|
||||||
single_file_support = true,
|
single_file_support = true,
|
||||||
flags = {
|
flags = {
|
||||||
|
|
@ -180,10 +177,10 @@ nvim_lsp.lua_ls.setup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
nvim_lsp.texlab.setup {}
|
vim.lsp.config("texlab", {})
|
||||||
|
|
||||||
nvim_lsp.gleam.setup {}
|
vim.lsp.config("gleam", {})
|
||||||
|
|
||||||
nvim_lsp.dartls.setup {}
|
vim.lsp.config("dartls", {})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue