You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
with the settings.json file configured as
"python.autoComplete.extraPaths": [
"C:/Users/Administrator/.virtualenvs/PyQt5-w5h0JEeT/Lib/site-packages",
"C:/Users/Administrator/.virtualenvs/PyQt5-w5h0JEeT/Lib"
],
I expect the code navigation function works, but it does not.
Actual behaviour
for this line:
from PyQt5.Qt import *
it shows 'from PyQt5.Qt import *' used; unable to detect undefined namesflake8(F403)
and if I right click on QApplication symbol and then I select "Go to Definition", it shows "No definition found for QApplication "
meanwhile it works for
import sys
print(sys.argv)
"Go to Definition" for sys.argv get me to correct location in sys.pyi
Not entirely sure what unable to detect undefined names flake8(F403) means... flake8 is not part of the LS and F403 is not something LS code outputs.
"No definition found for QApplication " is normal since Qt5 is compiled module in C++ and hence we do not have source to show. Actually, nav to sys.argv also shows 'no definition` since LS normally does not navigate to stubs per #1831.
The original motivation for this issue is that in PyCharm, we can check definitions for PyQt5 modules and it really helps to code quickly and correctly, but for VS Code there is no such experience, and it gets much harder to write PyQt5 programs.
After firing this issue, I find out that the PyCharm experience is based on PyQt5-stubs, so I created a new future request for support of PyQt5-stubs for python extension #1854
So we can close this issue if we are on the same page.
Activity
MikhailArkhipov commentedon Jan 2, 2020
Not entirely sure what
unable to detect undefined names flake8(F403)means...flake8is not part of the LS andF403is not something LS code outputs."No definition found for QApplication "is normal since Qt5 is compiled module in C++ and hence we do not have source to show. Actually, nav tosys.argvalso shows 'no definition` since LS normally does not navigate to stubs per #1831.zhangguofu commentedon Jan 3, 2020
The original motivation for this issue is that in PyCharm, we can check definitions for PyQt5 modules and it really helps to code quickly and correctly, but for VS Code there is no such experience, and it gets much harder to write PyQt5 programs.
After firing this issue, I find out that the PyCharm experience is based on PyQt5-stubs, so I created a new future request for support of PyQt5-stubs for python extension
#1854
So we can close this issue if we are on the same page.