JetBrains / intellij-micropython

Plugin for MicroPython devices in PyCharm and IntelliJ
https://plugins.jetbrains.com/plugin/9777-micropython
Apache License 2.0
506 stars 106 forks source link

No autocompletion for display.<func> #1

Closed lancelote closed 7 years ago

lancelote commented 7 years ago

PyCharm suggests no autocompletion for display objects, e.g.:

display.scr  # no suggestion "scroll"

also scroll and other display functions have no parameter hints. The problem seems to be with alias imports in init file.

Changing from:

from . import (display as display, ...

to

from . import display, ...

fixes the problem. So I wonder - why are the alias imports used there in a first place?

vlasovskikh commented 7 years ago

According to PEP 484 Python stubs require re-importing:

Modules and variables imported into the stub are not considered exported from the stub unless the import uses the import ... as ... form or the equivalent from ... import ... as ... form.

I believe it's a bug in the code insight engine of PyCharm not related to MicroPython. Could you please report it to its issue tracker?

lancelote commented 7 years ago

I will, thank you for an explanation! Please feel free to close.

lancelote commented 7 years ago

Ticket: https://youtrack.jetbrains.com/issue/PY-24891

Note: I failed to reproduce the problem outside of MicroPython support.