Skip to content

Applying code action 'Sort imports' hangs indefinitely #13312

@soapergem

Description

@soapergem

Environment data

  • VS Code version: 1.47.3
  • Extension version (available under the Extensions sidebar): v2020.7.96456
  • OS and version: Ubuntu 20.04
  • Python version: 3.8.3 (installed by pyenv)
  • Type of virtual environment used: pyenv-virtualenv
  • Relevant/affected Python packages and their versions: XXX
  • Relevant/affected Python-related VS Code extensions and their versions: XXX
  • Value of the python.languageServer setting: doesn't seem to matter; I have tried Jedi, Microsoft, Pylance, and None
  • isort version: 4.3.21

Expected behaviour

When I hit save on a Python file, I expect it to quickly/automatically sort my imports

Actual behaviour

It pops up a box much like this one:

Saving 'main.py': Applying code action 'Sort imports'.

And that box never goes away. It hangs indefinitely. Obviously it never actually sorts my imports either, nor does it proceed to linting / auto-formatting. It just gets stuck.

Steps to reproduce:

  1. pip install black pylint isort autoflake
  2. Copy my settings.json file
  3. Save a Python file

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

> ~/.pyenv/versions/myproject/bin/python ~/.vscode/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.7.96456/pythonFiles/sortImports.py - --diff
cwd: ~/src/myproject/home
> ~/.pyenv/versions/myproject/bin/python ~/.vscode/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.7.96456/pythonFiles/sortImports.py - --diff
cwd: ~/src/myproject/home


Metadata

Metadata

Assignees

Labels

area-formattingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions