Closed paulzhang5511 closed 3 years ago
As you can see in the install.sh
script, Windows is not supported on my end as I have no way of testing it.
If you can create an appropriate install script / fix the existing one, please create a pull request.
I think the WSL Ubuntu environment should be pretty much the same thing as native ubuntu. It is also not working on NixOS, I thought It could be because of linking errors, but apparently, the TabNine binaries are statically linked.
I also think that maybe adding a way to let the user provide a TabNine binary path would be nice.
Tabnine binaries can be downloaded normally. But it dont's also work.
This is the full configuration.
The problem with TabNine is that it expects a very specific directory layout, as TabNine auto updates itself. Allowing users to supply their own path would probably netage the auto update and end up with TabNine trying endlessly to update itself (been there).
To further try and unserstand why it is not working in your setup, lets try the following:
1) check if the TabNine binary is there
2) after opening nvim, check if there is a TabNine process: ps -aef | grep -i TabNine
3) add the following to you cmp config:
formatting = {
format = function(entry, vim_item)
-- set a name for each source
vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
cmp_tabnine = "[T9]",
})[entry.source.name]
return vim_item
end,
},
and see if you get [T9]
in the completion menu
b.t.w, if you run the TabNine binary by hand does it work?
@tzachar Yeah. it work.
Well, I got a windows machine, installed wsl ubuntu 20.04, and everything works for me out of the box:
here is my config, try and see if it works: https://github.com/tzachar/conf/blob/master/.config/nvim/lua/cmp_setup.lua
The problem with TabNine is that it expects a very specific directory layout, as TabNine auto updates itself. Allowing users to supply their own path would probably netage the auto update and end up with TabNine trying endlessly to update itself (been there).
I've been thinking about how to package this for Nixpkgs, since builds don't have internet connection during buildPhase, so the install.sh script won't work, also I couldn't get to this point yet, but if the tabnine binary modifies itself in the directory it would fail due to the /nix/store directory being readonly. Is it possible to provide a different location for the tabnine folder? Such as XDG_DATA_HOME?
The problem with TabNine is that it expects a very specific directory layout, as TabNine auto updates itself. Allowing users to supply their own path would probably netage the auto update and end up with TabNine trying endlessly to update itself (been there).
I've been thinking about how to package this for Nixpkgs, since builds don't have internet connection during buildPhase, so the install.sh script won't work, also I couldn't get to this point yet, but if the tabnine binary modifies itself in the directory it would fail due to the /nix/store directory being readonly. Is it possible to provide a different location for the tabnine folder? Such as XDG_DATA_HOME?
These are two separate issues: 1) you need to install the plugin while there is no network connectivity 2) tabnine modifies itself during runtime.
I'll start with (2). You can't get past this, as the tabnine process downloads a model from the net when it is executed for the first time. without this model, tabnine will not work.
You can solve both (1) and (2) with the same approach; instead of going through the normal install process, 'freeze' a working version of the binaries and use them, making use of the same directory structure the plugin creates. You would also have to copy the ~/.config/TabNine
and ~/.local/share/TabNine
folders, as they are. This should then help you solve both issues.
As for TabNine trying to update itself, there's not much I can help, this is something you need to take with the TabNine team. Maybe there is a configuration option to disable it.
It works
What was the problem in the end?
I don't know. I updated the code. 9da5a5f
. it work.
Environment
configuration
Result
Tabnine doesn't work