Commit Graph

651 Commits

Author SHA1 Message Date
Alexey Kudravtsev
7d2c9d6455 javadoc references fixed 2018-07-09 17:36:59 +03:00
Semyon Proshev
1c851012d0 Mark callSite parameter in PyTypeProvider.getCallType as not null (PY-29577) 2018-07-03 17:53:58 +03:00
Alexey Kudravtsev
8db87053b7 cleanup 2018-06-20 12:46:58 +03:00
Alexey Kudravtsev
2faaf16e26 added missing @Deprecated to find these places later 2018-06-18 13:24:28 +03:00
Semyon Proshev
f088deede3 Highlight illegal usages of self in annotations and type comments (PY-20530)
Update PyInspectionVisitor to init type eval context from context file for injected fragments.
Update TypeEvalContext to check if passed element is inside injected fragment in origin.
2018-06-13 23:12:47 +03:00
Ilya.Kazakevich
342c81e262 PY-30249: Compatibility fix (after IDEA-CR-33182) 2018-06-04 18:17:51 +03:00
Ilya.Kazakevich
18893675b9 PY-30249: TypeEvalContext should be reused in inspections 2018-06-04 17:38:10 +03:00
Semyon Proshev
bdca4ac85f Introduce PyClassType.attributeIsWritable to check if member could be created or updated (PY-27866) 2018-05-29 17:24:39 +03:00
Semyon Proshev
54898c22c6 Inline __slots__ invalidation logic into PyClass (PY-29268) 2018-05-29 17:24:39 +03:00
Semyon Proshev
7261e9121a Support attrs fields defined via ib function (PY-26354) 2018-05-29 16:49:52 +03:00
Semyon Proshev
f416401bd4 Remove remaining deprecated methods from psi-api 2018-05-10 17:20:34 +03:00
Semyon Proshev
e679061293 Remove deprecated methods from PyClassMembersProvider and PyClassMembersProviderBase 2018-05-10 17:20:33 +03:00
Semyon Proshev
535d70ebdc Remove deprecated methods from PyModuleMembersProvider 2018-05-10 17:20:33 +03:00
Ilya.Kazakevich
932c6f3f7a PY-18952: py.test parametrize and fixture
** Parametrize
* Skip "unused" inspection for args, provided by decorator
* Check all args are declared (inspection)
* TODO: Support rerun only one parametrized test

** Fixtures
* References from arguments to fixtures
* Type interference
* Disable "unused" inspection for fixture args
2018-05-09 02:35:38 +03:00
Semyon Proshev
b8f41c5b84 PyReferenceExpression.multiFollowAssignmentsChain has an ability to not follow some references (PY-28243)
Update PyTypeHintsInspection to use it.
2018-04-27 19:57:17 +03:00
Sergey Malenkov
f1b772703b fix CommunityImageResourcesSanityTest: remove PNGs 2018-04-23 20:20:42 +03:00
Semyon Proshev
36fb23d4ab Update PyTypeProvider.getReferenceType to return Ref (PY-28052) 2018-04-11 23:47:44 +03:00
Semyon Proshev
7ed220d61d Special case completion for __prepare__ (PY-28154)
Apply inspection settings and decorate with `@classmethod`
2018-04-09 17:54:45 +03:00
Semyon Proshev
38d6919af8 Remove deprecated methods and classes from PyCallExpression 2018-04-09 15:53:00 +03:00
Gregory.Shrago
305d21ba2a cleanup file type descriptions: no plurals, no files; hide internal 2018-04-06 23:47:52 +03:00
Ilya.Kazakevich
cb3a00d658 Merge branch 'gc-type-eval-context' of https://github.com/fitermay/intellij-community 2018-03-26 18:31:08 +03:00
Alexey Kudravtsev
8bcd17315c cleanup 2018-03-22 11:16:03 +03:00
Semyon Proshev
c6f6e8cebd Fix calculating arguments for __setitem__ (PY-27949) 2018-03-15 17:45:29 +03:00
Semyon Proshev
9d766c24a9 Introduce PyTargetExpression.multiResolveAssignedValue (PY-27788)
It allows to process targets initialized from `@overload`s.
2018-03-13 16:50:56 +03:00
Mikhail Golubev
327b6c220a EA-117868 Fix IOE when type comment value cannot be parsed as expression
Also, I refined the signature of
PyElementGenerator#createExpressionFromText() to reflect that it doesn't
return null in case of malformed expressions
2018-03-13 15:11:45 +03:00
fitermay
44d758b1db minor: anonymous ThreadLocal class -> ThreadLocal.withInitial
minor benefit is avoiding a reference cycle from anonymous class to
TypeEvalContext as anonymous inner classes always hold a reference to
the containing class
2018-02-28 21:36:46 -05:00
fitermay
f2f54441b7 make values in TypeEvalContextBasedCache soft
to let gc collect not-recently-used values
2018-02-28 21:33:03 -05:00
Mikhail Golubev
4e8a44b297 Revert incomplete implementation of PyTypeVisitor polluting public API
except PyCollectionType extending PyClassType that makes a lot of
sense since both PyCollectionTypeImpl and PyTupleType already extend
PyClassTypeImpl, but one still needs explicit casts to
PyCollectionTypeImpl to access the corresponding class definition.
2018-02-20 18:04:54 +03:00
Semyon Proshev
3d4afa3e58 Consider builtin function class type as callable (PY-26555) 2018-02-20 15:19:09 +03:00
Anton Bragin
bfcf22f7dc PY-28228 Resolve annotation forward references according to PEP 563
Forward references resolution implemented for annotations according to
PEP 563. Inspections fixed to respect forward references for both
annotations and pyi stubs.

