tzachar / cmp-tabnine

TabNine plugin for hrsh7th/nvim-cmp
MIT License
286 stars 27 forks source link

Cant make Tabnine work on Mac M1 #76

Closed Abraxas-365 closed 1 year ago

Abraxas-365 commented 1 year ago

Hi Im trying to use tabnine on Mac M1, after installing the plugin and and enabling the plugin on cmp , nothing shows , also I have not available :CmpTabnineHub

tzachar commented 1 year ago

Did you configure it correctly?

Abraxas-365 commented 1 year ago

Hi , this is my relevant config

`local source_mapping = { buffer = "[Buffer]", nvim_lsp = "[LSP]", nvim_lua = "[Lua]", cmp_tabnine = "[T9]", path = "[Path]", luasnip = "[SNP]", } -- load vs-code like snippets from plugins (e.g. friendly-snippets) require("luasnip/loaders/from_vscode").lazy_load() vim.opt.completeopt = "menu,menuone,noselect"

cmp.setup({ snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, },

-- sources for autocompletion sources = cmp.config.sources({ { name = "cmp_tabnine" }, { name = "nvim_lsp", max_item_count = 20 }, -- lsp { name = "luasnip", max_item_count = 10 }, -- snippets { name = "buffer", max_item_count = 10 }, -- text within current buffer { name = "path" }, -- file system paths }), -- -- configure lspkind for vs-code like icons formatting = { format = function(entry, vim_item) -- if you have lspkind installed, you can use it like -- in the following line: vim_item.kind = lspkind.symbolic(vim_item.kind, { mode = "symbol" }) vim_item.menu = source_mapping[entry.source.name] if entry.source.name == "cmp_tabnine" then local detail = (entry.completion_item.data or {}).detail vim_item.kind = "" if detail and detail:find(".%%.") then vim_item.kind = vim_item.kind .. " " .. detail end end local maxwidth = 50 vim_item.abbr = string.sub(vim_item.abbr, 1, maxwidth) return vim_item end, }, window = { completion = { pumheight = 5 }, }, }) local tabnine = require("cmp_tabnine.config")

tabnine:setup({ max_lines = 1000, max_num_results = 20, sort = true, priority = 5000, show_prediction_strength = true, run_on_every_keystroke = true, }) `

tzachar commented 1 year ago

I think it means the after/plugin/cmp-tabnine.lua file is not executed for some reason. Check if everything works if you do: :lua require('cmp_tabnine').setup()

Which plugin manager are you using?

Abraxas-365 commented 1 year ago

Im using packer

When I run :lua require('cmp_tabnine').setup() cmp get another tabnine source

ready source names

tzachar commented 1 year ago

Why do yu have TabNine 3 times in cmpStatus? Other than that, everything looks like it should work.

Abraxas-365 commented 1 year ago

Because when I run the command :lua require('cmp_tabnine').setup() it spawn a new instance, but normally it is only one.

Also y have this error message when trying to run :CmpTabnineHub : "Not an editor command"

tzachar commented 1 year ago

This makes no sense. The command should be registered from the plugin's after folder.

Abraxas-365 commented 1 year ago

I finally make it work, I commented all my init.lua except for cmp and tabnine , run nvim , and it work then uncomment all and it works , maybe it was a weird bug of my nvim or my mac

Abraxas-365 commented 1 year ago

I almost forgot , the :CmpTabnineHub still not working but at least the completion yes , its so weird