uga-rosa / cmp-dictionary

A dictionary completion source for nvim-cmp
MIT License
250 stars 16 forks source link

is_setup returns false #12

Closed hurricanehrndz closed 2 years ago

hurricanehrndz commented 2 years ago

https://github.com/uga-rosa/cmp-dictionary/blob/b60df1d23ac97d6d919abcfcccedf10d1837d688/lua/cmp_dictionary/caches.lua#L167

Is it on purpose you want this to return false? I only ask because it seems to me that when update is called, more often than not setup would have already been called and config wouldn't be empty?

uga-rosa commented 2 years ago

This is to tell the old users to call setup because I have changed the configuration method. Originally, we used global variables.

hurricanehrndz commented 2 years ago

Thank you so much for the response and your efforts. Is the intended behaviour for the message to remain after the user has migrated?

Sent from my iPhone

On Dec 13, 2021, at 11:13 PM, uga-rosa @.***> wrote:

 This is to tell the old users to call setup because I have changed the configuration method. Originally, we used global variables.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

uga-rosa commented 2 years ago

Are you calling setup with an argument? If it still happens, it is an unintentional bug and I will fix it.

hurricanehrndz commented 2 years ago

Yes. It also happens when setup is not called and the plug-in is only installed via packer.

Sent from my iPhone

On Dec 14, 2021, at 4:39 AM, uga-rosa @.***> wrote:

 Are you calling setup with an argument? If it still happens, it is an unintentional bug and I will fix it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

uga-rosa commented 2 years ago

It is normal to end up here when you have not called setup. Can you show me your init.lua? (Just the relevant parts, please).

hurricanehrndz commented 2 years ago

I see you are right; it was a race condition.

hurricanehrndz commented 2 years ago

If you are curious, I had setup being called in an after/plugin file, once I moved it to my packer config, it was happy.

uga-rosa commented 2 years ago

Oh, you mean the setup was called after the first caches.update? Whatever the case, I'm glad it's resolved.

hurricanehrndz commented 2 years ago

I believe so...