Skip to content

fix Completion returns no items inside a function body when the typed text is a keyword (as, in, is, ...) #5529 - #5617

Open
asukaminato0721 wants to merge 2 commits into
meta:mainfrom
asukaminato0721:5529
Open

asukaminato0721 wants to merge 2 commits into
meta:mainfrom
asukaminato0721:5529

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

Fixes #5529

Completion now returns suggestions after as, in, and is at statement starts.

  • I am a human, and I fully understand the code I am submitting.

Test Plan

add test

@meta-codesync

meta-codesync Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D131272332. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

This comment has been minimized.

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From an initial AI-assisted review, I think the overall structure here is good but we want a couple of fixes before we merge:

  1. P2 — Preserve the typed-prefix completion-list contract. The new fallback supplies a nonempty list marked complete even though later typing enables deferred auto-import candidates absent from that list. Recover/reuse the normal prefix behavior, including isIncomplete when more typing requires a new request.
  2. P2 — Cover nested inline-suite statement starts. The boundary condition accepts a newline or semicolon but misses a nested inline suite following a compound-statement colon. This is incomplete intended scope, not a newly introduced regression. Do not simply accept every colon: dictionaries, slices, and annotations also contain colons.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

This branch has not been deployed

No deployments
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.

Completion returns no items inside a function body when the typed text is a keyword (as, in, is, ...)

2 participants