Code completion (original) (raw)
Implement auto-completion support
Plan
At time of writing (2025-05-02), the plan below represents my best effort guess as to how we want to proceed here. The first few items are meant to correspond to lower hanging fruit.
One thing that is not really captured by the plan here, but I think may require some effort, is figuring out how best to identify what the current context is. I suspect there may be an easy way to start for specific cases, but the extent to which that works more generally is not totally clear to me yet.
- Add built-ins to code completions.
- Return all names from scopes in current module. ref
- Identify current scope and return names from just that scope.
- Identify a
Object.<typing>context and return attributes onObject. - Identify a
from module import <typing>context and return items frommodule. - Identify
import <typing>andimport module.<typing>contexts and return available modules. - keyword argument completion #1550
- [BETA] Add type signatures to completion suggestions
- [BETA] For scope based completions, offer unimported symbols as suggestions. (And upon selection, add the required import.)
- completions: Offer string literals based on type context. #3326
- completions: Offer string literals based on TypedDict context. #3327
- Offer contextual language keywords in completions (e.g., def and match). #3328
- Offer completions for cases in match statements. #3329