'How to find which isort is vscode exactly using
https://code.visualstudio.com/docs/python/editing#_sort-imports
I have set
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
in vscode, it looks the right python interpreter is chosen, but it doesn't produce sorted imports as expected. I suspect a wrong isort is being used by vscode, how could I find out which isort is vscode exactly using?
Solution 1:[1]
VS Code ships with its own copy of isort that it uses which is currently isort 4.3.21. You can look in the Output panel in the Python channel to see how the extension is executing isort.
Solution 2:[2]
To further answer your question.
- Open the output console ctrl-shift-u
In the toolbar at the top of the output panel there is a dropdown list of logs/outputs that you can select.
- Select Python.
- Save a python file. You will see the commands that run, both formatting and runOnSave which are configured in the vscode settings file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brett Cannon |
| Solution 2 | julie |
