mirror of https://github.com/astral-sh/ruff
In `for x in <CURSOR>` statements it's only valid to provide expressions that eventually evaluate to an iterable. While it's extremely difficult to know if something can evaulate to an iterable in a general case, there are some suggestions we know can never lead to an iterable. Most keywords are such and hence we remove them here. ## Summary This suppresses statement-keywords from auto-complete suggestions in `for x in <CURSOR>` statements where we know they can never be valid, as whatever is typed has to (at some point) evaluate to an iterable. It handles the core issue from https://github.com/astral-sh/ty/issues/1774 but there's a lot of related cases that probably has to be handled piece-wise. ## Test Plan New tests and verifying in the playground. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||