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
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
* 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
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
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
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
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
Deprecated APIs which still have internal usage are marked as internal to ensure that new external usages won't appear.
GitOrigin-RevId: 09818b884851d7b768f8ee0f356f982e79b46ed9
- 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
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
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
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