Commit Graph

58 Commits

Author SHA1 Message Date
Aleksandr.Govenko
31dcf9f6d5 [python] Fix NPE in PyAstAsPattern
(cherry picked from commit d8f319769d8fd25c27e6ab75b05d94d56a9751b9)

IJ-CR-172556

GitOrigin-RevId: c0c921a2ef363c9e3b33a21869cc290896372ab6
2025-08-15 13:27:10 +00:00
Aleksandr.Govenko
adcc559e5c PY-81676 Don't report lines with assert_never as unreachable
(cherry picked from commit afdbf35915823de02a6b8551f57770113d0feb2f)

IJ-CR-172556

GitOrigin-RevId: 0f8526e2877736ac606db9ed4657a530a66d6f23
2025-08-15 13:27:10 +00:00
Aleksandr.Govenko
5a60b17b4d Rename .java to .kt
PY-81676


(cherry picked from commit ed0da39e7afbb15a593c68b319682fa618b0ed4f)

IJ-CR-172556

GitOrigin-RevId: 061f68ec6b1cde23d369d291e212bf2edbcd782d
2025-08-15 13:27:10 +00:00
Morgan Bartholomew
855d0800ae conflicts from cherrypick
GitOrigin-RevId: 0c5ac8858db88c73c09979309462129171489bab
2025-08-01 01:31:11 +00:00
Petr
e33aae05fc PY-81471 Move PyStatementMover to python.syntax
GitOrigin-RevId: c9cb03c1bb97720c392ea482765790674f27b647
2025-06-13 20:21:11 +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
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
Andrey Vokin
779b6b9973 PY-80502 PyCharm became unresponsive with a 100% CPU load when optimize imports
GitOrigin-RevId: c8305e57d98f5ec11a57eda72551da6a00b2d810
2025-05-28 12:49:21 +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
Mikhail Golubev
b8c67616f1 PY-79967 Make PyFormattedStringElement.isFormatted actually check "f" in the prefix
Because now PyFormattedStringElement represents both f-strings and t-strings.

GitOrigin-RevId: d63579976773af811ff5a6c6fcd08e4471ede7d9
2025-05-02 12:08:57 +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
evgeny.bovykin
73936d2b0d ScopeUtilCore - use .getGreenStub instead of .getStub to guarantee that the stub is not null
GitOrigin-RevId: e6eecfa890377ecd29d2ba42aef97873467e24c7
2025-04-03 13:16:07 +00:00
Aleksandr.Govenko
a0e317c52f PY-80044 ArrayIndexOutOfBoundsException from PyDataFlow under specific conditions
Merge-request: IJ-MR-158616
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

GitOrigin-RevId: 4bb51242c2b5545ea4ce499664734903a70b900e
2025-03-27 18:53:20 +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
Vladimir Krivosheev
0bc1cf1557 update bazel files
GitOrigin-RevId: 7320d3eff3aba093692ce66839c720ece6d7c4db
2024-12-30 11:28:24 +00:00
Vladimir Krivosheev
7b9ec58009 do not export intellij.database.connectivity.tests
GitOrigin-RevId: a1ef44dfa34cde110c9e6cad19d11b5e3019ab72
2024-12-28 21:45:55 +00:00
Vladimir Krivosheev
68d99c6550 cleanup
GitOrigin-RevId: 9cb238c220249088bfc75a448eb310b93c7fc45c
2024-12-26 14:56:01 +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
Aleksandr.Govenko
31dd92576e PY-20611 Missing warning about functions implicitly returning None when return type is not Optional
Updated PyFunction to account for implicit 'return None' statements when inferring return statement types.

It affected return type inference of PyFunction.

Fixed a failing test related to formatted strings.

Added a quick fix to make all return statements explicit.

Updated the CFG to include PyPassStatements, enabling detection of exit points in empty functions.

Simplified PyMakeFunctionReturnTypeQuickFix to independently infer function types and handle required imports. Currently, it does not support specifying custom suggested types.



Merge-request: IJ-MR-148719
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

GitOrigin-RevId: 9f58961f9eb70e4f9dbba7359f5aafdfd392b7e2
2024-11-26 17:02:37 +00:00
Alexander Kuklev
b076ea2794 [PY-33917] Now '__init_subclass__' is treated as and constructor-like method in appropriate cases
GitOrigin-RevId: c2ac58960f641868006141ae3001c932c6a8eaaf
2024-11-22 20:44:45 +00:00
Petr
9034b13880 PY-75537 Implement PyAstNamedParameter.getRepr()(PyFrontendElementTypesFacadeImpl.kt)
GitOrigin-RevId: ef38af29fd176324f4c1bec503a116a5b4f351b4
2024-10-16 10:54:46 +00:00
Petr
6a3cfa9f34 PY-75537 Implement PyAstStringLiteralExpression.createLiteralTextEscaper() (PyFrontendElementTypesFacadeImpl.kt)
GitOrigin-RevId: c42b7626a6e57c118e7028a4806bd8fa7938076c
2024-10-16 10:54:46 +00:00
Petr
a1c0baf9c5 PY-75537 Implement PyAstStringLiteralExpression.getStringValue(), PyAstStringLiteralExpression.getStringValueTextRange() (PyFrontendElementTypesFacadeImpl.kt)
GitOrigin-RevId: 372f147a61e07c6cb21aaeb8a7d0f3d14d49417d
2024-10-16 10:54:46 +00:00
Petr
5befce7fb9 PY-75537 Implement PyAstAssignmentStatement.getTargetsToValuesMapping() (PyFrontendElementTypesFacadeImpl.kt)
GitOrigin-RevId: 8c4926689e42f117275986c2e1246d7e04bde489
2024-10-16 10:54:46 +00:00
Petr
05942bee35 PY-75537 Implement PyAstAssignmentStatement.getTargets(), PyAstAssignmentStatement.getRawTargets() (PyFrontendElementTypesFacadeImpl.kt)
GitOrigin-RevId: 0f9292ac3ca0f4f4728b25cb2e5ddcd618b8319d
2024-10-16 10:54:46 +00:00
Mikhail Golubev
44e22f679c Fix ScopeUtilCore.getScopeOwner for immediate PyDecorator and PyNamedParameter elements
GitOrigin-RevId: 6013da7fbdf9e41ced1a32cae091d79014777a82
2024-09-09 11:34:15 +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
Aleksandr.Govenko
9b5b413d45 PY-24044 Evaluate expression and conditional breakpoints should allow adding imports for unresolved names
Added new PyCodeFragmentWithHiddenImports that allows adding imports for unresolved names into a hidden file

