Am I the only one who struggle with cmp comparators? I can’t make any setup to work like I want it to work.

Like come on, diagramIds is literally on the line above …

The comparators aren’t even documented: https://github.com/hrsh7th/nvim-cmp/issues/883

This is the closest thing I could find to usefull: https://github.com/hrsh7th/nvim-cmp/issues/183 but it didn’t help either

How did you manage to cope with this? Is there some reasonable setup for cmp comparators?

  • weilbith@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Unfortunately having similar issues. It is okayish, but sometimes I feel like there must be something smarter and more context aware too. But I would kind of take the language servers into account here. Though, the specification provides no scoring mechanism. Only a preselect flag which nvim-cmp already supports.

    At the same time this feels like a quite complicate topic. How to actually sort/compare them? In our special case above you would add something based on symbol usage/definition close to your cursor. Which might be a relevant factor. It would be interesting if there some knowledge/science about what actually works best for such a problem.