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.

imports sorted on save even when formatOnSave = false

See original GitHub issue

Environment data

  • VS Code version: 1.52.1
  • Extension version: v2020.12.424452561
  • OS and version: macOS Catalina

Expected behaviour

My settings include

"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
        "source.organizeImports": false
}

When I save a file with these settings, I don’t think any formatting should occur, and this includes automatic sorting of imports. Often one works on a repo that either does not care about sorting of imports or has an idiosyncratic sorting standard (not compatible with isort). It is therefore undesirable to force the user to always sort imports according to the standard of a particular 3rd party tool with no ability to turn off this behavior.

Actual behaviour

No matter what values I try in settings, the vscode python extensions sorts imports upon save. This is obviously incorrect behavior, as I explicitly have set format-on-save to be false (as well as organizeImports = false).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, Jan 4, 2021

[ @besnyder I edited your ✉️ ⬆️ to come off as more 😃 and less 😠 ]

0reactions
karthiknadigcommented, Oct 7, 2021

Closing this. Please use the latest version of the extension. If this continues to occur please fine a new bug and provide the logs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Easily sort imports and remove unused declarations on each ...
Easily sort imports and remove unused declarations on each save in VS Code. #vscode #eslint #prettier #javascript. All this time I was using ......
Read more >
Disable python import sorting in VSCode - Stack Overflow
I am trying to disable vscode from formatting my python imports when I save my file. I have some code that must run...
Read more >
User and Workspace Settings - Visual Studio Code
formatOnSave ": false, // Controls if format on save formats the whole file or only modifications. Only applies when `editor.formatOnSave` is enabled.
Read more >
I made a vscode extension to sort your dart imports : r/FlutterDev
Hello! I made an extension for vscode that sorts your dart imports. Here is the link to the repo. The extension is called...
Read more >
Python & VS Code: make Black and organize imports work ...
But this “flapping” behaviour when I save has been bugging me for weeks: (It's even more annoying when you're part way down a...
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