Commit Graph
447 Commits
Author SHA1 Message Date
Semyon Proshev 740ef94bcf Use list of types for element types instead of array in PyTupleType 2016-10-13 21:28:19 +03:00
Mikhail Golubev 61f71efc6e Proper names for Python PSI classes for comprehension expressions
They have "Py" prefix and do not contain ugly "Comprh" abbreviation
anymore.
2016-10-10 17:59:02 +03:00
Mikhail Golubev 2a8c71dc70 Move PythonStringUtil out of python-psi-api to python-community 2016-10-10 17:59:02 +03:00
Mikhail Golubev f7ec22efc6 Add javadoc and annotations for some intricate methods of
PyStringLiteralExpression
2016-10-08 18:57:08 +03:00
Konstantin Bulenkov 1fcb5e2181 python file type svg icons 2016-10-06 14:22:20 +02:00
Konstantin Bulenkov 1cf79a11db update python icons 2016-10-06 14:21:41 +02:00
Semyon Proshev f858f692d5 PY-20938 Fixed: Hex numbers inside ''if'' statement cause IDE exception
PY-18973 Fixed: implement support for PEP 515 (Underscores in Numeric Literals)

Update PyNumericLiteralExpression to support all possible forms of numeric literals (incl. underscores)
2016-10-05 17:21:51 +03:00
Mikhail Golubev 7bf5f5f56f PY-20921 PyStringLiteralLexer skips string prefixes consistently with Python lexer
Common logic for skipping string prefixes was moved to PythonStringUtil
and reused in various classes that implemented it by their own before.
2016-10-05 16:11:37 +03:00
Semyon Proshev fa59460a6c PY-20770 Fixed: Support Python 3.6 asynchronous generators and comprehensions
Update PyTypeCheckerInspection to warn about async generators without "async" inside comprehensions

Add tests for values iterated over async generator inside comprehensions
2016-09-30 18:06:13 +03:00
Semyon Proshev d74244f6ac PY-20770 Fixed: Support Python 3.6 asynchronous generators and comprehensions
Introduce fake __asyncgenerator type for async generator objects described in PEP 525.
Update PyFunctionImpl.createCoroutineType to convert __generator to __asyncgenerator.
Update PyTargetExpressionImpl.getIterationType to infer type of elements which are getting from async generator
Highlight non-empty return inside async generators as error
2016-09-30 18:04:58 +03:00
Semyon Proshev 27543fe191 PY-20946 Fixed: False positive: __init_subclass__ method first parameter should be named "self"
Update PyMethodParametersInspection to correctly handle Python 3.6 __init_subclass__ method. This method is implicitly a @classmethod
2016-09-28 19:39:41 +03:00
Semyon Proshev aee3680c25 PY-20768 Fixed: Support special attributes of PEP 487: simpler customization of class creation
Create PY36_BUILTIN_METHODS in PyNames and add __init_subclass__, __set_name__ to it
2016-09-27 17:45:20 +03:00
Mikhail Golubev d50db53561 PY-18972 Injections for expressions embedded inside f-strings
Most of the logic regarding proper detection of "{}" fragments follows
CPython's implementation of PEP-498.
2016-09-16 08:16:26 +03:00
Mikhail Golubev 6d86b858ca PY-20744 Initial support of variable annotations in type сhecking 2016-09-16 08:16:26 +03:00
Mikhail Golubev 409aad3f71 PY-20744 Compatibility inspection and annotator warn about variable annotations 2016-09-16 08:16:26 +03:00
Mikhail Golubev 3266460142 PY-20744 Parse PEP-526 variable annotations
Annotation is preserved at the level of assignment nodes similar to
where CPython keeps them in its AST (in special "augassign" nodes).
For type annotations in form "x: int" without variable initialization
special statement PyTypeDefinitionStatement was introduced.
2016-09-16 08:16:26 +03:00
Mikhail Golubev c11850fa34 Add Python 3.6 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.
2016-09-09 11:48:29 +03:00
Semyon Proshev 28156d540d Simplify ConvertVariadicParamIntention.isAvailable, annotate PyNames.isIdentifierString and link PyIntentionTest.testConvertVariadicParamEmptySubscription with issue 2016-09-06 17:01:57 +03:00
Ilya.Kazakevich 29bff31e44 PY-18634: Support form-based views
* form_valid(form) and form_invalid(form) methods of FormView have "form" argument of type that depends on form_class attribute of FormView class.
2016-09-05 18:53:31 +03:00
Dmitry Trofimov 7d43fc2cbe Merge remote-tracking branch 'origin/master' 2016-08-30 20:50:44 +02:00
Lada Gagina c9a96f59ff PY-16055 Add quickfix and tests for functions with incorrect return annotation
Add quickfix for functions whose return type doesn't match their annotated type.
2016-08-30 17:12:55 +03:00
fitermay 4484907fe9 add support for parameter info in console 2016-08-28 20:59:08 -04:00
Semyon Proshev d438a0737b Make PyTypeProvider.getCallType returns Ref<PyType> instead of PyType. Attempt to make related methods more readable 2016-08-10 17:00:20 +03:00
Lada Gagina 49caa2b777 PY-19927 Add highlighting to __setstate__ and __sizeof__ magic methods 2016-08-10 15:32:04 +03:00
Anna.Kozlova 78d1492242 explicit types to diamonds 2016-08-08 17:08:03 +02:00
Lada Gagina 4e0f092dea Add missing magic methods to PyNames and fix __rpow__ completion test 2016-08-02 20:15:37 +03:00
Semyon Proshev 87988e10a0 Introduce ANEXT, AENTER and AEXIT in PyNames 2016-08-01 21:28:24 +03:00
Semyon Proshev 30381b3b10 PY-19775 Fixed: Unresolved attribute reference on attribute defined inside async def __init__
Highlight builtin methods (except __aiter__, __aenter__, __aexit__, __anext__) which are not allowed to be async
2016-08-01 21:28:24 +03:00
Semyon Proshev 4d218b15cd PY-19858 Fixed: type checker: wrong type for List[List] elements
Improve type inference for list.__getitem__ call by analyzing passed arguments
2016-07-29 14:30:54 +03:00
Semyon Proshev f70d284f9a Specify nullability annotations in PyClassStub and PyClassStubImpl 2016-07-20 21:16:56 +03:00
Semyon Proshev f4fa3d0eb7 Annotation for PyStubElementType.PyStubElementType and its inheritors 2016-07-20 21:16:55 +03:00
Semyon Proshev 3fd146f13a NotNull annotation for PyStubElementType.createElement and its inheritors 2016-07-20 21:16:54 +03:00
Semyon Proshev b1326d769d PY-19461 Fixed: Inspection does not recognize all subclasses
PY-19530 Fixed: from MODULE import SUBMODULE as NAME not find inheritance

If superclass is imported via 'as', save its imported and original names in stubs.
Use original name in PySuperClassIndex building and imported name in superclasses calculating
2016-07-20 21:16:54 +03:00
Lada Gagina f5f42d840a PY-11943 Add MutableMapping test and check
Type checker has separate checks to perform type casting to abstract
base classes like Mapping, but it didn't support MutableMapping so this
commit added MutableMapping inspection to type checker.
2016-07-15 15:53:06 +03:00
Mikhail Golubev fa9c0ebd28 PY-19220 Detect type hinting comments that follow multi-line assignments 2016-07-12 17:25:33 +03:00
Semyon Proshev 99a4e93870 Add tests about resolving __class__ (incl. implicit) and __doc__ 2016-07-07 14:18:52 +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
Mikhail Golubev 437ffb1e2e PY-19884 Add support for abc classes Set and MutableSet in PyABCUtil 2016-06-21 20:20:23 +03:00
Anna.Kozlova 9d6477485d anonymous -> lambda 2016-06-01 09:00:47 +02:00
Ilya.Kazakevich d877c041f3 Assertions added to get rid of unexpected exceptions 2016-05-28 00:25:03 +03:00
Ilya.Kazakevich f1b4da2519 Using PyPsiUtils to prevent copy/paste 2016-05-27 17:36:42 +03:00
Ilya.Kazakevich 42dc7658d0 Enforcing strong contract: no access to invalid element is allowed.
Generally, you should never access invalid element. Invalid element is stale (cached somewhere and reused) hence it is bug to use it. We now use PyPsiUtil.assertValid to fight such access. Is you have PSIAE doublecheck your code. Beware of PSIAE error: it uses heuristic and may give wrong reason.
2016-05-27 01:29:16 +03:00
Semyon Proshev 58fc2f6f70 PY-19127 Fixed: __prepare__ magic function not hightlights
Add __prepare__ to py3 builtin methods
2016-05-18 21:43:45 +03:00
Anna.Kozlova 36ee7203f6 anonym -> lambda 2016-05-18 12:04:12 +02:00
Semyon Proshev 8fc1ce6913 PyNamedTupleStub:
creating: check that namedtuple(...) is called, locally resolve tuple name and fields
IO: deserialize and serialize: callee name, tuple name, fields number and fields names
using: update PyStdlibTypeProvider to use stubs for namedtuples
2016-03-23 20:58:57 +03:00
Semyon Proshev 45b735d716 PY-18684 Fixed: incorrect auto compleat for __rpow__ method
Fix __rpow__ signature in PyNames
2016-03-23 19:23:14 +03:00
Mikhail GolubevandAndrey Vlasovskikh a68e6981dc PY-18816 Type comments for target expressions are stored inside their stubs 2016-03-17 18:40:29 +03:00
Mikhail GolubevandAndrey Vlasovskikh 57bbfd50d4 PY-18816 Only PyNamedParameter should extend PyTypeCommentOwner
Because only this type of parameters extends PyTypedElement.
2016-03-17 18:40:29 +03:00
Mikhail GolubevandAndrey Vlasovskikh 4b53a3e2da PY-18816 Type comments for parameters are persisted in stubs 2016-03-17 18:40:28 +03:00
Semyon Proshev 8d78d16800 PY-18096 Fixed: False positive "Type doesn't have expected attributes" for namedtuple
Introduce PyClassLikeType.getMemberNames(boolean, TypeEvalContext). This method returns all members including dynamically ones (e.g. fields of namedtuple)
2016-03-09 19:06:52 +03:00