semshi icon indicating copy to clipboard operation
semshi copied to clipboard

Support from foo import *

Open lkhphuc opened this issue 6 years ago • 2 comments

I know it's already stated in the README that currently Semshi does not support highlighting module from from foo import *.

But is there any progress on this aspect, is it possible to support that in Semshi as well? My current solution is to add unresolved to the non-highlights group, but I would love to see it supported.

Thanks for the great plugin.

lkhphuc avatar Jan 27 '19 11:01 lkhphuc

It bothers me too! And it can certainly be done. However, there are a few things to consider. Off the top of my head:

  • Semshi reparses the code on every change. This is fast when just looking at the current file. But resolving imports (potentially recursively), may take quite long. So we'd need to think of a smart mechanism to do that without affecting usability. Also, how do we detect if an imported name has become available, etc.? Do we re-check at certain intervals?

  • How complex and error-prone is static resolving of Python imports? (I'm thinking of different PATHs and entry points. How much time does it take? (Maybe we should look at other completion/refactoring plugins that do that. Maybe we can even hook them?)

Also, right now, I got some important refactorings/improvements regarding Semshi in mind, so I'm not sure how soon I will be able to tackle this given I'm currently the only author. :)

numirias avatar Jan 27 '19 22:01 numirias

Thank you. Please keep on writing any news about it here. I will try to look at the code and see what can I do to help out, or maybe someone with more experience decide to help :).

lkhphuc avatar Jan 29 '19 14:01 lkhphuc