tzachar / cmp-tabnine

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

how to show tabnine status in lualine or other statusline #107

Closed cxwx closed 4 months ago

cxwx commented 4 months ago

I'd love to show tabnine status like https://github.com/Exafunction/codeium.vim?tab=readme-ov-file#show-codeium-status-in-statusline

how can I set it

tzachar commented 4 months ago

There currently no such functionality implemented. I would happily accept such a PR. which status items you think should be reported?

On Mon, Apr 29, 2024, 11:24 chenxu @.***> wrote:

I'd love to show tabnine status like

https://github.com/Exafunction/codeium.vim?tab=readme-ov-file#show-codeium-status-in-statusline

how can I set it

— Reply to this email directly, view it on GitHub https://github.com/tzachar/cmp-tabnine/issues/107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFXXC42JZAS5N7AS3P2HUTY7X7SRAVCNFSM6AAAAABG53QWTSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DQNBRHAZTINQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cxwx commented 4 months ago

just like the way https://github.com/luozhiya/fittencode.nvim/issues/28 need a function has_suggestion to return true or false for condition using in lualine but I don't know how to do it.

cxwx commented 4 months ago

@tzachar thanks for answer. Do you know how to set lualine with codeium.nvim not codeium.vim. Or could I set some lualine from counting each kind of cmp completer? like [codeium 3 completer, TabNine 3 completer,, ]

hoofcushion commented 4 months ago

I think you should ask the maintainer of codeium.nvim for where is the api to get status.

tzachar commented 4 months ago

I don't really understand the usability and workflow, as TabNine always have suggestions... If you need to support a status, you should think which states you want to report. I would suggest something like the following: 1) indicate whether TabNine is running or not 2) if running, report the last number of seggestions

Makes sense? Anything else you think should appear?

cxwx commented 4 months ago

I thought the solution could be unified to set in nvim-cmp as I could use require("cmp").get_entries()

if value.completion_item.cmp.kind_text == "TabNine" then
return true

thanks for help