Check lsp client is active for all language files (#790)

This commit is contained in:
hui.liu 2021-07-09 00:35:41 +08:00 committed by GitHub
parent 9233611bdc
commit 53fed9d655
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 412 additions and 291 deletions

View file

@ -8,6 +8,16 @@ function lv_utils.reload_lv_config()
vim.cmd ":PackerInstall"
end
function lv_utils.check_lsp_client_active(name)
local clients = vim.lsp.get_active_clients()
for _, client in pairs(clients) do
if client.name == name then
return true
end
end
return false
end
function lv_utils.define_augroups(definitions) -- {{{1
-- Create autocommand groups based on the passed definitions
--