Comments (14)
It looks like you do not have the TabNine binary installed.
I've added a proper error message in c3a168e.
Please verify your installation by running install.sh
from cmp-tabnine.
I forgot to mention in the issue description. Actually, I have TabNine binary (which I checked in the file explorer). However, still this issue comes.
Screenshot of vim startup (after updating and running install.sh
). I have TabNine 3.6.8 binaries.
from cmp-tabnine.
Are you using WSL, or is this native windows?
from cmp-tabnine.
No, I am not using WSL. My setup is
OS: Debian GNU/Linux bookworm/sid x86_64
Kernel: 5.10.0-8-amd64
DE: GNOME 3.38.6
Shell: zsh 5.8
NVIM v0.5.0
LuaJIT 2.1.0-beta3
from cmp-tabnine.
Ok, can you do a find .
in the binaries dir?
from cmp-tabnine.
The result for find .
.
./3.6.8
./3.6.8/x86_64-unknown-linux-musl
./3.6.8/x86_64-unknown-linux-musl/TabNine
./3.6.8/x86_64-unknown-linux-musl/TabNine-deep-cloud
./3.6.8/x86_64-unknown-linux-musl/TabNine-deep-local
./3.6.8/x86_64-unknown-linux-musl/WD-TabNine
The result for tree
in the same directory.
.
└── 3.6.8
└── x86_64-unknown-linux-musl
├── TabNine
├── TabNine-deep-cloud
├── TabNine-deep-local
└── WD-TabNine
2 directories, 4 files
from cmp-tabnine.
Can you try this patch, and show me the output?
diff --git a/lua/cmp_tabnine/source.lua b/lua/cmp_tabnine/source.lua
index 6f3cd80..733b1cf 100644
--- a/lua/cmp_tabnine/source.lua
+++ b/lua/cmp_tabnine/source.lua
@@ -25,14 +25,18 @@ local binaries_folder = fn.expand('<sfile>:p:h:h:h') .. '/binaries'
local function binary()
local versions_folders = fn.globpath(binaries_folder, '*', false, true)
local versions = {}
+ dump(versions_folders)
for _, path in ipairs(versions_folders) do
+ dump(path)
for version in string.gmatch(path, '/([0-9.]+)$') do
+ dump('version:', version)
if version then
table.insert(versions, {path=path, version=version})
end
end
end
table.sort(versions, function (a, b) return a.version < b.version end)
+ dump(versions)
local latest = versions[#versions]
if not latest then
vim.notify('cmp-tabnine: Cannot find installed TabNine. Please run install.sh')
from cmp-tabnine.
The version_folder
in my case is empty. Got following dump
{}
{}
cmp-tabnine: Cannot find installed TabNine. Please run install.sh
{}
{}
cmp-tabnine: Cannot find installed TabNine. Please run install.sh
I then printed out binaries_folder
and I got "~/.dotfile/nvim/.config/binaries", which is wrong.
I guess issue is coming due to my choice of package manager. I use packer
for managing my package. packer
make packer_compiled.lua
that load, run and configure all plugins. Hence, the code fn.expand('<sfile>:p')
is giving the output as ~/.dotfile/nvim/.config/nvim/plugin/packer_compiled.lua
from cmp-tabnine.
I am also using packer, and do not have this issue.
Can you try doing require('cmp_tabnine.config').setup()
before loading any cmp
code?
A different option would be to allow users to override the automatic detection of the binaries directory.
from cmp-tabnine.
can you also try this?
diff --git a/lua/cmp_tabnine/source.lua b/lua/cmp_tabnine/source.lua
index 6f3cd80..98b69ab 100644
--- a/lua/cmp_tabnine/source.lua
+++ b/lua/cmp_tabnine/source.lua
@@ -21,9 +21,14 @@ end
-- do this once on init, otherwise on restart this dows not work
local binaries_folder = fn.expand('<sfile>:p:h:h:h') .. '/binaries'
+function script_path()
+ local str = debug.getinfo(2, "S").source:sub(2)
+ return str:match("(.*/)")
+end
+
-- locate the binary here, as expand is relative to the calling script name
local function binary()
- local versions_folders = fn.globpath(binaries_folder, '*', false, true)
+ local versions_folders = fn.globpath(script_path() .. '../../binaries', '*', false, true)
local versions = {}
for _, path in ipairs(versions_folders) do
for version in string.gmatch(path, '/([0-9.]+)$') do
from cmp-tabnine.
I was able to solve the issue with following diff (also submitted as PR #4 ).
diff --git c/lua/cmp_tabnine/source.lua w/lua/cmp_tabnine/source.lua
index 6f3cd80e7e17..ad63509cb2bc 100644
--- c/lua/cmp_tabnine/source.lua
+++ w/lua/cmp_tabnine/source.lua
@@ -17,9 +17,27 @@ local function json_decode(data)
end
end
+local function get_path_separator()
+ if ((fn.has('win64') == 1) or (fn.has('win32') == 1)) then return '\\' end
+ return '/'
+end
+
+function script_path()
+ local str = debug.getinfo(2, "S").source:sub(2)
+ return str:match("(.*" .. get_path_separator() .. ")")
+end
+
+local function get_parent_dir(path)
+ local separator = get_path_separator()
+ local pattern = "^(.+)" .. separator
+ -- if path has separator at end, remove it
+ path = string.gsub(path, separator .. '*$', '')
+ local parent_dir = string.match(path, pattern) .. separator
+ return parent_dir
+end
-- do this once on init, otherwise on restart this dows not work
-local binaries_folder = fn.expand('<sfile>:p:h:h:h') .. '/binaries'
+local binaries_folder = get_parent_dir(get_parent_dir(script_path())) .. 'binaries'
-- locate the binary here, as expand is relative to the calling script name
local function binary()
from cmp-tabnine.
closing
from cmp-tabnine.
Are you using WSL, or is this native windows?
I'm using wsl and got this error, how I can fix that?
from cmp-tabnine.
idk, please provide more info in a new issue.
from cmp-tabnine.
Related Issues (20)
- Stop tabnine with a command? HOT 1
- Integrate with official TabNine plugin HOT 1
- Overlapping completion sources HOT 2
- Failed to install tabnine from Git Bash HOT 2
- how to show tabnine status in lualine or other statusline HOT 6
- Auto-imports on Tabnine completions HOT 1
- Tabnine completion being very flaky after special characters (randomly not appearing) HOT 8
- Termux build HOT 1
- Latest TabNine binary doesnt have executable permissions HOT 2
- Tabnine sorting HOT 2
- Problem with multi-line completion preview not receiving all lines or cutting it off HOT 5
- entry.completion_item.data.detail always returns empty value HOT 2
- Cannot do the initial setup with Lazy.nvim HOT 1
- Lazy plugin manager HOT 5
- Tabnine completion items move to the right in nvim-cmp HOT 1
- Issue on startup HOT 2
- Lazynvim error HOT 2
- Insert value into documentation HOT 3
- contains byte that does not start any UTF-8 character HOT 4
- Error cmp-tabnine with Lazy.nvim HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmp-tabnine.