uga-rosa / cmp-dictionary

A dictionary completion source for nvim-cmp
MIT License
237 stars 17 forks source link

indexing in caches.lua #11

Closed amiroslaw closed 2 years ago

amiroslaw commented 2 years ago

When I've updated cmp-dictionary and nvim to 0.6 I get 2 errors: The first is when I have async enabled and the mpack can't be find - I don't know if I have to install that or the new nvim should provide it. vim.g.cmp_dictionary_async = true cmp_dictionary/caches.lua:32 module mpack not found

When I disable async I get this error:

Error executing luv callback:
...acker/start/cmp-dictionary/lua/cmp_dictionary/caches.lua:49: attempt to index a nil value
stack traceback:
        ...acker/start/cmp-dictionary/lua/cmp_dictionary/caches.lua:49: in function 'indexing'
        ...acker/start/cmp-dictionary/lua/cmp_dictionary/caches.lua:119: in function '_create_cache'
        ...acker/start/cmp-dictionary/lua/cmp_dictionary/caches.lua:129: in function 'create_cache_sync'
        ...acker/start/cmp-dictionary/lua/cmp_dictionary/caches.lua:219: in function <...acker/start/cmp-dictionary/lua/cmp_dictionary/caches.lua:205>
uga-rosa commented 2 years ago

Please build from source and leave that directory undeleted. It seems to use the mpack there. It does not seem to be copied by make install.

uga-rosa commented 2 years ago

I'll look into caches.lua. Do you use more than one dictionary?

uga-rosa commented 2 years ago

Is there anything else you have set up? It looks like g:cmp_dictionary_exact is specified larger than the maximum number of characters.

amiroslaw commented 2 years ago

To be honest after reboot it started to work when I installed package lua51-mpack on the manjaro. I have 2 dictionaries and configuration: vim.g.cmp_dictionary_async = true vim.g.cmp_dictionary_exact = -1 for the cmp: completion = { keyword_length = 3, },

uga-rosa commented 2 years ago

That's good :) I've added it to the readme. If it recurs again, please reopen it.