Andrey Vlasovskikh
60451cb448
PY-21088 Understand __all__.append() and __all__.extend()
...
PyCharm used to fail to statically evaluate __all__.append() calls in
typing.py and concluded that since __all__ was too dynamic to analyse
it was better to assume that __all__ isn't present.
It affected resolving to internal module attributes not mentioned in
__all__ and even led to false positives in unused locals when these
internal names were imported from another module right next to
star-import from the module with __all__.
2016-10-26 20:06:07 +03:00
Mikhail Golubev
4c7269a765
PY-19989 Don't store results of implicit relative import in PythonPathCache
2016-07-07 11:54:46 +03:00
Andrey Vlasovskikh
6211427812
Resolve only to the first path entry if non-empty name for QualifiedNameResolver is provided (PY-18626)
...
Since we switched to multi-resolve for imported modules, we have to
modify the contract of QualifiedNameResolver so it doesn't return all
the results across all the paths, but rather stops on the first set
of results for a particular path in sys.path.
2016-04-21 20:17:59 +03:00
Mikhail Golubev
53dc593206
PY-17941 Fix ranking of resolve results: don't skip empty modules, prefer real files to "__all__"
...
Test PyBinaryModuleCompletionTest#testPySideImport failed without
special rule regarding references in "__all__".
2015-12-14 15:43:28 +03:00
Andrey Vlasovskikh
ac05b12d26
Resolve members of all imported modules in both __init__.py and submodules (PY-14454, PY-14615)
...
We used to resolve members __init__.py of imported packages using only
the __init__.py itself, i.e. without considering their submodules. Now
we do that and we also don't filter unimported submodules because we
cannot detect them reliably. They might be imported in other modules
via some import chain.
2015-07-02 17:38:25 +03:00
Andrey Vlasovskikh
c80b8263c7
Added a test for PY-14454
2015-07-01 13:10:43 +03:00
Ekaterina Tuzova
dfa4380854
PY-15503 Numpy: unresolved reference: false positive for testing package referenced with numpy import only
...
fixed resolve for the relative from imports
2015-05-05 17:03:36 +03:00
Ekaterina Tuzova
c882d5d5ed
fixed resolve to the keyword argument introduced in 8b9e7981df
...
needed for PY-15366 No completion for matplotlib figure
2015-05-05 17:03:33 +03:00
Andrey Vlasovskikh
71f55b4760
Fixed resolving nested namespace packages
2014-11-12 16:42:52 +03:00
Mikhail Golubev
e0ddef7bf1
PY-13140 Top-level module names starting with underscore are not imported via wildcard import
2014-07-10 15:09:49 +04:00
Andrey Vlasovskikh
34c523582f
Implicitly imported package members are already processed in PyModuleType instead of PyFile (PY-10819)
2013-09-25 20:55:16 +04:00
Andrey Vlasovskikh
072b3887c1
Fixed unresolved references inspection for fields defined in __new__ (PY-6805)
...
The inspection may show false negative warnings for assigned attributes of objects
other than the return value of __new__.
2013-04-12 14:42:45 +04:00
Dmitry Jemerov
703f74d0e8
failing test for PY-7929
2012-11-01 20:23:02 +04:00
Dmitry Trofimov
606a52f82f
Resolve to project sources first instead of libraries and stubs (PY-7775).
2012-10-22 00:07:32 +02:00
Andrey Vlasovskikh
5db6ed1df7
Support for implicit namespace packages in Python 3.3 (PY-7156)
2012-08-27 20:00:06 +04:00
Dmitry Jemerov
6677bdbb02
star import elements correctly resolve source of from import statement (PY-7204)
2012-08-16 09:02:55 +02:00
Andrey Vlasovskikh
55383be850
Fixed unresolved reference for reassignment of a variable after star import (PY-7026)
2012-07-23 20:15:22 +04:00
Andrey Vlasovskikh
4140c25a7b
Fixed wrong resolve to submodule instead of function with the same name (PY-6866)
2012-07-03 19:07:11 +04:00
Andrey Vlasovskikh
f9f42a436c
Fixed resolve of imported module references in submodules with relative imports (PY-6575)
2012-05-25 22:46:59 +04:00
Andrey Vlasovskikh
981c567d14
Test for PY-6575
2012-05-23 22:45:51 +04:00
Andrey Vlasovskikh
3e9550fd41
Fixed unresolved references for namespace packages (PY-2813)
2012-04-30 20:17:02 +04:00
Dmitry Jemerov
32bca31f70
fix SOE in new-style resolve (PY-6305) (oh god the contract of findExportedName() is so confusing)
2012-04-26 11:21:12 +02:00
Dmitry Jemerov
9decb95254
don't override locally resolved module with results from global resolve cache (PY-6011)
2012-03-30 18:11:51 +02:00
Dmitry Jemerov
1a19cbf99b
subpackage names are visible in the __init__.py of a package even if something was imported from the subpackages, and the subpackages themselves weren't imported (related to PY-3201)
2011-05-24 17:13:42 +04:00
Dmitry Jemerov
e7b53e5938
resolve prefers directories to files (PY-3194)
2011-05-18 20:01:51 +02:00
Dmitry Jemerov
2999b5dea6
names prefixed with __ are not imported with 'from ... import *' (PY-2717)
2011-01-19 13:01:12 +01:00
Dmitry Cheryasov
61dcbf0409
Test resolution collision (submodule vs __init__.py)
2010-09-23 13:09:54 +03:00
Dmitry Jemerov
a6e1b73fde
honor __all__ when resolving references imported via 'from ... import *' (PY-98)
2010-07-02 20:01:23 +04:00
Dmitry Jemerov
8d3bd0574d
resolve names which are mentioned in __all__ but cannot be found statically (PY-839)
2010-07-02 20:01:21 +04:00
Dmitry Jemerov
66ffa935ee
findExportedName() returns import element as exported name only if it's resolved (fixes 'import os.path', where thee are a number of 'import xxxpath as path' imports, only one of which is resolved)
2010-07-01 21:53:37 +04:00
Dmitry Jemerov
cdf76f7eed
to have same behavior for stub-based and non-stub-based resolve, findExportedName() walks the list of stubs in reverse order
2010-07-01 21:53:33 +04:00
Dmitry Jemerov
88a19e9bf5
don't replace a more specific imported module with a more broad one
2010-06-30 22:02:14 +04:00
Dmitry Jemerov
0d6040ba29
resolve qualified references imported inside a function (PY-1185)
2010-06-30 22:02:13 +04:00
Dmitry Jemerov
62d87ef235
resolve qualified reference when there's both import .. from and regular import for same module (PY-1183)
2010-06-30 22:02:12 +04:00
Dmitry Jemerov
29604ee901
resolve reimported members of imported module (PY-1153)
2010-06-30 22:02:11 +04:00
Dmitry Jemerov
74672e8b09
correctly disambiguate between os and os.path when both are imported
2010-05-06 22:30:39 +04:00
Dmitry Jemerov
dfb2bcee83
check for existence of __init__.py in directories when resolving imports (PY-942)
2010-05-05 20:45:04 +04:00
Dmitry Jemerov
8bb69371a8
correctly resolve components of import element (PY-676)
2010-03-12 22:22:47 +03:00
Dmitry Jemerov
46ca24b7d6
one more case for stub-based resolve of qualified names
2010-03-12 14:12:13 +03:00
Dmitry Jemerov
ef7414e533
one case of resolving qualified names in superclass list
2010-03-11 20:36:05 +03:00
Dmitry Jemerov
7b0c556bfb
PyFileImpl.findExportedName() processes star imports correctly
2010-03-10 21:21:25 +03:00
Dmitry Jemerov
7f67838fcc
fix possible SOE in multi-ile resolve
2010-02-03 17:53:41 +03:00
Dmitry Jemerov
143e26693e
disambiguate between importing file and name more correctly (PY-381)
2010-02-01 21:17:22 +03:00
Dmitry Cheryasov
0ad02d6b80
Relative import (PY-92) with three test cases.
2010-01-14 19:29:10 +02:00
Dmitry Cheryasov
6c2c2f1ea6
Added circular import resolution test that now passes.
2008-08-10 08:03:18 +04:00
Dmitry Cheryasov
dfd8e8b62f
Renewed resolver, closes PY-19 and supposedly PY-13.
...
Introduces a new internal interface for easier resolution.
Corrects fromQualifiedPackageImportFile and LookAhead tests.
There is a known problem with Jython resolution using "import *", to be fixed later.
2008-07-30 07:47:38 +04:00
Dmitry Cheryasov
d538ddb5f5
Preliminarily closes PY-12 and PY-8. Import resolution is still quite suboptimal, though.
...
PyFile and PyFileImpl: added getUrl() method.
PyResolveUtil and PyFile: more of (lame) means to squash SOEs on circular imports.
ResolveImportUtil: actual PY-12 resolve order fix.
PyMultiFileResolveTest and friends: a test case for name resolution inside subpackage.
2008-05-28 08:55:29 +04:00
Dmitry Cheryasov
4acc786242
Transitive resolution (when an imported name is re-exported).
2008-05-23 17:07:37 +04:00
Dmitry Cheryasov
12e46c0946
Fixed name case glitch (importAs.py to ImportAs.py).
2008-05-20 18:01:33 +04:00
Dmitry Jemerov
3c4dd8905f
import things declared in __init__.py
2008-03-12 20:50:31 +03:00