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

fix: properly order console tab suggestions #1152

Merged
merged 1 commit into from
Mar 10, 2023
Merged

Conversation

derklaro
Copy link
Member

@derklaro derklaro commented Mar 4, 2023

Motivation

The current candidate matching system in CloudNet is using a jaro winkler distance to check if a possible suggestion matches the given started input and sorts the values based on the algorithm result. That ordering is not properly kept after passing the candidates to jline.

Modification

Set the sort of the candidates that are passed to jline. This will keep the candidates in the order given from the called tab complete handler.

Result

JLine now displays the tab completions for a command in the intended order.

Other context

Before:
image

After:
image

@derklaro derklaro added v: 4.X This pull should be included in the 4.0 release in: node An issue/pull request releated to the node module code t: fix A pull request introducing a fix for a bug. labels Mar 4, 2023
@derklaro derklaro added this to the 4.0.0-RC9 milestone Mar 4, 2023
@derklaro derklaro requested a review from 0utplay March 4, 2023 18:28
@derklaro derklaro self-assigned this Mar 4, 2023
@0utplay 0utplay merged commit 680a1d3 into nightly Mar 10, 2023
@0utplay 0utplay deleted the tab-suggestions-order branch March 10, 2023 16:24
derklaro added a commit that referenced this pull request Mar 14, 2023
### Motivation
The current candidate matching system in CloudNet is using a jaro
winkler distance to check if a possible suggestion matches the given
started input and sorts the values based on the algorithm result. That
ordering is not properly kept after passing the candidates to jline.

### Modification
Set the sort of the candidates that are passed to jline. This will keep
the candidates in the order given from the called tab complete handler.

### Result
JLine now displays the tab completions for a command in the intended
order.

##### Other context
Before:

![image](https://user-images.githubusercontent.com/40468651/222922696-89dc050d-d5a3-4aff-b61d-ecf4dca913d6.png)

After:

![image](https://user-images.githubusercontent.com/40468651/222922700-f7efe616-3f67-45b5-8b04-51bc7dd5d006.png)
derklaro added a commit that referenced this pull request Apr 17, 2023
### Motivation
The current candidate matching system in CloudNet is using a jaro
winkler distance to check if a possible suggestion matches the given
started input and sorts the values based on the algorithm result. That
ordering is not properly kept after passing the candidates to jline.

### Modification
Set the sort of the candidates that are passed to jline. This will keep
the candidates in the order given from the called tab complete handler.

### Result
JLine now displays the tab completions for a command in the intended
order.

##### Other context
Before:

![image](https://user-images.githubusercontent.com/40468651/222922696-89dc050d-d5a3-4aff-b61d-ecf4dca913d6.png)

After:

![image](https://user-images.githubusercontent.com/40468651/222922700-f7efe616-3f67-45b5-8b04-51bc7dd5d006.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: node An issue/pull request releated to the node module code t: fix A pull request introducing a fix for a bug. v: 4.X This pull should be included in the 4.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants