Skip to content

Fix duplicate module auto-import completions#4112

Open
aodihis wants to merge 1 commit into
facebook:mainfrom
aodihis:feature/4109
Open

Fix duplicate module auto-import completions#4112
aodihis wants to merge 1 commit into
facebook:mainfrom
aodihis:feature/4109

Conversation

@aodihis

@aodihis aodihis commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Ensure modules imported with regular imopr statements, such as import json, are treated as local completion candidates to avoid double import.

Fixes #4109

Test Plan

Added regression test for duplicate module auto-import completions.

Regular unaliased imports were omitted from local completion candidates, so accepting a completion could insert the same import again. Treat module import bindings as local candidates while excluding synthesized star-import bindings, preventing redundant import edits.
@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. ✅

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.

completions auto-import after import exists

1 participant