In case of syntactic ambiguity with previous versions of the grammar, such as
"with (expr)" or "with (expr1, expr2)", PyWithStatement is still parsed as
having its own parentheses, not a parenthesized expression or a tuple as
a single context expression. The latter case, even though syntactically legal,
is still reported by the compatibility inspection in Python <3.9.
These changes also include proper formatter and editing support (e.g. not
inserting backslashes on line breaks inside parentheses), as well as
Complete Current Statement, which now takes possible parentheses into account
while inserting a missing colon.
The changes in the formatter are somewhat ad-hoc, intended to minimize the effect
on other constructs. "With" statement is somewhat special in the sense that it's
the first compound statement (having a statement list) with its own list-like
part in parentheses.
Existing tests on with statement processing were expanded and uniformly named.
Co-authored-by: Semyon Proshev <semyon.proshev@jetbrains.com>
GitOrigin-RevId: 15c33e97f177e81b5ed23891063555df016feb05
The problem was most likely fixed as part of PY-36478 in
f2b45554d16ff87d946950591f0e92fedcfdfaf0
GitOrigin-RevId: a9001840052ca0d23ffeb98c2bee359183c6289f
The todo index employs user-configurable patterns that can significantly slow down indexing process. To solve this problem the todo index is now excluded from the project indexing procedure while still reusing index storage. Later we can switch to gist API for that.
GitOrigin-RevId: fe4020a03bd1fd4a9a109ffc8782ca1c23d42735
This way we further reduce the number of irrelevant completion items suggested
effectively in every expression context, e.g. not suggesting "parser" and
"calendar" modules for the "ar" prefix, only something like "argparse" or
"array". The same applies to the completion of attributes with unresolved
qualifiers.
GitOrigin-RevId: 7a58053c4744c3d0066c379a4f190ffd09bfabd1
By giving them an explicit priority lower than the default. Unfortunately,
it doesn't remedy the problem with short module names, such as "re" or "sys",
always being on top when they completely match the entered prefix.
At the moment this behavior is hard-coded in the platform and cannot be
altered by language plugins. It's not caused by the "liftShorter" classifier.
Also, explicitly prioritizing various lookup elements has become quite messy
and scattered across PyCompletionWeigher and specific contributors. It begs
to be refactored, but will be addressed separately.
GitOrigin-RevId: d6f6ad06f5d68f3de7b866b8240a95b785604649
By running the completion contributor for non-imported modules after everything
else, including the LegacyCompletionContributor offering names present in
the scope, and filtering out duplicate variants.
GitOrigin-RevId: 98982b2c33d1fc11d70b144de556a6825bd3febc
It also fixes EA-425763 about using incorrect parent and anchor elements
to insert a function generated from a method of a nested class.
GitOrigin-RevId: f9b9da303396eb78c2c12b2750065dbdc0ba70ed
We use `--debug` to make sure runner doesn't break.
But since 7.0 it requires additional argument.
GitOrigin-RevId: b5c03f3783a4c09e9866058d50cad807c6953373
Assuming that there might be some synchronization point in fixture methods
that ensures that indexes are ready for code insight actions.
GitOrigin-RevId: 556d052edf76e85d14c35ded4fd582ed6293dbec
`SingleEntryFileBasedIndexExtension` with "nulls" reduces the size of the todo index data for IC project from 4+MB to 180+KB.
GitOrigin-RevId: cfe1947600450fec442d3cb4b50c175398f79975
Tests for explicitly parametrized generic class instances
(cherry picked from commit 134748c973843ce8effbf516bbed9be3efbdf8f1)
IJ-CR-18208
GitOrigin-RevId: 0e6c9086964a93cd23385a95d502110c5cc758e4
We now represent strings using quotes (because this is how repr works in Python). We also don't want to hardcode order of "expected" and "actual"
GitOrigin-RevId: 1c70b3839fa7725db21896d09d839884c500deb7
Dict items should not be expected to have specific order before Python 3.6 (when order-preserving behavior is added as an implementation detail).
GitOrigin-RevId: 033bfdfa9a27b8a35d76e217075f0b9989af1b2f
Supersedes the "Asterisk closure can be collapsed to plus closure" inspection which was only available in PhpStorm
GitOrigin-RevId: a63c6fce88b3700cc521e8b113069a4b2b50a3e4
Added test for this case
(cherry picked from commit 4019a7deb4b577eb6a42200fa4758a2624e26896)
IJ-CR-16991
GitOrigin-RevId: 86861f573d66abd3d9100de1ebed59513838a24d
Otherwise PyTargetExpressionImpl.getType can not infer type for a qualifier defined inside function body.
GitOrigin-RevId: 75345218653fc8507cc31498fda7b8f07d4c02c6