feat(extras.tabnine): tabnine blink.cmp integration

This commit is contained in:
Stefan Boca 2024-12-02 15:08:28 -08:00
parent c6ae68259f
commit 55b7d01e44
No known key found for this signature in database

View file

@ -1,25 +1,22 @@
return {
-- Tabnine cmp source
{
"tzachar/cmp-tabnine",
build = LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
opts = {
max_lines = 1000,
max_num_results = 3,
sort = true,
},
config = function(_, opts)
require("cmp_tabnine.config"):setup(opts)
end,
},
{
"nvim-cmp",
optional = true,
dependencies = {
{
"tzachar/cmp-tabnine",
build = {
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
},
dependencies = "hrsh7th/nvim-cmp",
opts = {
max_lines = 1000,
max_num_results = 3,
sort = true,
},
config = function(_, opts)
require("cmp_tabnine.config"):setup(opts)
end,
},
},
dependencies = { "tzachar/cmp-tabnine" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, 1, {
@ -36,6 +33,36 @@ return {
end)
end,
},
{
"saghen/blink.cmp",
optional = true,
dependencies = { "tzachar/cmp-tabnine", "saghen/blink.compat" },
opts = {
sources = {
compat = { "cmp_tabnine" },
},
completion = {
menu = {
draw = {
components = {
kind = {
text = function(ctx)
return ctx.source_name == "cmp_tabnine" and "TabNine" or ctx.kind
end,
highlight = function(ctx)
return ctx.source_name == "cmp_tabnine" and "BlinkCmpKindTabNine"
or require("blink.cmp.completion.windows.render.tailwind").get_hl(ctx)
or ("BlinkCmpKind" .. ctx.kind)
end,
},
},
},
},
},
},
},
-- Show TabNine status in lualine
{
"nvim-lualine/lualine.nvim",