Skip to content

Code completion #86

@MichaReiser

Description

@MichaReiser

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 on Object.
  • Identify a from module import <typing> context and return items from module.
  • Identify import <typing> and import module.<typing> contexts and return available modules.
  • [BETA] Identify function call sites and offer keyword based completions (if available).
  • [BETA] Add type signatures to completion suggestions
  • [BETA] For scope based completions, offer unimported symbols as suggestions. (And upon selection, add the required import.)
  • Offer string literals based on type context.
  • Offer string literals based on TypedDict context.
  • Offer contextual language keywords in completions (e.g., def and match).
  • Offer completions for cases in match statements.

Sub-issues

Metadata

Metadata

Assignees

Labels

serverRelated to the LSP server

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions