Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lvim/lsp/manager): make client_is_configured more reliable #2851

Merged
merged 1 commit into from Jul 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/lvim/lsp/manager.lua
Expand Up @@ -37,9 +37,9 @@ end
-- which seems to occur only when attaching to single-files
local function client_is_configured(server_name, ft)
ft = ft or vim.bo.filetype
local active_autocmds = vim.split(vim.fn.execute("autocmd FileType " .. ft), "\n")
local active_autocmds = vim.api.nvim_get_autocmds { event = "FileType", pattern = ft }
for _, result in ipairs(active_autocmds) do
if result:match(server_name) then
if result.command:match(server_name) then
Log:debug(string.format("[%q] is already configured", server_name))
return true
end
Expand Down