gh-130472: Use fancycompleter in import completions#148188
Merged
pablogsal merged 13 commits intopython:mainfrom May 5, 2026
Merged
gh-130472: Use fancycompleter in import completions#148188pablogsal merged 13 commits intopython:mainfrom
pablogsal merged 13 commits intopython:mainfrom
Conversation
- Make module completer return both names and values (dummy `sys` module in case of module completions) - Colorize completions using `colorize_matches` from FancyCompleter
loic-simon
reviewed
Apr 6, 2026
Contributor
loic-simon
left a comment
There was a problem hiding this comment.
Nice!! Here's a quick first pass, I'll play around with it in local later 😄
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Contributor
|
Tested in local, all good for me! 🚀 |
Member
|
LGTM Great work @tomasr8 and thanks for the review @loic-simon. I have pushed a commit with some fixed and simplifications so it can make it to tomorrow's deadline! |
Documentation build overview
147 files changed ·
|
pablogsal
approved these changes
May 5, 2026
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.
Now that #130473 has been merged, let's use it for import completions as well.
This is my first stab at this. First, I did a bit of refactoring and extracted the getattr and colorize logic from
FancyCompleterinto reusable functions since I needed those for module completions. I also modifiedModuleCompleterto return attribute values in addition to names (for modules, it just returns thesysmodule as a dummy value, this is just to get the color right). Then I just needed to extendget_module_completionsto do the colorization.@loic-simon would love if you have some spare time to have a look :)