GitOrigin-RevId: fb3fa4e491164bdd376d3b25204202034994afa5
2024-08-23 13:37:42 +00:00
Petr
a3608ebd22 PY-34617 Remove if stubs
GitOrigin-RevId: 13f49394e92daca80af9c82ac9ac1a439a6ae1f5
2024-08-12 09:37:32 +00:00
Petr
7f22ee443e [python] Fix nullability annotations (PyAstNumericLiteralExpression)
GitOrigin-RevId: d5db0add83ac134aab91198b1a931c026829d216
2024-07-28 15:43:22 +00:00
Petr
93b9066edf PY-34617 Support version check
GitOrigin-RevId: 3318ff79cdcc5ba0ce5e4feb65abad5ad0f4acfa
2024-07-28 00:24:15 +00:00
Petr
16a7fb4b3e PY-34617 Move getTopLevelAttributes(), findTopLevelAttribute() from PyAstFile
GitOrigin-RevId: 226a7e968851ab0c8730bb79ca90d0ed5dcec364
2024-07-28 00:24:15 +00:00
Petr
cfa28c0d2a PY-34617 Move getClassAttributes(), getOwnSlots() from PyAstClass
GitOrigin-RevId: 39ee4f79543a35fc696f9c754f5c5cf89b711f63
2024-07-28 00:24:15 +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
Andrey Vokin
e6c66dfd5e PY-74012 Deprecation decorator stub resolves during indexing
Avoid using resolve when calculating deprecation messages

GitOrigin-RevId: 813849bdaeb3819b445db600fc0efbcb014ed5c9
2024-07-19 19:18:54 +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
Mikhail Golubev
8eb96b314a [python] Delegate to visitPySequenceExpression when visiting PySetLiteralExpression
GitOrigin-RevId: be032f963dccd6ebc062517047c5a1c962b31ec6
2024-07-11 19:46:02 +00:00
Mikhail Golubev
ded1e5d860 [python] Implement acceptPyVisitor in PyStatementListImpl and PyAstStatementList
In PyStatementListImpl, it was seemingly accidentally removed as part of
892acbe0c95fde6aec74b7595b0a58f902c426f5.

GitOrigin-RevId: 17b8db2ee2c779cb32cee346f59fb3cc56911288
2024-07-01 16:43:01 +00:00
Andrey Vokin
f2a322c6d9 PY-73107 Usages of @warnings.deprecated inside .pyi stubs are ignored
GitOrigin-RevId: 7682eff8c8ca8ae8241ddee3191add34ab2ac22e
2024-06-17 22:26:51 +00:00
Mikhail Golubev
aff932b7c9 [python] Add methods visitPyKeyValueExpression to PyElementVisitor and PyAstElementVisitor
GitOrigin-RevId: 247a02160e18c93a00b1630e2ed70cea6dcefbbf
2024-06-13 11:59:38 +00:00
Andrey Vokin
673383c3da PY-61651 Deprecation highlighting with PEP 702 @deprecated decorator
GitOrigin-RevId: 426e7001d20849d7029fea55431d3e2cfae3eb11
2024-06-10 15:58:53 +00:00
Petr
3f43255122 PY-73076 Ctrl+Z doesn't work in RemDev
GitOrigin-RevId: e80b54e1a43e9f83be921096a1bc3a0059795cb7
2024-06-05 17:51:13 +00:00
Petr
4602d09655 PY-61639 Extracted PyHighlightingAnnotator
GitOrigin-RevId: 432bcb87b77fa55f1ccb26000d91ae021cebcc6b
2024-03-27 15:05:16 +00:00
Petr
b9167aef8b PY-61639 Move PyPreFormatProcessor to python.syntax.core
GitOrigin-RevId: 30d204206de9e09eae34baf0555fc9be5822ba68
2024-02-16 15:53:21 +00:00
Petr
3b9b10b296 PY-61639 Move extendWordSelectionHandlers to python.syntax
GitOrigin-RevId: d5957878544a0026f249109ca1df0a18e20a8a55
2024-02-16 15:52:51 +00:00
Petr
85c54b3a4c PY-61639 Move PythonFormattingModelBuilder to python.syntax.core
GitOrigin-RevId: bdcbd076cd3c1531204eff35515b44cd0edc9f68
2024-02-16 15:52:22 +00:00