organizeImports causes "WARN Aborted codeActionsOnSave after 750ms"
See original GitHub issueI’m looking for advice on how to debug this myself. My current thought is that the underlying system(s) that organize imports for Python are taking a long time, which may be an environment issue with my machine. I’m not sure where to start looking.
Environment data
Version: 1.33.1 Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8 Date: 2019-04-11T08:20:22.771Z Electron: 3.1.6 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Linux x64 4.18.0-18-generic Python version (& distribution if applicable, e.g. Anaconda): 3.6 installed with Bionic. Type of virtual environment used (N/A | venv | virtualenv | conda | …): NA Relevant/affected Python packages and their versions: 3.6 maybe others
Expected behaviour
When organizeImports
is true it should organize imports on save with little delay.
Actual behaviour
Imports are organized, but there’s almost a 1 second blank pause for the file to be saved (and for the little “unsaved changes” dot to disappear from the file header.
Steps to reproduce:
- Have this set in settings.json:
{
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
-
Put together a short Python file with some stdlib imports that are out of order.
-
Save the file.
Logs
<Empty> WARN Aborted codeActionsOnSave after 750ms log.ts:167
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
https://github.com/microsoft/vscode-python/issues/5642
Please try the isort extension, it uses Language Server protocol to handle import organization, and should perform better as
isort
is not run for scratch each time.