mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/lsp: use vim.lsp native API
This commit is contained in:
parent
954e526448
commit
78f6ff0369
1 changed files with 12 additions and 7 deletions
|
@ -183,6 +183,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
++ mkMaps "vim.lsp.buf." "Lsp buf" cfg.keymaps.lspBuf
|
++ mkMaps "vim.lsp.buf." "Lsp buf" cfg.keymaps.lspBuf
|
||||||
++ cfg.keymaps.extra;
|
++ cfg.keymaps.extra;
|
||||||
|
|
||||||
|
# Since https://github.com/nix-community/nixvim/pull/3204, we are now using the native vim.lsp
|
||||||
|
# API for configuring language servers with nvim-lspconfig.
|
||||||
|
# For some mysterious reason, `performance.combinePlugins` now prevent language servers from
|
||||||
|
# being properly configured (missing some keys: `cmd`, `filetypes`, `root_markers` etc.)
|
||||||
|
performance.combinePlugins.standalonePlugins = [ cfg.package ];
|
||||||
|
|
||||||
plugins.lsp.onAttach = lib.mkIf cfg.inlayHints ''
|
plugins.lsp.onAttach = lib.mkIf cfg.inlayHints ''
|
||||||
-- LSP Inlay Hints {{{
|
-- LSP Inlay Hints {{{
|
||||||
if client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
|
if client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
|
||||||
|
@ -242,15 +248,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
}"}
|
}"}
|
||||||
|
|
||||||
for i, server in ipairs(__lspServers) do
|
for i, server in ipairs(__lspServers) do
|
||||||
local options = ${runWrappers cfg.setupWrappers "server.extraOptions"}
|
|
||||||
|
|
||||||
if options == nil then
|
vim.lsp.enable(server.name)
|
||||||
options = __setup
|
|
||||||
else
|
vim.lsp.config(server.name, __setup)
|
||||||
options = vim.tbl_extend("keep", options, __setup)
|
|
||||||
|
if server.extraOptions then
|
||||||
|
vim.lsp.config(server.name, server.extraOptions)
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lspconfig")[server.name].setup(options)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
${cfg.postConfig}
|
${cfg.postConfig}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue