[ty] Add more keywords to scope-based completions by BurntSushi · Pull Request #21383 · astral-sh/ruff (original) (raw)
added 2 commits
Ideally this would have been added as part of #21291, but I forgot.
This should round out the rest of the set. I think I had hesitated doing this before because some of these don't make sense in every context. But I think identifying the correct context for every keyword could be quite difficult. And at the very least, I think offering these at least as a choice---even if they aren't always correct---is better than not doing it at all.
It looks like VS Code does this forcefully. As in, I don't think we can override it. It also seems like a plausibly good idea. But by us doing it too, it makes our completion evaluation framework match real world conditions. (To the extent that "VS Code" and "real world conditions" are the same. Which... they aren't. But it's close, since VS Code is so popular.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})