Commit Graph

234 Commits

Author SHA1 Message Date
Ilia Zakoulov
a15b7f25b8 PY-1751: Introduce getMethodsInherited for PyClass.
This method collects all methods defined in the class and its parents.
Similar to `getPropertiesInherited` and `getClassAttributesInherited`.

GitOrigin-RevId: 8dcec5a002ffa105083ece6f4418d51e6d8c2879
2024-08-14 13:36:59 +00:00
Petr
0020fdc7e9 PY-34617 Take into account sys.version_info checks when analyzing Python files
Added test for version-specific stub elements

GitOrigin-RevId: fde82213359e577cb45006d8a795ec8e44129328
2024-08-13 20:39:16 +00:00
Vladimir Lezhnev
279d23bd2a PY-73911: Delete hardly used three-argument createStringLiteralFromString
GitOrigin-RevId: 0c796ca5ccf8be2c5ac42f2eda80acaf12b770db
2024-08-12 12:33:11 +00:00
Vladimir Lezhnev
3bcabcf4a0 PY-73911: fix "the inserted app is double-quoted" issue
GitOrigin-RevId: e22cadbea69abbfaf312b67bce3a82b9190912b7
2024-08-12 12:33:11 +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
Petr
4317e0a1ed PY-34617 Restore PyIfPartIf, PyIfPartElif interfaces
GitOrigin-RevId: 3283be157d6f030840103fba5b8c7cfcee508e2b
2024-07-28 00:24:15 +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
Mikhail Golubev
8eb96b314a [python] Delegate to visitPySequenceExpression when visiting PySetLiteralExpression
GitOrigin-RevId: be032f963dccd6ebc062517047c5a1c962b31ec6
2024-07-11 19:46:02 +00:00
Tagir Valeev
6bb83bc8e5 [stubs] Reduce amount of raw types
GitOrigin-RevId: 169895a6ee3c98db193443dbb0ced98497221430
2024-07-04 21:05:23 +00:00
Petr
5054f4a9b5 [python] Do not store unused decorator arguments in stubs
GitOrigin-RevId: d1a5f63dbed11a4f373d1d7936700af3bc74f70f
2024-07-02 14:04:36 +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
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
c015ff5cbf PY-55044 TypedDict **kwargs typing
GitOrigin-RevId: 5dff382b321ac166ed4b8cf90e431ea719995608
2024-05-14 23:49:38 +00:00
Dima Golovkov
9faf2674f1 Update python icons for IntUI for python-psi-api for UX-3044
GitOrigin-RevId: 7d835ab3505807c81082b5db7ae6363f306d7b1b
2024-04-19 16:48:31 +00:00
Mikhail Golubev
cef42660a3 PY-17627 PY-17733 Resolve class attributes defined in @classmethods
The logic is similar to that for instance attributes. Top-level class
attributes and methods defined in the class body get the precedence,
followed by class attributes defined with assignments in @classmethods
unless the latter would resolve to the same assignments as in

cls.attr = cls.attr + 1

finally, we scan through all other class methods resolving the name
to the first definition inside one of them.

So far, I intentionally didn't expose such attributes in findClassAttribute()
or getClassAttributes() because users of these methods assume that
this API considers only attributes defined immediately in the class body.
Adding extra definitions from class methods might break these usages.

I had to update the inspection about typing.Final, because it relied
on the fact that resolve() on assignment targets on class objects can
lead only to those top-level class attributes, where type hints are normally
located, but now it can lead to assignments to a qualified attribute inside
a containing class method.

GitOrigin-RevId: 0ca5bdaa4efca127ac187e822a49df6795e1028a
2024-03-28 12:17:37 +00:00
Petr
6b3d789a4b PY-61639 Client keyword highlighting
GitOrigin-RevId: 5af1268616b174cf1c163d60e8c41c02897ecbf7
2024-03-19 20:04:36 +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
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
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
Daniil Kalinin
eb58a3805e PY-61883 PEP 695 Type Parameter Syntax: Make PyTypingTypeProvider aware of the new-style type parameters and aliases
Inherit PyTypeAliasStatement from PyQualifiedNameOwner to re-use type aliases stack in PyTypingTypeProvider

Various tests for the changes above

Co-authored-by: Mikhail Golubev <mikhail.golubev@jetbrains.com>

