clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.54k stars 646 forks source link

[complete] Prioritize flex style if flex style is requested #3696

Closed alexander-yakushev closed 4 months ago

alexander-yakushev commented 4 months ago

This has been briefly discussed here https://github.com/clojure-emacs/cider/pull/3659#discussion_r1602166071 before making basic the prioritized one.

The current setup produces a bug when Compliment returns a list of candidates that matches flex style, but only one of the items on that list matches basic style. In that case, Emacs will eagerly complete that single candidate without presenting a list.

Example:

Unsa instantly completes to UnsatisfiedLinkError (because that's a class that is always imported to all namespaces).

Desired behavior:

image