70 Commits

Author SHA1 Message Date
Pavel Karateev
e9731c5b3f [python] PY-83029 add Python 3.15 language level
(cherry picked from commit b7f275347c6d89230c497a3806a3efee26850833)

IJ-MR-182362

GitOrigin-RevId: ea857df39050863b5475063df902015cafeae7d2
2025-12-02 11:21:12 +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
4b619431c2 IJ-MR-175479 IJ-CR-146078 IJPL-209476 fast-util
GitOrigin-RevId: 87af2a3aad6e264a9b332c20ff572ec735f741f2
2025-10-06 16:34:02 +00:00
Ilia Kirianovskii
f43aa95086 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 98a67396a48bddc3d084cc93c50ae2f2017bfe8c
2025-09-29 00:11:15 +00:00
Marcus Mews
63abd60ba4 PY-84077 - Support PEP 758 – Allow except and except* expressions without parentheses
- 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: a1b9bdf252ac874aa7bd1a6881c1784259bb35cc
2025-09-15 08:33:03 +00:00
Yuriy Artamonov
2cf790a9d6 [python] PY-84203 Reuse PythonParserIcons.PythonFile icon everywhere
GitOrigin-RevId: c485c76e41659f33bd8d86de2470b27be684411d
2025-09-14 23:47:27 +00:00
Ilia Kirianovskii
dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Petr
1399a0c594 PY-81981 Sync pushed language level
GitOrigin-RevId: d60893c0631846bf411819c5d2687e411a0a578c
2025-07-22 19:28:39 +00:00
Mikhail Golubev
552c41d53a PY-72232 Report non-context-managers in with statement
GitOrigin-RevId: 623ae38649b33ad2730c977f4c5e36a1f82224c7
2025-07-17 15:06:04 +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
Marcus Mews
c4394a0e40 PY-26110: Syntax highlighting changes from docstring to string if comment is added to the last line
- change lexer to support docstrings with trailing comments
- small syntax clean-up
- prevent NPE in PyTestCase#tearDown()
- add some tests for PY-40634

GitOrigin-RevId: 949617a518f8938f557106bd2a4a589bdbb1f542
2025-06-26 21:59:49 +00:00
Petr
aa82ce5f70 PY-81646 Get rid of EMPTY_EXPRESSION nodes within SLICE_ITEM
GitOrigin-RevId: 6ffe0027790bb41b8ac18251903529aa1b1243f6
2025-06-13 18:59:31 +00:00
Petr
ff19de5654 PY-81646 False positive: Unresolved references after any slice in Python for the rest of the line
Fixed AST for PySubscriptionExpression containing a slice.
Before PySubscriptionExpression.getIndexExpression() returned only the first slice expression (if any).

Also fixed PySliceItem's subtree, so now its children are correctly mapped to lowerBound, upperBound and stride properties.

GitOrigin-RevId: 840af92957d0431679cf7a477866dea76320ca80
2025-06-13 18:59:31 +00:00
Morgan Bartholomew
e9bdb6af71 [python] PY-76810 handle private parameter names correctly
GitOrigin-RevId: f4b89d6a03146a50adc8c7de86f6ec03e5cf9af8
2025-05-30 09:41:02 +00:00
Morgan Bartholomew
4b1d24562a [python] PY-80436 support ellipsis
GitOrigin-RevId: 82e38fcb502ed68d5676f2cc774ef2653d69febb
2025-05-29 01:00:27 +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
Morgan Bartholomew
639ca7673b [python] PY-76819 handle None correctly
PY-80427 Fixed


IJ-MR-160807

GitOrigin-RevId: 966bdb2fd5e9a3a3ac9d06b4a7d65da3157160ba
2025-05-09 04:05:02 +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
Ilia Kirianovskii
5f6c82d548 [bazel] Fix compilation in //python:python
GitOrigin-RevId: 2437517a48f251444fa3c54bddff9578294b336e
2025-04-28 22:39:05 +00:00
Daniil Kalinin
5e12117835 PY-79967 Simplify Template type inference for t-strings
GitOrigin-RevId: 2964402eac2061e0230e612badc790d0d289f469
2025-04-28 19:14:39 +00:00
Daniil Kalinin
9d86a1d671 PY-79967 Introduce a separate method in PyStringLiteralUtil for t-strings
GitOrigin-RevId: 47b1a84c4331aa127a17e4f934c4b1dc28396cf0
2025-04-28 19:14:39 +00:00
Koudai Aono
7239d2ef2c 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`



GitOrigin-RevId: 0e913910ab9e0dca4052856b0585ce66265291c0
2025-04-28 19:14:39 +00:00
Mikhail Golubev
ecb85823a1 [python] Remove Python- and docstring type hint lexer duplicates
Lexers should be generated in modules where the corresponding grammar files belong.
Namely Python's own lexer in intellij.python.parser, and the legacy type hint lexer in
intellij.python.psi.impl.

GitOrigin-RevId: 602387221c84e92811608aac6730eeb5a7bf2f90
2025-04-28 15:53:14 +00:00
Pavel Karateev
fec1040ce4 PY-80560 Remove mutable default parameter value for __deepcopy__
(cherry picked from commit 7f873b5765a46b026214fd7e2cd09396d6bff59e)

IJ-MR-160889

GitOrigin-RevId: 47dde7f0ddad622c35e07980789553e44773e24a
2025-04-23 13:36:52 +00:00
Pavel Karateev
82e433af01 PY-79802 Correctly parse 3.14 language level
(cherry picked from commit 9c0a91749ef9e93430b2e568331127aaa6cd1e98)

IJ-MR-157680

GitOrigin-RevId: eb106921370f67813db0acd7e4d80fe0fd3c8360
2025-03-25 21:14:30 +00:00
Pavel Karateev
34b7ca9ec9 PY-79802 Update required language level for future annotations
(cherry picked from commit 917629f88be6beffc88abe3229836ca6dcbe956e)

IJ-MR-157680

GitOrigin-RevId: 3f46388636239704e2db6f8b7225d057cdc1c374
2025-03-25 21:14:29 +00:00
Pavel Karateev
65be2c29b1 PY-79802 Add Python 3.14 language level
(cherry picked from commit cb604b67becc260b6e159335b8448c4e04527c6e)

IJ-MR-157680

GitOrigin-RevId: f1b0ad4917e40b4a056055bd1c5ac19884177be2
2025-03-25 21:14:29 +00:00
evgeny.bovykin
3df8d77318 PY-46623 Add setter and deleter to cached_property
GitOrigin-RevId: 97c7703a89d0e1c49f829aed3474006ac7e5324a
2025-03-14 15:15:09 +00:00
Aleksandr.Govenko
fdd47a988b PY-76825 Conformance test failure: namedtuples_define_functional.py
Merge-request: IJ-MR-157423
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

GitOrigin-RevId: 43e0729c540507d0a280d46aee4ca086e572d527
2025-03-13 20:55:38 +00:00
Aleksandr.Govenko
0073c7a8bb PY-48011 Pattern Matching: Type inference
Merge-request: IJ-MR-154823
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

GitOrigin-RevId: 42cb07bee63f34127c85574fc9c09e6043bc7591
2025-03-07 22:56:00 +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