333 Commits

Author SHA1 Message Date
Morgan Bartholomew
470e4f879a [python] PY-28130 infer lambda parameter type from expected type
GitOrigin-RevId: e98338828b8fb9b2b3e33c57995345731f53dccb
2025-11-21 06:57:57 +00:00
evgeny.bovykin
27e5a7690d Enable TypeEvalContext#assumeType only if python.use.better.control.flow.type.inference is enabled
(cherry picked from commit da7e3452bfbdbfd618dbe166e5a6c199f28cae6f)

IJ-MR-172702

GitOrigin-RevId: f9e8674be9b4a1f0a1f5fda030cef1e194c2a90f
2025-11-19 13:10:40 +00:00
evgeny.bovykin
59df203089 PY-84469 Consider ClassVar when matching protocol and a concrete class
(cherry picked from commit 76af969cfe9318049f02dc7f6bdd03fe20a9504f)

IJ-MR-174248

GitOrigin-RevId: b34de32baf939e812169976761acd41eaa8aba38
2025-11-19 13:05:44 +00:00
evgeny.bovykin
1331c92868 PY-84464 Support @property decorator when matching a protocol and its implementation
(cherry picked from commit fcbeeb57323336c7d921edad373ea595ef687d6b)

IJ-MR-174248

GitOrigin-RevId: 6c44a1a7af026faaf4a5e9c1242ed29f3fb94e0e
2025-11-19 13:05:44 +00:00
evgeny.bovykin
121e605ea8 PY-84972 Fix NPE in PyInvalidCastInspection
Mark PyWithAncestors.getAncestorTypes return type as @Nullable


(cherry picked from commit fb7cbbebfac371b21456711087f82fbdaf21673c)

IJ-MR-179357

GitOrigin-RevId: f24cca2c4923f4bb06b4f7204f2c56b95047e4cf
2025-11-18 15:51:00 +00:00
Morgan Bartholomew
2f20b95624 [python] PY-83505 ExternalTypeProvider extension point
(cherry picked from commit 4c576007a0f84542f5b91f5e502d0e280c3d5b7c)

GitOrigin-RevId: 57ce4325e4948c00c38a8d362c97b89de3f8b854
2025-11-05 02:02:56 +00:00
Nikolay Chashnikov
3a8344fcad [plugin model] use 'public' visibility for content modules which classes are used from external plugins (IJPL-207059)
153 modules which contain classes used from external plugins from the Marketplace are marked as public. This is needed to ensure that it'll be possible to use that API after converting code from these external plugins to content modules.

GitOrigin-RevId: dc48e8970041fddd3bf50d280711e95ce9e9ad9b
2025-10-08 18:39:06 +00:00
Vladimir Krivosheev
9f425c84ea IJ-MR-175479 IJ-CR-146078 IJPL-209476 guava as product module (part 2)
GitOrigin-RevId: 22ee846c39d44cd481ad55d11889ff43ad3b389a
2025-10-04 19:03:47 +00:00
Ilia Kirianovskii
f43aa95086 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 98a67396a48bddc3d084cc93c50ae2f2017bfe8c
2025-09-29 00:11:15 +00:00
Vladimir.Koshelev
ba393efaa7 [python] PY-84398 get rid of embedded loading rules in PythonCore plugin, fix related issues
GitOrigin-RevId: 54f4bb333e0ca06a002a86c75f0bbc474863253e
2025-09-26 15:15:29 +00:00
Petr
593ffc8edb PY-84356 Fix TypeEvalContext.inOrigin()
GitOrigin-RevId: f7d40505057b883cf87d96a481129c4347060c0b
2025-09-22 19:18:56 +00:00
Petr
fdade3b615 PY-84356 Group related TypeEvalContext methods together
GitOrigin-RevId: 3eadd8c1322b8ff7a3fb145c39f8fdf8f8d8c19c
2025-09-22 19:18:56 +00:00
Marcus Mews
3914253777 PY-76811 Conformance test failure: dataclasses_slots.py
- support @dataclass(slots=True)
- add inspection for conflict with explicit __slots__
- add quickfix for new inspection
- add/adjust tests

