hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.45k stars 370 forks source link

Allow comparators access to the complete list of entries #1894

Open scratchyone opened 2 months ago

scratchyone commented 2 months ago

This is a small change that allows comparators to access the entire list of entries, by adding an optional comparator argument that contains the current list of completion entries. This makes it easier for slow comparators (for example, something requiring an API call, disk I/O, or ML model execution) to batch their computations, execute them all at once, and then return cached results for the rest of the comparisons.