Commit Graph
4 Commits
Author SHA1 Message Date
Mikhail Golubev 190fe91332 PY-21563 Join "from" imports with the same origin if "Import ..." quickfix is run from type comment 2016-11-25 17:45:24 +03:00
Mikhail Golubev e612272559 Fix test: when sorting import candidates use qualified names as tie breaker
if lengths of both qualified names are the same. Previously their order
and hence the candidate selected in tests were unpredictable due to
this flaw.
2016-09-28 20:39:05 +03:00
Mikhail Golubev 81e5aa1891 PY-19975 Check all resolved symbols in __init__.py to find shortcut name for element
The root of the problem however is that PythonPathCache often contains
relative qualified names as keys. It leads to the situation where
QFrame module is resolved to the corresponding files both in PyQt and
PySide. We should probably either omit such resolve result in
PythonPathCache entirely or use absolute qualified names for them as
keys.
2016-07-07 11:54:45 +03:00
Mikhail Golubev 1c3b81b322 PY-19773 Remember already suggested importable elements using their canonical names
The problem was caused by the fact that we ignore imported element
"request" in "flask/__init__.py" at first and mark this module as
already checked (using the name "flask") and then refuse to suggest
"flask.globals.requests" because its canonical qualified name is
"flask.request".

I've also added a test on importing functions of os.path module since
it's a well-known case where several different symbols should be imported
using the same name (provided by PyStdlibCanonicalPathProvider).
My first attempt to fix the problem by saving actual import candidates
instead of their canonical qualified names has broken exactly this
scenario.
2016-06-30 08:50:59 +03:00