question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

organizeImports causes "WARN Aborted codeActionsOnSave after 750ms"

See original GitHub issue

I’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:

  1. Have this set in settings.json:
{
  "[python]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    }
  }
  1. Put together a short Python file with some stdlib imports that are out of order.

  2. Save the file.

Logs

<Empty>
 WARN Aborted codeActionsOnSave after 750ms   log.ts:167

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

0reactions
karthiknadigcommented, Nov 12, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update isort to latest version · Issue #5642 - GitHub
organizeImports causes "WARN Aborted codeActionsOnSave after 750ms" #5534. Closed. @ablakey ablakey mentioned this issue on May 16, 2019.
Read more >
Microsoft/vscode-go - Gitter
organizeImports ": true }, But no OrganizeImportsProvider... (I get WARN Aborted codeActionsOnSave after 750ms on save - but I don't understand which code...
Read more >
What is the difference between formatOnSave and ...
codeActionsOnSave setting lets you configure a set of Code Actions that are run when a file is saved. For example, for JavaScript, ...
Read more >
Wallaby.js Visual Studio Code Extension - Netlify
Reload Visual Studio Code after enabling the language server ... Warning: This extension is incompatible with other CMake extensions like CMake Tools ....
Read more >
April 2018 (version 1.23) - Visual Studio Code
The following settings enable organize imports on save for TypeScript files only: "[typescript]": { "editor.codeActionsOnSave": { "source.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found