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

Add sorter API for completion candidates #915

Open
xiaq opened this issue Feb 16, 2020 · 3 comments
Open

Add sorter API for completion candidates #915

xiaq opened this issue Feb 16, 2020 · 3 comments

Comments

@xiaq
Copy link
Member

@xiaq xiaq commented Feb 16, 2020

Add an API for sorting completion candidates.

This can be a function that gets all candidates as inputs, and outputs an equal number of numbers, strings or lists. The outputs must be of the same type and are used for sorting the corresponding inputs.

The sorter is run separately for each different candidate type (#914).

@xiaq

This comment has been minimized.

Copy link
Member Author

@xiaq xiaq commented Feb 16, 2020

This is also related to #651.

@zzamboni

This comment has been minimized.

Copy link
Contributor

@zzamboni zzamboni commented Feb 16, 2020

I'm sure I'm misunderstanding something, because I don't think it's practical to have a function that receives all candidates and returns numeric values for all of them. This would mean that the function needs to establish a total "order value" over the whole list, essentially sorting the list in the process! The scalability of a sorting algorithm comes from the fact that you only need to be able to determine the order among two elements at a time.

@xiaq

This comment has been minimized.

Copy link
Member Author

@xiaq xiaq commented Feb 16, 2020

It could also produce strings and lists.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.