GitOrigin-RevId: 242427c6f84c05ec48c94085f20675b8e30f8625
2023-11-06 19:59:18 +00:00
Daniil Kalinin
0ca9ba4a99 PY-62608 Store info about type parameter kind (TypeVar/ParamSpec/TypeVarTuple) inside PSI stubs
GitOrigin-RevId: 80aa6d67e32a0e7e2a7e8ed53f72288831e9dccf
2023-11-06 19:59:18 +00:00
Nikita Ashihmin
d44ce30231 [bdt] BDIDE-5203 Spark(feat): Add context to PythonDocumentationQuickInfoProvider
GitOrigin-RevId: 32d5ecfccfccc88e00addddd0d813bf28277672a
2023-11-01 17:52:23 +00:00
Nikita Ashihmin
65f8b3a286 [bdt] BDIDE-5203 PySpark(feat): Add columns info to Hint Documentation
GitOrigin-RevId: 41a5912a85254c6ea53c8be1805884b0a2491718
2023-10-31 22:31:30 +00:00
Mikhail Golubev
94c2a4859e [python] Add javadoc for PyTypeVarTupleType, PyUnpackedTupleType and PyVariadicType
GitOrigin-RevId: 29670649bf511958d1d6a935a4c90429c378b928
2023-10-20 16:57:57 +00:00
Mikhail Golubev
15c37a5bad PY-53105 PEP 646: Split PyGenericVariadicType into PyUnpackedTupleType and PyTypeVarTupleType
TypeVarTuples, i.e. type parameters, such as *Ts, and unpacked tuples types, i.e.
concrete types, such as *tuple[int, ...], are two independent entities in the type
system. Keeping them both represented as a single type is confusing and introduces
a lot of bookkeeping for accessing their state and filtering out unpacked tuples in
every place where a type parameter is expected.

For cases where both types are applicable, and we need to distinguish them from regular
"non-unpackable" types, PyVariadicType marker interface was introduced.

Also, make the API names more consistent with the PEPs terminology: "unbound" unpacked
tuple types instead of "homogeneous" unpacked tuple types.

GitOrigin-RevId: be77eae46fd78512eaf74d5a9709faacc762e45f
2023-10-20 13:38:11 +00:00
andrey.matveev
a75c569022 PY-53105 Support TypeVarTuple
GitOrigin-RevId: f8160e9d802b09991daa710ed9a20f3e30d455da
2023-10-20 13:38:04 +00:00
Konstantin Nisht
87722de8ea Revert "[python] Allow modification of python SDK in headless mode through environment keys"
This reverts commit 3a202c64

GitOrigin-RevId: f6d6b26c10ba253c1a180a63d4939f4bd5e8f7a0
2023-10-19 16:23:08 +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
Mikhail Golubev
e55fc0031d [python] Simplify a stream in LanguageLevel.SUPPORTED_LEVELS
GitOrigin-RevId: af5156e67989bb88235c89b751f66ea0cdbc4174
2023-10-02 21:38:06 +00:00
Mikhail Golubev
927eca19f5 [python] Compare versions of module SDKs in PythonLanguageLevelPusher using a stream
Even though LanguageLevel enum items are already sorted by the corresponding
version, I decided to introduce a dedicated comparator to make sure that the
logic of isOlderThan/isAtLeast is used for compareTo, not the default order of
enums.

GitOrigin-RevId: f1d4845154c9b71e920e2b634ea6339643bf9467
2023-10-02 21:38:03 +00:00
Konstantin Nisht
7d9f718f82 [python] Allow modification of python SDK in headless mode through environment keys
GitOrigin-RevId: 3a202c6418557c75c367d3d0457a5977a4ab6b6b
2023-09-30 18:44:34 +00:00
Daniil Kalinin
97185d17c8 PY-62608 PEP 695 Type Parameter Syntax: Resolve and scoping for type parameters in type aliases
GitOrigin-RevId: be532456e7a9c470d5d0a2770a7a2eb9b9b6e8de
2023-09-28 15:05:33 +00:00
Daniil Kalinin
1c5b0c5ac3 PY-62608 PEP 695 Type Parameter Syntax: PSI stubs for type parameter lists and type aliases
GitOrigin-RevId: b8707b4677519bab5bcf922c9747eb8388e3157b
2023-09-28 15:05:30 +00:00
Ilia Zakoulov
fbbf66341b PY-62513: Implement obtaining all properties from class and its superclasses
GitOrigin-RevId: 6b531affdde601bce7660ddb7f2fbb7f85998050
2023-09-19 16:17:54 +00:00
Daniil Kalinin
8b217ed53a PY-61853 PEP 695 Type Parameter Syntax: Parsing
GitOrigin-RevId: 286b53bb4e69cf1deb58dc75f41652e6a12a3af3
2023-09-15 16:04:41 +00:00