Commit Graph

45 Commits

Author SHA1 Message Date
Mikhail Golubev
d61627c166 PY-79967 Make PyFormattedStringElement.isFormatted actually check "f" in the prefix
Because now PyFormattedStringElement represents both f-strings and t-strings.

(cherry picked from commit d63579976773af811ff5a6c6fcd08e4471ede7d9)

GitOrigin-RevId: 7a2063f68d757dd5e3958819f2becaee3dae821b
2025-05-09 11:12:01 +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
evgeny.bovykin
12927ca71b ScopeUtilCore - use .getGreenStub instead of .getStub to guarantee that the stub is not null
(cherry picked from commit e6eecfa890377ecd29d2ba42aef97873467e24c7)

IJ-MR-159043

GitOrigin-RevId: 7f16e83dcb236cdda29e8d54e3d75c014377ab6e
2025-04-03 16:53:35 +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
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
Petr Golubev
25b8ebcf83 PY-61639 Extracted PythonEnterHandler
GitOrigin-RevId: 8fd0c063c917e07c3f1bf98533c3de867f770ee9
2024-02-08 13:58:08 +00:00
Petr Golubev
1a73bd2d21 PY-61639 Extracted PyAstElementGenerator
GitOrigin-RevId: 915c235120b079188d81efaa9ccf9728131fa3df
2024-02-08 13:58:08 +00:00
Petr Golubev
c90db007c0 PY-61639 Lift PyFile.getTopLevelAttributes(), PyFile.findTopLevelAttribute() to PyAstFile
GitOrigin-RevId: 373accde23bb2c55d1d23266da7874e34da96ea3
2024-02-08 13:58:08 +00:00
Petr Golubev
f818966298 PY-61639 Lift PyParameter.isSelf() method to PyAstParameter
GitOrigin-RevId: 919518e5d06f2b968974bfdbd8deea2ced03c822
2024-02-08 13:58:08 +00:00
Petr Golubev
223013dad1 PY-61639 Introduced PyAstElementVisitor
GitOrigin-RevId: 6ee69922a4ade172dba5abb3ea3b13d01c2b0ebc
2024-02-08 13:58:08 +00:00
Petr Golubev
7668d7231b PY-61639 Remove unused methods (PyAstElement)
GitOrigin-RevId: 5c916dad7c470a8951497740771c5e848d1e0266
2024-02-08 13:58:08 +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
Petr Golubev
b3c3216f79 PY-61639: Extracted python ast
GitOrigin-RevId: 4fc0ae909811302d8425f1e67d8c648c290afcb3
2024-01-17 17:23:01 +00:00