-
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
Cannot sort imports when both settings editor.formatOnSave and source.organizeImports are being used #5748
Comments
Thanks for reporting the issue. This is the behavior I see, import sys
import os
print ('hello' ) Press import os
import sys
print ('hello' ) Only imports are sorted, but the file is NOT saved. Try saving the file again (maybe a few more times), until ideal code is reached. import os
import sys
print('hello') Settings |
I think we can add "editor.formatOnSave" as a entry under "editor.codeActionsOnSave" |
Helpful comment: microsoft/vscode#83586 (comment) |
This is now supported via the isort extension. |
Issue Type: Bug
The issue described in the title is reproduced with these settings:
Only one or the other will work at a time which is odd because Go has basically the exact same thing in the default settings and it works fine. I have reproduced this with different formatters(
autopep8
andblack
), usingsource.fixAll
, and all sorts of other Python settings. This occurs in both the stable and insiders version of VSCode. It may be thateditor.codeActionsOnSave
just overrideseditor.formatOnSave
but as Go implements this just fine, I'm filing it as an issue with the Python extension. I apologize if I misunderstand the intent of the settings and it is working as intended.Extension version: 2019.4.12954
VS Code version: Code 1.34.0 (a622c65b2c713c890fcf4fbf07cf34049d5fe758, 2019-05-15T21:59:37.030Z)
OS version: Windows_NT x64 10.0.17763
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: