Skip to content

fix Insert import with alias creates invalid import #2495#4106

Closed
asukaminato0721 wants to merge 2 commits into
facebook:mainfrom
asukaminato0721:2495
Closed

fix Insert import with alias creates invalid import #2495#4106
asukaminato0721 wants to merge 2 commits into
facebook:mainfrom
asukaminato0721:2495

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

Summary

Fixes #2495

Auto-import resolution now preserves the original exported name and generates from model import MyModel as MyModelAlias.

Unknown-name quick fixes receive the same alias-aware behavior.

Test Plan

add test

@github-actions

This comment has been minimized.

Comment thread pyrefly/lib/test/lsp/completion.rs Outdated
@github-actions

This comment has been minimized.

Comment thread pyrefly/lib/test/lsp/completion.rs Outdated
@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. ✅

@meta-codesync

meta-codesync Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@kinto0 has imported this pull request. If you are a Meta employee, you can view this in D111934167.

@yangdanny97 yangdanny97 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.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 836b8d0 Jul 14, 2026
@meta-codesync meta-codesync Bot added the Merged label Jul 14, 2026
@meta-codesync

meta-codesync Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@kinto0 merged this pull request in 836b8d0.

@asukaminato0721 asukaminato0721 deleted the 2495 branch July 15, 2026 02:17
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.

Insert import with alias creates invalid import

3 participants