facebook / facebook/pyrefly

VSCode Auto-import inserts imports above `from __future__ import annotations`

Open
#3,382 6 comments 1 reaction 1 assignee Claimed by @asukaminato0721 View on GitHub
help wanted language-server
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### 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.

Image

Image

### Sandbox Link

_No response_

### (Only applicable for extension issues) IDE Information

VSCode: Version: 1.119.1
meta.pyrefly@1.0.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.