aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2022-12-07 20:37:16 +0800
committerGitHub <noreply@github.com>2022-12-07 20:37:16 +0800
commitc7206327096bedf2e213788a60624a84b3b7552d (patch)
tree326a7df0ee964a82122e59954004b7fb1acedda7 /plugin
parentfeat: support force stop language server (#2294) (diff)
downloadnvim-lspconfig-c7206327096bedf2e213788a60624a84b3b7552d.tar
nvim-lspconfig-c7206327096bedf2e213788a60624a84b3b7552d.tar.gz
nvim-lspconfig-c7206327096bedf2e213788a60624a84b3b7552d.tar.bz2
nvim-lspconfig-c7206327096bedf2e213788a60624a84b3b7552d.tar.lz
nvim-lspconfig-c7206327096bedf2e213788a60624a84b3b7552d.tar.xz
nvim-lspconfig-c7206327096bedf2e213788a60624a84b3b7552d.tar.zst
nvim-lspconfig-c7206327096bedf2e213788a60624a84b3b7552d.zip
fix: improve client stop logic in LspStop (#2296)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/lspconfig.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua
index d8c77493..3ecde2f1 100644
--- a/plugin/lspconfig.lua
+++ b/plugin/lspconfig.lua
@@ -131,8 +131,7 @@ api.nvim_create_user_command('LspStop', function(info)
if not server_name then
local servers_on_buffer = lsp.get_active_clients { buffer = current_buf }
for _, client in ipairs(servers_on_buffer) do
- local filetypes = client.config.filetypes
- if filetypes and vim.tbl_contains(filetypes, vim.bo[current_buf].filetype) then
+ if client.attached_buffers[current_buf] then
client.stop(force)
end
end