aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-04-29 16:09:54 +0800
committerGitHub <noreply@github.com>2024-04-29 16:09:54 +0800
commitae0651d850f8f9313d4db3f96fe24dbf054edeb4 (patch)
treed60796f1fc1ea1b3c7867b7a184cbd3a6fd32c3a /plugin
parentfix(command): get attached buffers list by using api (#3130) (diff)
downloadnvim-lspconfig-ae0651d850f8f9313d4db3f96fe24dbf054edeb4.tar
nvim-lspconfig-ae0651d850f8f9313d4db3f96fe24dbf054edeb4.tar.gz
nvim-lspconfig-ae0651d850f8f9313d4db3f96fe24dbf054edeb4.tar.bz2
nvim-lspconfig-ae0651d850f8f9313d4db3f96fe24dbf054edeb4.tar.lz
nvim-lspconfig-ae0651d850f8f9313d4db3f96fe24dbf054edeb4.tar.xz
nvim-lspconfig-ae0651d850f8f9313d4db3f96fe24dbf054edeb4.tar.zst
nvim-lspconfig-ae0651d850f8f9313d4db3f96fe24dbf054edeb4.zip
fix(command): check server config exist in lspconfig (#3131)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/lspconfig.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua
index 03fdc2f4..02eb5031 100644
--- a/plugin/lspconfig.lua
+++ b/plugin/lspconfig.lua
@@ -100,12 +100,14 @@ api.nvim_create_user_command('LspRestart', function(info)
100,
vim.schedule_wrap(function()
for client_name, tuple in pairs(detach_clients) do
- local client, attached_buffers = unpack(tuple)
- if client.is_stopped() then
- for buf in pairs(attached_buffers) do
- require('lspconfig.configs')[client_name].launch(buf)
+ if require('lspconfig.configs')[client_name] then
+ local client, attached_buffers = unpack(tuple)
+ if client.is_stopped() then
+ for _, buf in pairs(attached_buffers) do
+ require('lspconfig.configs')[client_name].launch(buf)
+ end
+ detach_clients[client_name] = nil
end
- detach_clients[client_name] = nil
end
end