[ty] provide import completion when in from <name> <name> statement by MatthewMckee4 · Pull Request #21291 · astral-sh/ruff (original) (raw)
MatthewMckee4 changed the title
[ty] Don't provide completions when in 'from i' statement [ty] Don't provide completions when in 'from ' statement
MatthewMckee4 changed the title
[ty] Don't provide completions when in 'from ' statement [ty] Don't provide completions when in from <name> <name> statement
MatthewMckee4 changed the title
[ty] Don't provide completions when in [ty] Don't from <name> <name> statementimport completion when in from <name> <name> statement
MatthewMckee4 changed the title
[ty] Don't [ty] provide import completion when in from <name> <name> statementimport completion when in from <name> <name> statement
This works principally by copying from_import_tokens and tweaking
it a bit to look for from module <CURSOR> token sequences. We actually
wind up needing to be a little more careful here to parse <module>
correctly to avoid something like from os.i<CURSOR> from being treated
as if the i is the beginning of the import keyword.
Fixes astral-sh/ty#1494
dcreager added a commit that referenced this pull request
- origin/main: (38 commits)
[ty] Make implicit submodule imports only occur in global scope (#21370)
[ty] introduce local variables for
fromimports of submodules in__init__.py(i)(#21173) [ruff] Ignorestr()when not used for simple conversion (RUF065) (#21330) [ty] implementtyping.NewTypeby addingType::NewTypeInstance[ty] supress inlay hints for+1and-1(#21368) [ty] Use type context for inference of generic constructors (#20933) [ty] Improve generic call expression inference (#21210) [ty] supress some trivial expr inlay hints (#21367) [configuration] Fix unclear error messages for line-length values exceedingu16::MAX(#21329) [ty] Fix incorrect inference ofenum.auto()for enums with non-intmixins, and imprecise inference ofenum.auto()for single-member enums (#20541) [refurb] Detect empty f-strings (FURB105) (#21348) [ty] provideimportcompletion when infrom <name> <name>statement (#21291) [ty] elide redundant inlay hints for function args (#21365) Fix syntax error false positive on alternativematchpatterns (#21362) Add a new "Opening a PR" section to the contribution guide (#21298) [flake8-simplify] Fix SIM222 false positive fortuple(generator) or None(SIM222) (#21187) Rebuild ruff binary instead of sharing it across jobs (#21361) [ty] Fix--excludeandsrc.excludemerging (#21341) [ty] Add support for properties that returnSelf(#21335) Add upstream linter URL toruff linter --output-format=json(#21316) ...
BurntSushi added a commit that referenced this pull request
Ideally this would have been added as part of #21291, but I forgot.
BurntSushi added a commit that referenced this pull request
Ideally this would have been added as part of #21291, but I forgot.
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 }})