GitOrigin-RevId: 5ac6efeb6c1e209b641365e2f22bdca74ae6484a
2025-09-18 08:08:12 +00:00
Yuriy Artamonov
2cf790a9d6 [python] PY-84203 Reuse PythonParserIcons.PythonFile icon everywhere
GitOrigin-RevId: c485c76e41659f33bd8d86de2470b27be684411d
2025-09-14 23:47:27 +00:00
Aleksandr.Govenko
e9d4a103a0 PY-83900 Inspect Code consumes 100% CPU and takes unusually long on specific simple file
GitOrigin-RevId: 81973d162072c94b4d7201dffc68d43669f449a3
2025-09-08 13:48:34 +00:00
Petr
b3249cfdb5 PY-70247 Disallow stub to AST switch for pyi files
GitOrigin-RevId: 8c84d83dcffc4aaf64c0e7bc719de2fdbe7629af
2025-08-29 13:42:59 +00:00
Ilia Kirianovskii
dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Petr
dd58eaacfc [python] Rm obsolete registry key python.use.better.control.flow.type.inference
GitOrigin-RevId: 47ca59e692de12376ca17604b8b9ab2439882a45
2025-08-19 17:37:04 +00:00
Mikhail Golubev
cb4a20178c [python] Fix parameter names of PyElementGenerator.createBinaryExpression
GitOrigin-RevId: 7620ab27f1cac4dc386fecdd4a6c5d63a8f341ce
2025-08-15 16:26:28 +00:00
Marcus Mews
054331c2a3 PY-83059 NullPointerException in PyCharm 2025.2
- add null check

GitOrigin-RevId: 25ea1637981dec0d5d4fae532bed9e6c0ce7ebe6
2025-08-06 09:25:42 +00:00
Vladimir.Koshelev
03c367e414 [PY-75831] library cache should work correctly for PsiFiles created specially for completion.
GitOrigin-RevId: 4ed0ca563aad0f750901f0d6c8ca73f7ee223b8b
2025-08-01 17:44:22 +00:00
Vladimir.Koshelev
447a7d0891 [PY-82607] introduce a caching for all computations in PyTypingTypeProvider
GitOrigin-RevId: ad795a4fc2bed8dc7f5276eb18c80a51485dcabf
2025-08-01 17:44:21 +00:00
Andrey Vokin
59bec2a22b PY-75831 Split cache(resolve/type) into library and user part
(cherry picked from commit 1147ca940dff1fa6dfbeaadcccd7e2487dda842a)

IJ-MR-169158

GitOrigin-RevId: e397e43f5ae5d795ab524e9427be7bbb0d924298
2025-07-28 08:06:50 +00:00
Mikhail Golubev
fd4360b032 PY-75831 tests for split cache(resolve/type) into library and user part
(cherry picked from commit ca5f003693960b25d78bda050b55fe39900be5a7)

IJ-MR-169158

GitOrigin-RevId: 759cb38f76124b5b0709757e8f73ddffbf4a8248
2025-07-28 08:06:50 +00:00
Andrey Vokin
31991b70bd PY-75831 Split cache(resolve/type) into library and user part
(cherry picked from commit 94456d3a1f0be2e747641b74ce8246857b1a3f77)

IJ-MR-169158

GitOrigin-RevId: 4cdf0b90f601ca37b0f11b4392dbcfcf856472c6
2025-07-28 08:06:50 +00:00
Petr
43024c4c88 PY-81981 Deprecate PyPsiFacade#getLanguageLevel
GitOrigin-RevId: edb0ec18aaaa55032e9e5b8f9ff713f07e22da04
2025-07-22 19:28:39 +00:00
Aleksandr.Govenko
6a35fa7cc1 [python] Convert PySequencePattern and PyMappingPattern to kotlin
GitOrigin-RevId: 074ed9f865556d561237fc894d202d76995ab562
2025-07-15 18:59:48 +00:00
Aleksandr.Govenko
3332759510 [python] Refactor PyCapturePatternImpl. Introduce PyCaptureContext
GitOrigin-RevId: 2e3fbf4c7d79e6031c7c087e5c7e7e49046587fd
2025-07-15 18:59:48 +00:00
Aleksandr.Govenko
c4256d689d Rename .java to .kt
GitOrigin-RevId: de4536d7ce72661c150a019631734c7489af6a84
2025-07-15 18:59:48 +00:00
Mikhail Golubev
064419d1e9 [python] Make overlooked PyElementVisitor methods for statements delegate to visitPyStatement
GitOrigin-RevId: f6853d0dfc5ddcc7b40bfccead0ad779328fc751
2025-07-04 13:15:14 +00:00
evgeny.bovykin
abe6184e8a PY-79816 Introduce PyType#getMemberTypes and use it to infer __hash__ type of dataclasses
`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.

GitOrigin-RevId: 2455ed05099842fc50e1fa2a196c4952b6444795
2025-07-02 08:33:56 +00:00
Petr
7135789b0f PY-81288 Incorrect type inferred for a function with positional only parameters
GitOrigin-RevId: 3bfea7064073b32743d58bbf5030769d1565a61e
2025-06-28 13:01:14 +00:00
Petr
685695021f PY-81471 Move lang.foldingBuilder to common
GitOrigin-RevId: 3c4f9cc773d14492e9fbf026f0472a908c9262ec
2025-06-18 20:02:26 +00:00
Andrey Vokin
dc83319152 PY-81269 Extremely High RAM Usage
GitOrigin-RevId: bb534d62931c176d2395e2cceb0afabc57464669
2025-06-18 13:17:14 +00:00
Petr
e33aae05fc PY-81471 Move PyStatementMover to python.syntax
GitOrigin-RevId: c9cb03c1bb97720c392ea482765790674f27b647
2025-06-13 20:21:11 +00:00
Daniil Kalinin
90473326ac PY-76814 Add variance field to PyTypeVarType
GitOrigin-RevId: 2e7fe0b149a7412c4fdae924a846f200e82786a0
2025-06-04 12:17:47 +00:00
Aleksandr.Govenko
97cf7227da PY-78119 Introduce PyNeverType
PyNeverType is no longer child of PyUnionType, it was confusing.
Fixed failing conformance tests

GitOrigin-RevId: d05a425fa02e1647b82017a74b669fa3e1518354
2025-06-03 15:07:07 +00:00
Aleksandr.Govenko
b54f5b4ae8 PY-53880 Incorrect exhaustive pattern matching of Enum or Union types
Add PyNeverType and integrate it in PyTypeAssertionEvaluator

GitOrigin-RevId: 3db5224bfbf559f6d1bb146fd72c6cc6a97c4598
2025-05-30 18:33:26 +00:00
Morgan Bartholomew
4b1d24562a [python] PY-80436 support ellipsis
GitOrigin-RevId: 82e38fcb502ed68d5676f2cc774ef2653d69febb
2025-05-29 01:00:27 +00:00
Morgan Bartholomew
1cfa311783 [python] Rename NoneLiteral .java to .kt
GitOrigin-RevId: cd696ce62a90c0205cee0dbbcccad54e87a85386
2025-05-29 01:00:27 +00:00
Nikolay Chashnikov
4242e9b5a4 [python] API cleanup: remove unused deprecated API scheduled for removal (IJPL-178044)
GitOrigin-RevId: e48671fd16adff0e9777b3ff6dc61bd9482a8018
2025-05-28 23:37:49 +00:00
Andrey Vokin
a589598718 PY-81030, PY-81269, PY-80690 Do not store millions of PyNoneLiteralExpression instances in the cache
GitOrigin-RevId: 8b38eaf581081896b2c17ad862fd3667431e2766
2025-05-28 14:09:01 +00:00
Mikhail Golubev
00c78ebb84 [python] Don't treat PyClassLikeType as PyCallableType in PyTypeVisitor by default
GitOrigin-RevId: 647848f03c4816fb96a6bfcfcad6d9c7258a57ea
2025-05-14 09:51:56 +00:00
Mikhail Golubev
1765651746 [python] Mark PyType.getName() as @NlsSafe
GitOrigin-RevId: e458d1609f94b16433a723f10c6036f4575f2aea
2025-05-14 09:51:56 +00:00
Petr
c8fb196d52 PY-76877 Conformance test failure: overloads_basic.py
PySliceExpression is replaced by PySubscriptionExpression in AST.
PySliceItem is returned by PySubscriptionExpression.getIndexExpression(). For that purpose PySliceItem is now a PyExpression of type `builtins.slice`.

GitOrigin-RevId: 9aa8de13ef7c51741e248317c5264b3a06ffb9bf
2025-05-12 18:15:13 +00:00
Aleksandr.Govenko
a4b4cd8126 PY-80524 Explicit return statement expected false positive for an if inside try / except
GitOrigin-RevId: 6877fc7b34622d7ae884233af96e06ea92c918c1
2025-05-07 15:42:10 +00:00
Mikhail Golubev
3902b51f1b [python] Mark deprecated PyNamedParameter#getArgumentType for removal
GitOrigin-RevId: b57df511bed2d5af2d3160d489094fea424c5885
2025-05-07 14:07:57 +00:00
Mikhail Golubev
98ec9cfd25 [python] Remove unused PyNamedParameter#getRepr
GitOrigin-RevId: 1d7eccf4fc0b5f20a571a8466ff4f4bc8d038826
2025-05-07 14:07:57 +00:00
Vladimir Krivosheev
e3d5d85a47 update bazel files
GitOrigin-RevId: 4a1f45312f93e76248b05a7c8cc27a2b2ac84036
2025-04-30 14:07:08 +00:00
Vladimir.Koshelev
67594cdaad [pycharm] finish community migration to v2
# Conflicts:
#	community/python/pluginCore/resources/META-INF/plugin.xml

GitOrigin-RevId: e4d6969fd15a3fddc4d6a03491fb9f9634285edf
2025-04-30 10:08:56 +00:00