Commit Graph

3340 Commits

Author SHA1 Message Date
Semyon Proshev
787e678baa Use isReferenceTo(keywordContainer) instead of name matching (PY-26285) 2018-01-16 18:13:59 +03:00
Semyon Proshev
2650bf2d41 Support pop on keyword container (PY-26284) 2018-01-16 18:13:58 +03:00
Semyon Proshev
794d3ac932 Support passing default argument with keyword (PY-27105) 2018-01-16 18:13:58 +03:00
Mikhail Golubev
2cb52df739 PY-28016 Package names in the cache are actually matched case-insensitively
It turns out that Gson is able to override even final fields with an
instance created using the default no-args constructor, hence one
has to provide an explicit InstanceCreator for a type to customize the
result value.
2018-01-15 17:34:40 +03:00
fitermay
6d9cd9f45c PY-25655: Store super classes text in stub 2018-01-12 15:35:46 +03:00
Mikhail Golubev
cbb5fe587a PY-27604 Exclude instantiated metaclasses from ancestor types of a class
but properly take them into account in PyClassType#getMetaClassType().

This check was implemented there instead of PyClass#getMetaClassType()
itself, since the former method already looks up for explicitly declared
metaclasses in ancestors unlike PyClassImpl that considers only those
specified directly in the class definition or its containing module.

Moreover, there are actual usages that expects such behavior from
PyClass#getMetaClassType(), e.g. PyAbstractClassInspection.
2018-01-11 12:45:08 +03:00
Mikhail Golubev
f7da96db03 PY-27656 PY-27604 Exclude ancestors of metaclasses from class hierarchy
in case this relationship was created implicitly by inheriting an
instance of metaclass.

It also fixes warnings about the first parameter of SQLAlchemy model
methods being named "self" instead of "cls" since we no longer consider
these classes descendants of "type".
2018-01-11 12:45:08 +03:00
Mikhail Golubev
c995f833fe Python 3.7 does support f-strings in compatibility inspection test data 2018-01-09 23:26:56 +03:00
Semyon Proshev
8f95a8abed Consider dataclass definition types (PY-27398) 2018-01-09 14:39:28 +03:00
Semyon Proshev
dfb801aba9 Provide type for parameter in __post_init__ (PY-27398) 2018-01-09 14:39:28 +03:00
Semyon Proshev
4fc97d088f Correct types for initvars in __init__ (PY-27398) 2018-01-09 14:39:27 +03:00
Semyon Proshev
8d6db3fcb1 Ignore classvars when inspecting fields order (PY-27398) 2018-01-09 14:39:27 +03:00
Semyon Proshev
dca4c8fcce Ignore classvars when inspecting fields' default values (PY-27398) 2018-01-09 14:39:27 +03:00
Semyon Proshev
92a6ae8a26 Ignore classvars when constructing virtual __init__ (PY-27398) 2018-01-09 14:39:26 +03:00
Semyon Proshev
d52a6e7268 Check that object passed to dataclasses helpers is dataclass (PY-27398) 2018-01-09 14:39:26 +03:00
Semyon Proshev
45952674cb Add completion for __post_init__ method (PY-27398) 2018-01-09 14:39:25 +03:00
Semyon Proshev
a46ecaa6a5 Error about invalid comparison operations (PY-27398) 2018-01-09 14:39:25 +03:00
Semyon Proshev
0e2c95e6d5 Error about invalid fields order (PY-27398) 2018-01-09 14:39:25 +03:00
Semyon Proshev
87fe1dc935 Error about mutable list, set and tuple as default value (PY-27398) 2018-01-09 14:39:24 +03:00
Semyon Proshev
f96a9c93f0 Error about eq=False and order=True for dataclasses (PY-27398) 2018-01-09 14:39:24 +03:00
Semyon Proshev
e41ffcef13 Error about assignments to frozen dataclasses (PY-27398) 2018-01-09 14:39:23 +03:00
Semyon Proshev
9b451f9e6d Register change signature quick fix without highlighting
To not to be overlayed with highlighting for arguments
2018-01-09 14:39:23 +03:00
Semyon Proshev
b6982b4425 Support @dataclass(init=True/False) (PY-27398) 2018-01-09 14:39:23 +03:00
Semyon Proshev
3316258201 Provide callable type for dataclass initialization (PY-27398)
Add `dataclasses` to stdlib_packages.txt
2018-01-09 14:39:22 +03:00
Andrey Vlasovskikh
cc59ef98e1 PY-27004 Updated test data to include one more correct search result
Previously we failed to find it due to resolving to only one element.
Now we resolve to multiple elements, which in this case includes the
target expression for a global variable and its 'global' statement.
2017-12-29 09:46:13 +03:00
fitermay
2cee9b66a0 PY-27004: Use multiResolve to check if Python refs match 2017-12-29 09:46:13 +03:00
Semyon Proshev
6b2814e09c Add forgotten test data (PY-25974) 2017-12-25 14:55:17 +03:00
Semyon Proshev
85bea17b09 Add pending edge from left operand in boolean expressions (PY-25974) 2017-12-25 14:24:04 +03:00
Semyon Proshev
a212addc37 Drop first parameter when getting instance parameters from __call__ 2017-12-22 16:20:10 +03:00
Semyon Proshev
8678782c65 Ignore __getitem__ for Generic indirect inheritors (PY-27102) 2017-12-20 21:06:41 +03:00
Mikhail Golubev
8346c97d60 PY-27266 Don't use ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION in Python formatter
It is not actually exposed anywhere in Python code style settings and
defaults to false thus affecting parenthesized multiline (chained)
qualified references and calls. Previously, oddly enough, this
behavior was controlled by ALIGN_COLLECTIONS_AND_COMPREHENSIONS flag.
2017-12-18 19:59:51 +03:00
Semyon Proshev
32d1620185 Enable re stubs (PY-24440, PY-22308)
The most important part of this commit is that local module has more priority against typeshed one.
2017-12-18 19:34:05 +03:00
Elizaveta Shashkova
e5b6c6cc09 Highlight built-in decorators with decorators colors, not not built-in colors (PY-25381) 2017-12-18 18:49:12 +03:00
Mikhail Golubev
adb7ef06c4 PY-21864 Avoid unstubbing while accessing ahead of time annotations
Namely, don't use Scope to find an annotation if AST access is not
allowed.

