Commit Graph

59 Commits

Author SHA1 Message Date
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
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