gh-130472: Use fancycompleter in import completions by tomasr8 · Pull Request #148188 · python/cpython
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 :)