PyiReferenceResolveProvider removed since its functionality is now
implemented by PyForwardReferenceResolveProvider.
2018-02-12 11:27:21 +03:00
Elizaveta Shashkova
79cc4d9ef4 Support for typing.NewType (PY-21302) 2018-02-06 20:24:29 +03:00
Mikhail Golubev
a3a97008a7 PY-16412 Add javadoc for PyType#getDeclarationElement() 2018-02-05 21:41:59 +03:00
Mikhail Golubev
af64e90b62 PY-16412 Properly import named tuples for their use in type hints
For that I introduced a new method -- getElement() in PyType
that allows to find out the element that can be used to reference
this type according to PEP 484 perspective, e.g. a target assignment
for TypeVar's and NamedTuples and PSI class themselves for class types.

Also, class object types for named tuples are wrapped in typing.Type[]
as expected.
2018-02-05 21:41:59 +03:00
Mikhail Golubev
12f9f91627 Introduce a general PyTypeVisitor
Also PyCollectionType now properly implements PyClassType since
both of it inheritors: PyCollectionTypeImpl and PyTupleType already
extend PyClassTypeImpl.

I had to separate PyTypeVisitor into two abstract classes since
(quite confusingly) not all types of our type system are available in
python-psi-api module.
2018-02-05 21:41:59 +03:00
Semyon Proshev
6a09e252eb Support __class_getitem__ (PY-27913)
Update resolve for `[]` on definitions so `__class_getitem__` is supported.
Support this method (and `__mro_entries__`) in highlighting and completion.
Process it as a static method.
2018-02-05 18:29:15 +03:00
Semyon Proshev
408d0b8314 Deprecate Python 3.3 language level. Remove its usages (PY-27705) 2018-02-01 19:53:39 +03:00
Semyon Proshev
3053152d80 Deprecate Python 3.2 language level. Remove its usages (PY-27705) 2018-02-01 19:53:39 +03:00
Semyon Proshev
3756ddea59 Deprecate Python 3.1 language level. Remove its usages (PY-27705) 2018-02-01 19:53:38 +03:00
Semyon Proshev
c57210dc3e Deprecate Python 3.0 language level. Remove its usages (PY-27705) 2018-02-01 19:53:38 +03:00
Semyon Proshev
0cfe9ad924 Show warnings about unsupported python interpreter (PY-27705) 2018-02-01 19:53:37 +03:00
Anton Bragin
9ebc05bda6 PY-14111 Cython icons moved to PythonIcons class
To preserve API backward compatibility Cython icons moved to PythonIcons
 class.
2018-02-01 17:12:23 +03:00
Anton Bragin
6beea3d3c7 PY-14111 PythonPsiApiIcons class regenerated
CommunityIconClassesTest fixed.
2018-01-31 09:27:25 +03:00
Anton Bragin
2d83b404f4 PY-14111 Cython icons added, icon classes generated 2018-01-30 12:27:57 +03:00
nik
c9620ce099 IDEA project configuration: the great module rename
Rename all modules in IntelliJ IDEA sources to ensure that they follow a consistent naming scheme.

Update *.iml files.
2018-01-25 12:59:02 +03:00
nik
16410c2321 IDEA project configuration: the great module rename
Rename all modules in IntelliJ IDEA sources to ensure that they follow a consistent naming scheme.

Rename iml files.
2018-01-25 12:59:02 +03:00
Semyon Proshev
bdce6311ca Support dataclasses fields defined via field function (PY-27398)
Update PyDataclassesTypeProvider to ignore such fields or correctly specify default value for them.
Create custom target stubs for such fields to store parameters.
2018-01-22 22:52:08 +03:00
Semyon Proshev
1d2745ec25 Reduce unstubbing in PyDataclassesTypeProvider and PyStdlibTypeProvider (PY-27398)
By introducing `hasAssignedValue` for target and its stub.
2018-01-22 22:52:08 +03:00
Semyon Proshev
5137658450 Completion for __getattr__ and __dir__ in module (PY-28017) 2018-01-22 21:43:35 +03:00
Semyon Proshev
54251cca16 Refix calculating receiver of inner class initialization (PY-23259, PY-26992)
Wrong receiver is returned in case of class initialization qualified with module.
2018-01-19 18:34:31 +03:00
Semyon Proshev
49d3aade75 Enable pyi-stubs for collections module (PY-23259, PY-21415, PY-17865, PY-17206)
Infer `tuple` class type when `collections.namedtuple` could not be analyzed.
Infer `namedtuple` class type when `typing.NamedTuple` could not be analyzed.
Create callable type for `typing.Callable`.
Update ignoring `__getitem__` for ancestors, docstrings and annotations.
Infer superclass collection type correctly.
2018-01-19 18:34:31 +03:00