Otherwise, the newly recognized implicit type aliases are not stored in the indexes.
(cherry picked from commit de504d03d72c7bc856a10f8d0900e6ff62816112)
IJ-CR-176451
(cherry picked from commit 18f56c69cb467c1c518372c07216199bf63509a4)
GitOrigin-RevId: 9b31ba2c05b4776617e871301e7ab6ad2c84544e
If a per-project ".venv" is not excluded, we consider
pythonX.Y/site-packages/typing_extensions.py a project source file,
giving it priority over the bundled typing_extensions.pyi in Typeshed.
In typing_extensions.py "Self" is defined as a function. Since we
special-cased PyTypingTypeProvider.OPAQUE_NAMES only for assignments,
we didn't recognize that it was a special form, and hence reported
it as referring to an illegal type hint.
Though it's more of an "incorrect project setup" type of problem,
I think it's still worth supporting functions as "opaque names"
just in case.
(cherry picked from commit 63f641cd8667fbb31ba1fb167a24ca825a8baf8b)
IJ-CR-176451
(cherry picked from commit 212368618d4d299048f0cee2ebaa1e35484eb86d)
GitOrigin-RevId: f4458625552d751b8a75a500eb85b7f858f9a406
It should only be special cases for classes which *metaclasses*
override `__or__` so that this notation is possible.
Other type checkers treat such union of classes overriding
__or__ in their metaclass as Unknown.
(cherry picked from commit c16edee2346582745aa5090c3d8f568a4513afc1)
IJ-CR-176451
(cherry picked from commit 4dfc125bcfc625d1fe5577695e9a75449f40594a)
GitOrigin-RevId: 9f066646863ec321bcace0d2d10efe44a3c12728
Namely, that `Annotated` can contain arbitrary expressions and that `Literal` might
contain boolean and integer literals.
(cherry picked from commit 6b3d4212679d6556dfe1d4905f06a78e2769b4e2)
IJ-CR-176451
(cherry picked from commit 8d769a4319b1e9fec05e93226238b559a4132d65)
GitOrigin-RevId: 158a7f63318ef74b50ea6ad2101ec8990ed6ce51
`from __future__ import annotations` is not available in Python < 3.7,
and in earlier versions such import itself should be highlighted,
and using type parameter lists in Python < 3.12 is already reported.
(cherry picked from commit 18075131473fb5cee8a47ab259cfdc753889892e)
IJ-CR-175817
GitOrigin-RevId: 3a54244d031a5b8cd42da9aa6a75ce5a84c96603
- adjust parser to support comma separated list of error classes
- add problem annotation and quick fix for missing parentheses
- add new tests, adjust old tests
GitOrigin-RevId: 545f3597a488f85ba2ff17da0a389f2aed226406
`getMemberTypes` should be used for members which have no PSI which can be used to resolve to. For example, `__init__` method in dataclasses are sometimes not present in the source code. Yet its parameters are always useful for the code analysis. In this case, `getMemberTypes` should be used.
(cherry picked from commit 2455ed05099842fc50e1fa2a196c4952b6444795)
IJ-CR-172940
GitOrigin-RevId: 1da7d966c9752b16afc6ec1c55e6606d8ff7b244
It should be activated only for the simplest cases when the caret is either
inside an immediate string literal or its prefix is an unqualified reference
expression. It makes little sense trying to detect if something like
the literal string `"y.foobar"` is a possible value for `x`.
It's a relatively heavy completion contributor. It starts evaluating the type of
`x` flow-sensitively, analyzing all preceding function calls to take into
account `NoReturn`. It affects common workflows like typing out
`df = pd.` to create a new Pandas dataframe.
(cherry picked from commit f17fe2ce86ee100a3480a574c7f57a1bd67ec2d8)
IJ-CR-172165
GitOrigin-RevId: 4434488b1d2dae3ab7efd72e775b0c730268e51c
- fix missing return type when last statement is a return statement
- add/adjust tests
- add missing null annotations
GitOrigin-RevId: 8fed189d0130c3b41a5f17a3324684a29b39c0ef
- customize extract method refactoring for Python using prefix Py
- option to enable/disable type annotations
- persist value of checkbox.isSelected
- run all extract method tests using types
- add specific typed test
- adjust api-dump.txt since some members of AbstractExtractMethodDialog were raised from private to protected
- small adjustment in test expectation of the inferred type
GitOrigin-RevId: be6e70dcb61c451debb98c10c0a001234188cb7d