Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support completion based on type annotations of calls #14185

Merged
merged 5 commits into from Oct 1, 2023

Conversation

krassowski
Copy link
Member

This fixes #14184 when %config IPCompleter.use_jedi=False is used:

image

@Carreau Carreau merged commit b7c9c36 into ipython:main Oct 1, 2023
21 checks passed
@Carreau Carreau added this to the 8.17 milestone Oct 1, 2023
Carreau added a commit that referenced this pull request Feb 27, 2024
Addresses the issue of non-jedi completer not picking type annotations
for `__init__()` brought up in
#14336


![completion_works](https://github.com/ipython/ipython/assets/5832902/73d44e26-123e-4691-87a6-e4d92c6f5061)

Follow-up to #14185

Supports:
- [x] `Annotated`
- [x] `AnyStr`
- [x] `Literal`
- [x] `LiteralString`
- [x] `NewType`
- [x] `Optional`
- [x] `Protocol`
- [x] `Self`
- [x] `TypeAliasType` (`type` keyword in Python 3.12+)
- [x] `TypedDict`
- [x] `TypeGuard`
- [x] `Union`

Limitations:
- no type narrowing: ambiguous return types from `Union`, and `Optional`
will always return all possible values
- generics (`TypeVar` and `Generic`) are not support (except for
`AnyStr`)
- old style `TypeAlias` (deprecated in Python 3.12) is not supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab complete for class __call__ not working
3 participants