-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Organize Imports Action Does Not Add __future__ Import #341
Comments
I will also note that removing Obviously I could bind a separate hot key to auto fix but I'd ideally like organize imports to behave in parity with |
That's a good point. We should probably include |
Fix is in the LSP: astral-sh/ruff-lsp#321 |
## Summary When running the "Organize Imports" action, we should _also_ add any required imports, just as isort would. Closes astral-sh/ruff-vscode#341.
## Summary When running the "Organize Imports" action, we should _also_ add any required imports, just as isort would. Closes astral-sh/ruff-vscode#341.
My
pyproject.toml
hasrequired-imports = ["from __future__ import annotations"]
but then the VS Code Organize Imports action does not automatically add future imports, and I can't seem to find a way or figure out how to make the formatting command output anything different fromI'd expect the organize imports action to add the
__future__
import because, from how I can recently remember/recall, that's what the isort VS Code extension does when it's used for the organize imports action.--- Context ---
pyproject.toml
:VS Code Settings JSON
I also tried adding
to
"ruff.lint.args"
but still had the same issue.The text was updated successfully, but these errors were encountered: