Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

alexander-yakushev
Copy link
Member

This has been briefly discussed here #3659 (comment) 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

Copy link
Member

@bbatsov bbatsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@bbatsov bbatsov merged commit d430ab3 into master Jun 2, 2024
38 of 39 checks passed
@bbatsov bbatsov deleted the flex-first branch June 2, 2024 07:56
@@ -297,7 +297,7 @@ Only affects the `cider' completion category.`"
(unless found-styles
(setq found-styles '(styles basic)))
(unless (member 'flex found-styles)
(setq found-styles (append found-styles '(flex))))
(setq found-styles (apply #'list 'styles 'flex (cdr found-styles))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can add here a comment similar to the description of the ticket, so people would understand better the need for this bit of code. Feel free do directly commit the comment if you agree with me it'd be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants