Skip to content

Add a "Save Without Formatting" command #38695

Closed
@coreh

Description

Would be really nice to add a command that allows bypassing automatic formatting while saving a file, if the user has it enabled.

Specifically, saving using this command would skip the changes caused by enabling either:

"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.formatOnSave": true,

(Not sure if there are more transformations that can be triggered on save)

It probably doesn't need to be bound to any specific keyboard shortcut by default.

Reasoning: Very often I find myself having to patch a third-party package, by either cloning their repo and submitting a PR, or by directly editing the package inside node_modules (Using the patch-package tool), and it will usually produce a large/ugly diff because of the several changes caused by automatic formatting. I can surely disable the setting temporarily (or add a .vscode folder inside node_modules disabling the options), but neither is an ideal solution.

Thanks in advance!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityverification-neededVerification of issue is requestedverifiedVerification succeededworkbench-editorsManaging of editor widgets in workbench window

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions