49 Commits

Author SHA1 Message Date
Daniil Kalinin
989485f44a PY-79967 Simplify Template type inference for t-strings
(cherry picked from commit 2964402eac2061e0230e612badc790d0d289f469)

GitOrigin-RevId: 74b859ff596970d08c5fd82f9a2a6112468804e1
2025-05-09 11:12:00 +00:00
Daniil Kalinin
328d4cc4e1 PY-79967 Introduce a separate method in PyStringLiteralUtil for t-strings
(cherry picked from commit 47b1a84c4331aa127a17e4f934c4b1dc28396cf0)

GitOrigin-RevId: 204f5ba41aa022b672e2d71db83b5bd3327770d4
2025-05-09 11:12:00 +00:00
Koudai Aono
5b8c2abc96 PY-79967 Support t-prefixed strings, Related PR: https://github.com/JetBrains/intellij-community/pull/302
* Add PYTHON314_PREFIXES to CompatibilityVisitor
* Patch typeshed, add t-string related stubs
* Infer `string.templatelib.Template` type for t-strings instead of plain `str`



(cherry picked from commit 0e913910ab9e0dca4052856b0585ce66265291c0)

GitOrigin-RevId: f03a68ae9aee458a74eccc19c38d8d3e4dc7491a
2025-05-09 11:11:59 +00:00
Pavel Karateev
22f0b5cd52 PY-80560 Remove mutable default parameter value for __deepcopy__
(cherry picked from commit 7f873b5765a46b026214fd7e2cd09396d6bff59e)

IJ-MR-160889

GitOrigin-RevId: 20413d5c1d9795a3f331eafaee09add61c3e7c21
2025-04-23 16:10:56 +00:00
Pavel Karateev
c3d12920a9 PY-79802 Correctly parse 3.14 language level
(cherry picked from commit 9c0a91749ef9e93430b2e568331127aaa6cd1e98)

IJ-MR-157680

GitOrigin-RevId: 754711dbfa62ca6beabd671c18221357947468e7
2025-03-26 12:41:47 +00:00
Pavel Karateev
05a28360e1 PY-79802 Update required language level for future annotations
(cherry picked from commit 917629f88be6beffc88abe3229836ca6dcbe956e)

IJ-MR-157680

GitOrigin-RevId: 9dbb346269c952ff8d4dec99190bd975ce054fa4
2025-03-26 12:41:47 +00:00
Pavel Karateev
a89725c2f2 PY-79802 Add Python 3.14 language level
(cherry picked from commit cb604b67becc260b6e159335b8448c4e04527c6e)

IJ-MR-157680

GitOrigin-RevId: 270be6440b0107c9124b8e097f0636b171a42bd9
2025-03-26 12:41:47 +00:00
evgeny.bovykin
0060074133 PY-46623 Add setter and deleter to cached_property
(cherry picked from commit 97c7703a89d0e1c49f829aed3474006ac7e5324a)

GitOrigin-RevId: 266ec4f71c70550d06f1632005edfd008029298e
2025-03-19 18:57:08 +00:00
Aleksandr.Govenko
abe414ffc5 PY-48011 Pattern Matching: Type inference
Merge-request: IJ-MR-154823
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 42cb07bee63f34127c85574fc9c09e6043bc7591)

IJ-MR-154823

GitOrigin-RevId: 2ad321e755a0efd262c077b2ea2571143ec72600
2025-03-08 03:26:16 +00:00
Leonid Shalupov
28300b5f37 IJI-2422: community/python: move resources under resources root
GitOrigin-RevId: 4c24cfa366aebda0fef265b18c04a731a4f43a69
2025-02-05 10:14:39 +00:00
Ilya.Kazakevich
b3866686e1 Python: Clean-up API to work with python versions.
There are lots of methods that return "default value" if provided data can't be parsed. It leads to errors and misunderstandings

Signed-off-by: Ilya.Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: 0736c91c91e1e6990d23169a492ec408f7299830
2025-01-25 23:02:05 +00:00
Petr
2c70e635c4 PY-76906 Do not expand enum classes that derive from enum.Flag
GitOrigin-RevId: ea763c79c1aec73d0b41746d49218f91bfc191f6
2025-01-10 20:05:18 +00:00
Max Medvedev
e26bd43692 cleanup ITokenTypeRemapper
GitOrigin-RevId: 8c2fd80bbef25892ac0c2a6c593c4601124fdf23
2024-12-22 19:08:48 +00:00
Vladimir Krivosheev
98799639aa do not use _test as lib - test targets do not support this
GitOrigin-RevId: f2f49db4294b6a64040dbbd5f1d95e972cbd70a3
2024-12-15 18:32:30 +00:00
Vladimir Krivosheev
17916c90f8 libraries -> lib, resources, opt-in, test deps
GitOrigin-RevId: db66ee95dcb0f0553b40c9cc56cd6afed8634cdd
2024-11-27 13:53:42 +00:00
Petr
16d40e9c5d PY-76830 PY-76833 PY-76843 PY-76879 Enums support
GitOrigin-RevId: 9021c003cde70c39f8a5635b42761c08049490e2
2024-11-13 18:30:03 +00:00
Daniil Kalinin
c07b124c92 PY-72185 Use PythonHighlightingLexer instead of plain Python lexer in reparse check of PyReparseableIdentifier
The problem previously appeared in situations when an identifier was changed to a keyword, i.e. `a: Tru` -> `a: True` and `True` keyword was not highlighted properly as it was substituted by an identifier AST leaf as is bypassing the highlighting lexer

Add a couple of tests on it

GitOrigin-RevId: ec25d2115ec650bf781a9fe8140e8708e849ff60
2024-11-08 11:30:12 +00:00
Daniil Kalinin
0e2764b76b PY-72185 Improve reparse checks for single and triple quoted reparseable strings
Add a couple of tests on it

GitOrigin-RevId: 3e889638a8b13059c2b14914e64aea91c1f86445
2024-11-08 11:30:12 +00:00
Daniil Kalinin
b786f7cae2 [python] rename __get__ in PyNames.java from GET to DUNDER_GET to avoid confusion
GitOrigin-RevId: 23dd9bc6cb72630e3bee02a2fb160ff38be17d9a
2024-10-28 08:26:47 +00:00
Daniil Kalinin
fc4a0cd5ef PY-76399 Support __set__ descriptor
Add API for inferring the expected type of `__set__` from `value` parameter
Add corresponding logic to PyTypeCheckerInspection to check if assigned value matches the expected descriptor type
Add tests on it

GitOrigin-RevId: b14ab7b2e40e225b508875a778ceae8986cbb291
2024-10-28 08:26:47 +00:00
Petr
85be2f6d8e PY-76816 Conformance test failure: enums_definition.py
GitOrigin-RevId: 7881511a5cef928fbb28523e3c1db32460f30eb7
2024-10-23 18:58:25 +00:00
Nikolay Chashnikov
b03b560520 [python] API cleanup: mark deprecated unused API for removal (IJPL-156972)
Deprecated APIs which still have internal usage are marked as internal to ensure that new external usages won't appear.

GitOrigin-RevId: 09818b884851d7b768f8ee0f356f982e79b46ed9
2024-10-10 23:55:42 +00:00
Daniil Kalinin
b934cfe38a PY-74231 Fix false positive "Statement expected, found Py:DEDENT" for a nested type alias
GitOrigin-RevId: 03d64abe2c949a5912eb5c16ef48a5149568d66f
2024-10-01 11:43:14 +00:00
Daniil Kalinin
7751fceaed PY-71002 PEP-696: Support new syntax for default types of Type Parameters in new-style declarations
- PEP-696 adds a new syntax for declaring the default types of Type Parameters in new-new style generic classes, functions and type alias statements. Support these grammar changes.
- Store info about default types in stubs for Type Parameters
- Increment the stub version counter in PyFileElementType

GitOrigin-RevId: b6b22e3eaa86ce06132885781e5775a89bf4b840
2024-09-07 11:11:12 +00:00
Daniil Kalinin
681e3a7d58 PY-71748 change default receiver for __eq__ and __ne__ operations (== / !=) from right to left
GitOrigin-RevId: ef77e470061fd71bd8f12c51353fa84968c28856
2024-09-04 10:57:28 +00:00
Daniil Kalinin
7ccfd3772d PY-72185 disable reparseable leaves by default for further investigation
GitOrigin-RevId: 87a1d99a80415128b303f2b0cb343afd2c939b6a
2024-08-19 16:47:41 +00:00
Petr
a3608ebd22 PY-34617 Remove if stubs
GitOrigin-RevId: 13f49394e92daca80af9c82ac9ac1a439a6ae1f5
2024-08-12 09:37:32 +00:00
Petr
93b9066edf PY-34617 Support version check
GitOrigin-RevId: 3318ff79cdcc5ba0ce5e4feb65abad5ad0f4acfa
2024-07-28 00:24:15 +00:00
Alexander Lobas
932f2d438e Swap icon path parameters: move expUI path to the first place
GitOrigin-RevId: 74cf09fb454c89b676be259cdd7437a81ac4c067
2024-07-25 15:12:07 +00:00
Vladimir Koshelev
c69a1a2810 [pycharm] add smoke tests that shared v1/v2 modules are in sync
GitOrigin-RevId: fe6fc6a60a83240b8b2b0a3c7a0f88ff707f0227
2024-07-24 17:26:27 +00:00
Vladimir Koshelev
ec8c3a8aa3 [pycharm] remdev: migrate PyCharm Frontend launcher to v2 modules
GitOrigin-RevId: e2c62c23bd0a22c742a46177c1a1ad4c4b5b95d0
2024-07-24 13:13:53 +00:00
Daniil Kalinin
e9a6246df3 PY-72185 Implement incremental parsing for PSI leaves for Python
Merge-request: IJ-MR-138193
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: 7d004677a5b7a4637ea956f13ed85abc0d88604e
2024-07-17 12:15:36 +00:00
Daniil Ovchinnikov
07f7cdaf55 IJPL-1044 wrap clinit instance requests in non-cancellable section
GitOrigin-RevId: f63849ca504a01dbae51faac27f29e69f43bff86
2024-06-25 20:12:17 +00:00
Egor.Eliseev
0c73c9eff9 PY-72274 separating content for python core/pro plugins
1. Delete `intellij.python.community.impl.xml` (move content to `PythonCore` plugin). It is necessary to fix incorrect dependencies: `PythonCore`, `Pythonid` include the same module.
2. Fixed dependencies: if some plugin/module needs Python core functionality, then it should depend on `PythonCore`.


Co-authored-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>

Merge-request: IJ-MR-136158
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: ce9ed4c17f601ee1ca2b6cf608f4e30fdac1d879
2024-06-19 21:39:24 +00:00
Alexander Lobas
89d58ee436 IJPL-150231 Move icon mappings from json to icon generator
GitOrigin-RevId: 4d4576fc7eeb92ec43c36abec2d62d271b45d9a4
2024-06-15 23:19:46 +00:00
Vladimir Krivosheev
61edc08800 IJPL-149476 cleanup
GitOrigin-RevId: 732ff667829f6fc70bb665ffcd715120df2d7de3
2024-05-15 21:11:50 +00:00
Daniil Kalinin
ba6015d27f PY-64326 implement incremental parsing for PyStatementList PSI elements
These changes make PyStatementList elements (which are function and class bodies, cycle bodies, if-else branches, etc.) lazy-parseable which means they can now be reparsed without reparsing the whole file if changes are happened inside them accepted as safe

The main reason behind these changes is to improve performance

GitOrigin-RevId: 892acbe0c95fde6aec74b7595b0a58f902c426f5
2024-05-07 17:30:41 +00:00
Mikhail Golubev
b9d7fee816 PY-64304 EA-247016 Don't report illegal "await" expressions used as assignment targets during parsing
Instead, parse them as usual and later report in the dedicated AssignTargetAnnotator
and TypeAnnotationTargetAnnotator. This way, a PsiError element appearing in the PSI
tree of a type declaration statement doesn't cause PyAstTypeDeclarationStatement.getTarget
nullability contract violation.

GitOrigin-RevId: a3e90088cfac7938c398d4d293a72dbd127a2cd0
2024-04-24 09:03:53 +00:00
Petr
6b3d789a4b PY-61639 Client keyword highlighting
GitOrigin-RevId: 5af1268616b174cf1c163d60e8c41c02897ecbf7
2024-03-19 20:04:36 +00:00
Petr
85c54b3a4c PY-61639 Move PythonFormattingModelBuilder to python.syntax.core
GitOrigin-RevId: bdcbd076cd3c1531204eff35515b44cd0edc9f68
2024-02-16 15:52:22 +00:00
Tagir Valeev
1a5c9336cc Purity and mutation contracts
GitOrigin-RevId: 0c0b04249735f5f02848b965983f579748373ade
2024-02-07 19:29:13 +00:00
Vladimir Koshelev
aec2051aa9 [python] get rid of IStubElementType and move logic about working with stubs to impl classes PY-61639
GitOrigin-RevId: 062dead109c25d944d4f61e901dc3c64c00b392e
2024-01-19 23:14:49 +00:00
Ilya.Kazakevich
b533e29ce0 [python] get rid of classes registered in wrong modules
You must register class in the same v2 module class sits

GitOrigin-RevId: c7fcccd27c2fcaa3d9391d1173f61ad43fe2b076
2024-01-17 04:59:01 +00:00
Ilya.Kazakevich
b599287e32 [python] Refactor icons layout in community
Icons removed from SDK package (no need to have a separate class for it), ultimate icons moved out of community module.

There are only 3 icon packages in community:
* `PythonParserIcons`
* `PythonPsiApiIcons`
* `PythonIcons` (aka `intellij.python.community.impl`)

Latter two have `.json` mapper to replace old icons with new one for New UI which is included into corresponding `.xml` file.

GitOrigin-RevId: 0438ad4485b5a82a89c81ec63ae6e575d5bb52de
2024-01-12 15:53:48 +00:00
Ilya.Kazakevich
e4a56dc87f [python] PythonPsiApiIcons moved to com.jetbrains.python package, as whole community.python.impl must be there
GitOrigin-RevId: 0c38ddbdd5b0588ed4ec09c1d447248678974323
2024-01-11 20:29:55 +00:00
Andrey.Matveev
c24752ceb1 PY-58752 Impl inspection for check matching override signature
GitOrigin-RevId: 4520138ac657a514b53f2f939521f0336701be46
2023-10-22 10:27:24 +00:00
Vladimir Koshelev
6475c9a6f9 [python] fix PyElementTypesFacade initialization in integration tests
GitOrigin-RevId: cae81f0d4549477f651680d76550fff54a7c7116
2023-10-13 15:39:49 +00:00
lada.gagina
47b89847e6 Add language level for Python 3.13 (PY-63375)
GitOrigin-RevId: beb405baf746c1992d51118d660cb8c718deda62
2023-10-12 20:25:28 +00:00
Vladimir Koshelev
29f0eb6c77 [python] extract python parser to a separate module
Merge-request: IJ-MR-116296
Merged-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>

GitOrigin-RevId: e7559fb3215d757e6273543e4aa27d52df755e63
2023-10-09 11:56:10 +00:00