VSCode Auto-import inserts imports above `from __future__ import annotations`
Describe the Bug
VS Code auto-import Quick Fix inserts imports above from __future__ import annotations, causing invalid Python syntax. __future__ imports must remain at the top of the file, but Pyrefly’s code action places new imports before them.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
VSCode: Version: 1.119.1 [email protected]
https://github.com/facebook/pyrefly/pull/1580
@yangdanny97 Hi, Can i take this?
I'd like to work on this issue. The fix should ensure auto-imports are inserted after future imports rather than before them.
There's an in-progress PR for this issue, I'll see if I can get this merged soon, and if it cannot be merged for some reason I'll re-assign it.
#claim
@asukaminato0721 you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉
This issue has someone assigned, but has not had recent activity for more than 2 weeks.
If you are still working on this issue, please add a comment so everyone knows. Otherwise, please comment #unclaim to unassign yourself.
Thank you for your contributions!
https://github.com/meta/pyrefly/pull/5443