tabnine-nvim icon indicating copy to clipboard operation
tabnine-nvim copied to clipboard

add build lua

Open aarondill opened this issue 2 years ago • 8 comments

feat: add a build.lua file

This is supported by lazy.nvim to automagically build the project.

aarondill avatar Nov 05 '23 22:11 aarondill

I think we shouldn't call it on every initialization (because this makes network requests), but maybe if there's no binaries installed, then run it?

aarondill avatar Nov 06 '23 12:11 aarondill

Yes, that's what I meant :).. this is how it works with other plugins

amirbilu avatar Nov 06 '23 12:11 amirbilu

@amirbilu Having tried to implement this for a while, there doesn't seem to be an easy way without up-ending the rest of the codebase.

In order to build asynchronously (and not block the entire editor), I would have to change every invocation to TabnineBinary:start and :request to be callback-based.

I can do this if you'd like, but it would be a much larger PR and likely would be a (set of) breaking change(s).

I can build it synchronously if you'd like, but this would freeze the entire editor window.

aarondill avatar Nov 06 '23 15:11 aarondill

Got you. What are you suggesting? What option is better in your opinion

amirbilu avatar Nov 06 '23 17:11 amirbilu

Got you. What are you suggesting? What option is better in your opinion

Well, ideally, we’d go to a callback-based system, but I would rather not implement those changes, so perhaps we run it synchronously and just deal with the freeze? It should only happen once anyways, right?

aarondill avatar Nov 06 '23 17:11 aarondill

Freezing the IDE sounds scary to me.. but I would not want to give up on this. Maybe I could find time to refactor this to async

amirbilu avatar Nov 08 '23 12:11 amirbilu

I've rebased this to the current state of master (eb914c268228e5a04652fbcc3aff93a5bdb996d2)

aarondill avatar Jan 12 '24 18:01 aarondill

@amirbilu Ive rethought this pr, and I think i can make it work asynchronously (I'm going to copy from nvim-treesitter's async install).

should I also add a :TabnineBuild and/or :TabnineChatBuild command here, or add that to a new PR after I finish work here?

aarondill avatar Mar 24 '24 15:03 aarondill