tzachar/compe-tabnine

compe-tabnine won install with https://github.com/wbthomason/packer.nvim

JoseConseco opened this issue · 8 comments

I get error when installing this plugin with packer plugin manager. Only generic info is given -'cant install Plugin tzachar /
compe-tabnine ' or somehting like that.

init.lua :

local install_path = vim.fn.stdpath('data') ..  '/site/pack/packer/start/packer.nvim'

if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
    vim.api.nvim_command('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
    vim.api.nvim_command 'packadd packer.nvim'
end

vim.cmd 'autocmd BufWritePost plugins.lua PackerCompile' -- Auto compile when there are changes in plugins.lua
-- require("packer").init({clone_timeout=100})
return require("packer").startup(
    function(use)
        use "neovim/nvim-lspconfig"
	use "hrsh7th/nvim-compe" --completion
	use 'hrsh7th/vim-vsnip'-- auto completion
	-- use 'codota/tabnine-vim' --not compatible with compe..
	use {'tzachar/compe-tabnine'}  --error when install. We can also try
	--use {'tzachar/compe-tabnine', run='./install.sh' }  --but wont work either

    end
)     

In the end I manually executed install.sh, changed path in you plugin to it and it works. But I wish you could fix installation with packer.nvim

Link to plug manager: https://github.com/wbthomason/packer.nvim

Seems to work for me using the following:

local install_path = vim.fn.stdpath('data') ..  '/site/pack/packer/start/packer.nvim'                                                                                 
                                                                                                                                                                      
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then                                                                                                                   
    vim.api.nvim_command('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)                                                                     
    vim.api.nvim_command 'packadd packer.nvim'                                                                                                                        
end                                                                                                                                                                   
                                                                                                                                                                      
vim.cmd 'autocmd BufWritePost plugins.lua PackerCompile' -- Auto compile when there are changes in plugins.lua                                                        
-- require("packer").init({clone_timeout=100})                                                                                                                        
return require("packer").startup(                                                                                                                                     
        function(use)                                                                                                                                                 
                use 'wbthomason/packer.nvim'                                                                                                                          
                use "neovim/nvim-lspconfig"                                                                                                                           
                use "hrsh7th/nvim-compe" --completion                                                                                                                 
                use {'tzachar/compe-tabnine', run='./install.sh' }  
end
)

Everything seems to be working fine.

ok my bad. I just tested it again an it worked. I think this plugin is downloading stuff in background and takes some time to install, and it may hit Packer manager time limit. Right now it was takin about 50 sec to install, and default time is 👍
clone_timeout=60
So possibly previously I just went above this time and addon would not install. THis time it worked so thx, for great plug. Btw you may want to put :
use {'tzachar/compe-tabnine', run='./install.sh'}
in docs now for- Packer

I had problems with plugin so I disabled it, discovered it was causing suggestion mess, then when I wanted to enable it again for testing, and I had this error:
obraz
I think at successful install, the install takes long time and 'binary' folder was created at home dir... But after failed reinstal:

it fails fast (like it did not even start to download tabnine)
addon it is searching for 'binary' in: ~/.local/share/nvim/site/pack/packer/start/tab-nine - but the folder does not exist.

Also on successful install, it looked like multiple TabNine executables were downloaded - lin, win, mac (that would explain slow install time)
I will create new task, related to what problem I have with generated suggestions, after I manually set binary path to tabnine executable in your lua script

And the suggestions seems to work fine now, I have only one though... I'm not sure, maybe I have run out of trial (30 full suggestions per day?). I'm on linux btw. I will check tomorrow if suggestions work.

ok my bad. I just tested it again an it worked. I think this plugin is downloading stuff in background and takes some time to install, and it may hit Packer manager time limit. Right now it was takin about 50 sec to install, and default time is
clone_timeout=60
So possibly previously I just went above this time and addon would not install. THis time it worked so thx, for great plug. Btw you may want to put :
use {'tzachar/compe-tabnine', run='./install.sh'}
in docs now for- Packer

I'll add packer instructions to the docs.

And the suggestions seems to work fine now, I have only one though... I'm not sure, maybe I have run out of trial (30 full suggestions per day?). I'm on linux btw. I will check tomorrow if suggestions work.

There is no trial period for tabnine, as far as I know. You just get shorter/less suggestions.

@JoseConseco Is this still an issue?
I've been using packer for a while now and haven't encountered any problems.

all seems to be working fine now. I will close the issue