-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Sort Imports not working #22147
Comments
We used to do this. Most people don't use
We will be removing this command entirely as there are more import sorting solutions now available as extensions. See, |
Out of curiousity what other import sorting solutions are available? If that is so, then including |
|
Use this extension: https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff |
@karthiknadig when is the removal of the command scheduled? It's a bit confusing, especially for people just starting with Python and Visual Studio Code. |
This is scheduled for the october milestone. |
Could someone please provide the steps to re-enable the isort functionality? Even with isort installed, the previous menu item is missing. |
@01000101 That command will be removed. Use this instead: |
Related on Stack Overflow: VS Code stopped resolving all python imports and Sort Imports option not available |
Verification Steps:
|
Type: Bug
Behaviour
Expected vs. Actual
The "Sort Imports" command in the context menu and the related command in the palette "Python Refactor: Sort Imports" should sort Python imports. However, these commands have no effect if the
ms-python.isort
extension is not installed as well.The output panel contains the following message:
Sort Imports: Please install and enable
ms-python.isortextension to use this feature.
From a usability perspective, this behavior is not ideal. IMO, there are three solutions:
Steps to reproduce:
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.16.0
VS Code version: Code 1.82.3 (fdb98833154679dbaa7af67a5a29fe19e55c2b73, 2023-10-02T11:09:17.749Z)
OS version: Darwin arm64 23.0.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
The text was updated successfully, but these errors were encountered: