We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cfd94f commit 1172946Copy full SHA for 1172946
1 file changed
lua/tabnine/workspace.lua
@@ -1,16 +1,21 @@
1
local tabnine_binary = require("tabnine.binary")
2
-local fn = vim.fn
3
local uv = vim.loop
+local lsp = vim.lsp
4
+local utils = require("tabnine.utils")
5
6
local M = {}
7
8
function M.setup()
9
local timer = uv.new_timer()
10
+
11
timer:start(
12
0,
13
30000,
14
vim.schedule_wrap(function()
- tabnine_binary:request({ Workspace = { root_paths = { fn.getcwd() } } }, function() end)
15
+ if #vim.lsp.buf_get_clients() > 0 then
16
+ local root_paths = utils.set(lsp.buf.list_workspace_folders())
17
+ tabnine_binary:request({ Workspace = { root_paths = root_paths } }, function() end)
18
+ end
19
end)
20
)
21
end
0 commit comments