fix Pyrefly inserted typing import in sub-optimal location #1490
fix #1490
Adjusted so insert_import_edit* returns an ImportEdit with both the actual edit and a stable display string, and added logic to append new symbols to an existing matching from ... import ... statement instead of duplicating the import line. The helper now shares this richer info with callers so UI text stays human-readable.
Updated LSP code to consume the new struct, ensuring code-action titles and auto-import completion details still show from module import name while the actual edit mutates the existing line in place.
Taught the infer command to handle the new edit type and to skip empty/duplicate insertions when mutating files.
Revised the LSP code-action test to assert the merged-import behavior.
@jvansch1 has imported this pull request. If you are a Meta employee, you can view this in D87254329.
This pull request has been automatically marked as stale because it has not had recent activity for more than 2 weeks.
If you are still working on this this pull request, please add a comment or push new commits to keep it active. Otherwise, please unassign yourself and allow someone else to take over.
Thank you for your contributions!