-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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" does nothing #13948
Comments
We don't handle the organize imports command, the core extension does. I'll move this issue there as it's the one running |
Hello @Lexicality, thank you for reaching out. You don't need to install Thanks! |
Apologies, I'm not sure how to install the insiders version, is there a guide somewhere? It only offers me |
Sorry about that! To opt-in this program, open the command palette ( Another way to do it is to open the settings page ( A download of the Insiders version of the extension will then start (you can follow its progress in the status bar), and we will prompt you to reload VS Code once it finishes. |
Hmm, that works but it produces a different output than the local version of isort which causes the lint to break |
I just tried using my local isort using the workspace settings and that didn't seem to work at all
|
What version of isort do you use locally? You shouldn't need to install it yourself since we ship it with the extension. |
Apologies for the delay in getting back to you, I was on holiday. |
No worries! The issue you're encountering sounds very similar to #13063, which is a duplicate of #7042. Can you try the workaround mentioned in #7042 by specifying the full path to isort to the setting:
|
I get
if I do that, which is similar to what happens if I run it in terminal:
however it correctly formats the file when I run it in terminal. I found #12949 related to this, but I'm not sure why it works in bash while it doesn't work in vscode |
We expect vscode-python/src/client/providers/importSortProvider.ts Lines 129 to 135 in 6489528
Have you tried downgrading setuptools like suggested in #12949? |
Ah, I get you. Yes, running Sorry for all the confusion, I'm not really a python person. Would it be possible to improve the error messages caused when Thanks for helping! |
No problem, glad we're getting it sorted out, and thank you for trying all the workarounds!
I opened a feature request on your behalf: #14066, feel free to leave a comment there if you want to provide more details. You can also help us prioritize it by upvoting it 🙂 Going to close this issue and mark it as resolved, but if you encounter any problem later down the road let us know in the comments and we can reopen it. Thank you! |
Environment data
Expected behaviour
Running "Organise Imports" from the command palette invokes
isort
and fixes import orderActual behaviour
No change to file, no output
Logs
Pylance:
Microsoft (where it works):
Code Snippet / Additional information
isort
exists, is installed in the virtualenv and is configured viapyproject.toml
.The text was updated successfully, but these errors were encountered: