saadparwaiz1 / cmp_luasnip

luasnip completion source for nvim-cmp
Apache License 2.0
687 stars 32 forks source link

feat(choiceNodes): add source for choice nodes #45

Closed saadparwaiz1 closed 4 months ago

saadparwaiz1 commented 2 years ago

43

L3MON4D3 commented 2 years ago

Oh nice, that was fast :D I think I'll add some api-functions for getting/setting choices to Luasnip, if anything changes internally we can prevent incompatibilities. But it might be best to not use them right away in this patch, but do a follow-up when they were available in Luasnip for a while, that should prevent issues like those from the switch to add_snippets.

L3MON4D3 commented 2 years ago

I added get_current_choices and set_choice to require("luasnip").

On second thought, it probably won't hurt to use these in a new source, putting some small warning to update luasnip before using it somewhere should be enough

saadparwaiz1 commented 2 years ago

yeah sure sounds good. once @p0da can try it out I'll update it

p0da commented 2 years ago

Sorry for the delay, the extra source works quite well (may want to toss a mention in the readme about it). One quick question, is there any way to activate the source automatically (and prompt the user with the relevant choices) when jumping to a choice node as that would be a nice additional improvement.

L3MON4D3 commented 2 years ago

If it's possible to trigger cmp from lua, you could use LuaSnips events

saadparwaiz1 commented 2 years ago

@L3MON4D3 have updated the code base to use the new api. let me know if it looks ok and I'll merge

saadparwaiz1 commented 2 years ago

A bit busy with work hopefully will pick this up in the coming weekend :)

Equilibris commented 2 years ago

Will this be merged in the near future?

saadparwaiz1 commented 2 years ago

Hi there, yes :) hopefully. Just been busy with my new job so haven't had the time to do some final things on this

Equilibris commented 2 years ago

Ok all good. Hope all is going well with all of that

thezealousfool commented 2 years ago

Looking forward to this

rodhash commented 2 years ago

+1 looking forward to this!

I even switchted to the branch to try it out .. I wish I had more lua skills to help

saadparwaiz1 commented 1 year ago

Hi everyone. Sorry for the delays on dev stuff! Been on a vacation plus just general busy with life. I'll be back next week and hope to finish this feature soon :)

zspher commented 8 months ago

any updates on this?