Skip to content

Commit

Permalink
workspace from lsp
Browse files Browse the repository at this point in the history
  • Loading branch information
amirbilu committed Mar 24, 2024
1 parent 4cfd94f commit a55acb2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lua/tabnine/workspace.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
local tabnine_binary = require("tabnine.binary")
local fn = vim.fn
local uv = vim.loop
local lsp = vim.lsp
local utils = require("tabnine.utils")

local M = {}

function M.setup()
local timer = uv.new_timer()

timer:start(
0,
30000,
vim.schedule_wrap(function()
tabnine_binary:request({ Workspace = { root_paths = { fn.getcwd() } } }, function() end)
if #vim.lsp.buf_get_clients() > 0 then
local root_paths = utils.set(lsp.buf.list_workspace_folders())
tabnine_binary:request({ Workspace = { root_paths = root_paths } }, function() end)
end
end)
)
end
Expand Down

0 comments on commit a55acb2

Please sign in to comment.