PEP 498 required f-strings to be recognizable by existing tooling, such as syntax highlighters,
by prohibiting re-using quotes of the same kind and having line breaks inside expression fragments.
We used to detect these problems already at the lexer level, correctly replacing violating quotes
with FSTRING_END token, and appending STATEMENT_BREAK tokens to illegal line breaks inside expressions,
depending on the lexer's state. Now, thanks to a general f-string grammar in PEP 701, most of this
bookkeeping could be moved from the lexer to the CompatibilityVisitor (to still be reported
for previous versions of the language and by the compatibility inspection).
Previously forbidden backslashes and line comments are now also detected by the CompatibilityVisitor
instead of the version-agnostic FStringAnnotator.
One side effect of the new grammar is that parser recovery in pre-3.12 version of Python became
slightly worse. For instance, something like `f'{foo'` used to be recognized as an f-string
with an incomplete fragment lacking its closing brace. Now, it's parsed as an incomplete
f-string, lacking its own closing quote, containing an incomplete string literal inside
an incomplete fragment. What's more, parsing of this fragment's expression doesn't terminate
until the end of a file, because STATEMENT_BREAK is never produced by PythonIndentingProcessor
while it's inside an f-string fragment, and every quote is considered a new string literal.
Examples of parsing tests affected by this are:
PythonParsingTest.testFStringFragmentIncompleteTypeConversionBeforeClosingQuote
PythonParsingTest.testFStringIncompleteFragmentWithTypeConversion
PythonParsingTest.testFStringIncompleteFragment
I also had to simplify some scenarios from PythonHighlightingTest, removing snippets
with incomplete fragments or moving such examples to the very end of a file.
It's not clear how to handle these situations not overcomplicating the lexer.
(cherry picked from commit 03ba6d7fba1b45a84aa92221e6a452645a765205)
IJ-MR-115763
GitOrigin-RevId: cd36470d9cae353fe3caeb2d3b628d8743b46cbb
Remove pydev warning if old trace function equals to new one.
Add argparse for `docrunner.py`.
Add tests for `doctest` with parameters.
Add debugger tests for `doctest` with parameters.
Merge-request: IJ-MR-111959
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: 608080b3b5db93718f62a3dddd17893fe8118539
Report warning if a fixture is used without being passed to test function parameters or to
`@pytest.mark.usefixtures` decorator.
Co-authored-by: Denis Mashutin <Denis.Mashutin@jetbrains.com>
Merge-request: IJ-MR-108713
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: 28d0711b99ab7ae180f672306dd4ab8a81f1feec
Add PyTestParametrizedContributor that handles renaming the test function parameter and renames the decorator's `@pytest.mark.parametrize` argument
Merge-request: IJ-MR-108848
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: e544298036603462379adcf7a452e65c22e002f6
When a user calls `Previous Entry in Console History` action, move the caret to the end of the first line
IJ-CR-111281
GitOrigin-RevId: a351f264722b74c89692963ead0467250ac01a68
Changes in typeshed:
1) intellij repo: f7bacdc0
2) typeshed: a094aa09c2/stdlib/builtins.pyi (L1207)
Now Self became enumerate[T] instead of Iterator[tuple[int, _T]] and necessary to take __next__ to take tuple[int, _T]
Also, add check for typing.Awaitable[T] in __next__ return type and unbox T in cases like
```
async def asyncgen():
yield 10
[i async for i in asyncgen()]
```
GitOrigin-RevId: 05453fcfcf8a212ff73665a7df8f67ccdc1e4603
This commit removes usages of deprecated `DumbServiceImpl.setDumbMode` and replaces them with modern API.
GitOrigin-RevId: d3fa0e8eec04d7b10a0b98ff46c2f4bb5a8197b9
Use `importlib.metadata` for the new Python versions (>= 3.10).
Ignore `DeprecationWarning` for old versions of Python.
Merge-request: IJ-MR-111445
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: a639ae84016a85d508484e31e48913543d4e51f1
Since disabling turned out to be controversial. Even in the ticket some users were
against this decision claiming that it heavily annotated code bases it might be necessary
to retain all annotations from inherited method signatures. We need to think of a better
solution for controlling this behavior on case-to-case basis.
GitOrigin-RevId: c68763f0cad23de8975085e9bc8a6fd99013de3b
```
ERROR: No matching distribution found for comm>=0.1.3 (from ipywidgets->jupyter)
```
There is no 2.7 in the latest analysis
GitOrigin-RevId: 170b98f048b88a62d2695d375b780ee707e79330
`readableFs` is redundant and unstable. Remove it: we will migrate to ijent anyway.
All validations are in `PathValidator.kt` now. They are used by `ManualPathEntryDialog` and sdk validation.
Lots of thread annotations added to prevent calling validation code from EDT.
In general, this change makes path validation ready for ijent: validation based on nio with slow IO access.
Validation is removed from old, non-target classes
(cherry picked from commit 185b4f7fe8cbd5d7a37dad609c8a4cb8163d6eed)
IJ-MR-112281
GitOrigin-RevId: 12c4a4f3d459d0523ef6694a9e4bb2db7a1582b7
In addition to searching for fixtures as functions in the "conftest.py" file, add also searching in import elements.
Merge-request: IJ-MR-109809
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: fe2832b23db8b5fda461b1e07a129975b2dd57bf
PyDefinitionsSearch.java: replace psi element on original element if it is from pyi and then search for overrides, inheritors etc.
PyiUtil.java: recursively get original element while it is in stub (see the comment) and tests testGoToImplementationNameReExportedThroughAssignmentInPyiStub, testGoToImplementationNameReExportedThroughAssignmentInPyiStubTwice
PyUtil.java: make different methods turnDirIntoInitPy, turnDirIntoInitPyi instead of only turnDirIntoInit to handle cases when the same directory contains __init__.pyi and __init__.py files (PY-54620)
GitOrigin-RevId: 8f0d8a8133548e1a9f52f93b42aa9cae2302e8d7
Namely, test only against the latest version of the library. Check completion
only for a few common submodules of tensorflow. Check resolve for all of them
in one inspection pass, instead of resolving each separately. Generate expected
test data dynamically through module introspection.
GitOrigin-RevId: df5c4c4f765116bc7329454d5cc0b2aa1a6a86b5
1. If `__repr__` is overridden - use `reprlib` or `repr()`
2. If `__str__` is overridden - use `str()`
3. Use `reprlib` or `repr()` otherwise
IJ-CR-110917
GitOrigin-RevId: dff583d556600a8c77024a4d1bd86034f24f9bf9