GeezerVison is showing github.com — gh-130472: Use fancycompleter in import completions by tomasr8 · Pull Request #148188 · python/cpython
Conversation
tomasr8
commented
Apr 6, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
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 FancyCompleter into reusable functions since I needed those for module completions. I also modified ModuleCompleter to return attribute values in addition to names (for modules, it just returns the sys module as a dummy value, this is just to get the color right). Then I just needed to extend get_module_completions to do the colorization.
@loic-simon would love if you have some spare time to have a look :)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
loic-simon reacted with eyes emoji
- Make module completer return both names and values (dummy `sys` module
in case of module completions)
- Colorize completions using `colorize_matches` from FancyCompleter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!! Here's a quick first pass, I'll play around with it in local later 😄
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Tested in local, all good for me! 🚀
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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!
|
loic-simon reacted with rocket emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
lysnikolaou
Awaiting requested review from lysnikolaou
lysnikolaou is a code owner
ambv
Awaiting requested review from ambv
ambv is a code owner
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|