Added tests on handling of top-level variable annotations and class
attributes annotations in other files. Supposedly, we don't resolve
to unqualified target expressions in other scopes when unstubbing is
forbidden (ordinary local variables are not preserved in PSI stubs).
2017-12-14 19:00:46 +03:00
Mikhail Golubev
ae58f4e52a PY-24729 Initial support of instance attributes annotated on class level 2017-12-14 19:00:46 +03:00
Semyon Proshev
21e4de949c Add Python 3.7 language level
Additionally, I did the following:

* re-generated lists of supported/unsupported interpreter modules
* updated test data wherever Python versions appear in warnings

Still need to figure out, though, why _bz2/bz2 modules were not found
for some old versions of Python, hence information about their presense
should be updated by hand in versions.xml.
2017-12-13 19:44:29 +03:00
Semyon Proshev
96e41895d3 Deprecate Python 2.5 language level. Remove its usages. 2017-12-13 19:44:28 +03:00
Semyon Proshev
556cb4fd3d Deprecate Python 2.4 language level. Remove its usages. 2017-12-13 19:44:28 +03:00
Elizaveta Shashkova
c1807315f2 Overriding a coroutine method does not add the "async" keyword (PY-19312) 2017-12-12 14:55:59 +03:00
Mikhail Golubev
89eb73790a PY-25234 More efficient way to check that a user skeleton belongs to the stdlib
Also, I added a test on that scenario using the skeleton for "alembic"
as an example.
2017-12-11 20:19:51 +03:00
Semyon Proshev
2c1c972962 Support positive iterations in control flow (PY-14840, PY-22003) 2017-12-11 15:43:05 +03:00
Semyon Proshev
be28384c8a Don't process qualified targets in PyRedeclarationInspection (PY-26591) 2017-12-11 15:40:09 +03:00
Semyon Proshev
0a3c7682e9 Allow assign to () and [] (PY-27041) 2017-12-11 15:14:00 +03:00
Semyon Proshev
7d39cce7c4 Add secrets to stdlib packages list (PY-26725) 2017-12-11 14:31:34 +03:00
Semyon Proshev
d47d838b2b Update PyFunctionImpl.replaceSelf for more cases (PY-27143) 2017-12-11 14:26:15 +03:00
Ilya.Kazakevich
41cb5ed10e PY-27286: Sync with teamcity-messages + test 2017-12-06 18:33:42 +03:00
Semyon Proshev
89a9b2c4ca Ability to filter types in parameter presentable text (PY-26582) 2017-12-04 19:28:50 +03:00
Semyon Proshev
60d2063713 Fix completion private members described in stubs (PY-27146)
No more private element filtering in CompletionVariantsProcessor, let's leave it for types.
2017-12-04 13:51:09 +03:00
Semyon Proshev
3293db67bf Replace pyi element with original one for private member owner (PY-27146) 2017-12-04 13:50:14 +03:00
Semyon Proshev
e4ba26ecf2 Replace pyi owner with original one for resolved protected member (PY-26112) 2017-12-04 13:49:58 +03:00