microsoft / vscode-isort

Import sorting for python using the isort library.
https://marketplace.visualstudio.com/items?itemName=ms-python.isort
MIT License
86 stars 20 forks source link

Saving empty .py file in multi root workspace crashes isort. #362

Open rob-steele-active opened 8 months ago

rob-steele-active commented 8 months ago

If I open a multi root workspace and save a file it usually works fine.

If I happen to save an empty file VSCode hangs and displays getting code actions from 'isort'. There are a few things that need to happen for this to break it seems.

  1. The file has to be empty. Any python code or comments will prevent this bug from occurring.
  2. Must be in a multi root workspace.
  3. Must save the empty file.
image

After this no import organization will work until VSCode is restarted.

Granted this is not going to be a common issue. But I thought it was worth bringing attention to.

https://github.com/rob-steele-active/isort-bug-repro

karthiknadig commented 8 months ago

Thanks for the repro project. I will investigate what is going on with this.