如何找到 vscode 到底使用的是哪个 isort

zyx*_*xue 6 python visual-studio-code isort

https://code.visualstudio.com/docs/python/editing#_sort-imports

我已经设定

    "[python]": {
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        }
    },
Run Code Online (Sandbox Code Playgroud)

在 vscode 中,看起来选择了正确的 python 解释器,但它没有按预期生成排序的导入。我怀疑 vscode 使用了错误的 isort,我怎样才能找出 vscode 到底使用的是哪个 isort?

Bre*_*non 7

VS Code 附带了isort它自己使用的副本,当前版本为 5.10.1。您可以查看 Python 通道中的“输出”面板来了解扩展的执行情况isort

但请注意,Python 扩展正在从嵌入式 isort 支持转向专用isort 扩展

  • 谢谢我在 `~/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/sortImports.py` 和 `~/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles 中找到了它/lib/python/isort/` (2认同)