diff --git a/lua/tabnine/workspace.lua b/lua/tabnine/workspace.lua index 383fd30..1c80835 100644 --- a/lua/tabnine/workspace.lua +++ b/lua/tabnine/workspace.lua @@ -12,7 +12,15 @@ function M.setup() 0, 30000, vim.schedule_wrap(function() - if #vim.lsp.buf_get_clients() > 0 then + local client_count = 0 + + if vim.fn.has('nvim-0.11') == 1 then + client_count = #vim.lsp.get_clients() + else + client_count = #vim.lsp.buf_get_clients() + end + + if client_count > 0 then local root_paths = utils.set(lsp.buf.list_workspace_folders()) tabnine_binary:request({ Workspace = { root_paths = root_paths } }, function() end) end