tzachar / compe-tabnine

TabNine source for hrsh7th/nvim-compe
BSD 3-Clause "New" or "Revised" License
52 stars 3 forks source link

Disabling tabnine in compe, will still execute the TabNine process #10

Closed JoseConseco closed 3 years ago

JoseConseco commented 3 years ago

As mentioned in #9 I had to remove compe-tabnine, since disabling TabNine in compe settings wont work (autosuggesions are disabled but TabNine is sill running in background) : image TabNine takes a lot resources, I hope u can disable executing it by checking compe.tabnine variable. This later leads to errors when I want to reinstall the plug as shown in https://github.com/tzachar/compe-tabnine/issues/9#issuecomment-809700765

tzachar commented 3 years ago

Fixed in 44de1a2

JoseConseco commented 3 years ago

The updating process and worked this time and TN binaries were downloaded too: image

But now after update the TN process is not executed at all if compe.tabnine=true , no suggestions are displayed (no lsp no tn) if compe.tabnine=false , at least the default suggestions work now (lsp, snippets)

After reverting plugin init.lua, the suggestions work (from lsp and with or without TN), but TN is always running in background. It seems I cant reopen this isse on github. I'm on linux btw - there are no visible errors in console. Let me know if/how I can help (I'm new to lua and vim)

After bit of testing it seems that: if vim.g.compe vim.g.compe - is nil. Other conditions are not executed then. Not sure if this is due order of execution of plugins (compe is declared before your plug, but maybe vim thinks otherwise)

tzachar commented 3 years ago

It works in my setup. Can you please attach your init.vim ?

JoseConseco commented 3 years ago

Ok, just in case I printed the script start order (not sure if that matters) image And when i execute command: :luado print(vim.g.compo) - i got nil every time - this causes TN not to run

:filter compe let gives: image

even though I disabled 'Tags' suggestions in compe it seems to be true (actually everythign reads true), so I'm not sure where 'real' compo.settings can be read from. My Config Looks complicated but in the init.lua line 2 - install plugs (first compo, then tabnine) line 18 - setup of compe (eg. tags = false, tabnine = true etc. but when I read them in nvim commandine they all are set to v:true)

tzachar commented 3 years ago

What you see are the vim interface files loading the sources. Each source would have a loaded_compe_{source_name} load guard to prevent reloading the module. It does not mean they are used.

Also, make sure you use compe, not compo. This might be related to your issues.

As for your config files, make sure you use compe-tabnine in packer like this:

use {'tzachar/compe-tabnine', run='./install.sh', requires = 'hrsh7th/nvim-compe'}     

Also, the latest commit, ae8001c, should solve your issue. I wasn't handling lua configs properly.

JoseConseco commented 3 years ago

Thanks everything seems to work now. I have seen that Packer plugin manager does not always get proper update for other plugins too, so the problems I got when installing TabNine may not be caused by some problem on TN side. Thx for the fix