Ability to complete partial enum values - #2275
Merged
Merged
Conversation
Since the implementation of enum completions, the list of candidates was only presented at the start of the possible enum values. The user could select from the menu of candidates by tab or arrow keys, but not narrow down the list of candidate by typing text. And when a the user had set a positive min_completion_trigger value in ~/.myclirc, no enum value candidates would be offered after reaching the trigger. With this change, completions are offered on the possible values of an enum similar to other completions, with partially-typed values respected. Candidates are case-ignoring, and completion is case- correcting. Limitation: can fail when there is a space within the enum value, due to the way word_before_cursor works. This seems like a more general problem, and not a blocker here. Incidentally add some unrelated tests in test_sqlcompleter.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since the implementation of enum completions, the list of candidates was only presented at the start of the possible enum values. The user could select from the menu of candidates by tab or arrow keys, but not narrow down the list of candidate by typing text. And when a the user had set a positive
min_completion_triggervalue in~/.myclirc, no enum value candidates would be offered after reaching the trigger.With this change, completions are offered on the possible values of an enum similar to other completions, with partially-typed values respected. Candidates are case-ignoring, and completion is case- correcting.
Limitation: can fail when there is a space within the enum value, due to the way
word_before_cursorworks. This seems like a more general problem, and not a blocker here.Incidentally add some unrelated tests in
test_sqlcompleter.py.xref #1427
Checklist
changelog.mdfile.AUTHORSfile (or it's already there).