-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "Save Without Formatting" command #38695
Comments
I have a branch pretty close for this, but could use some guidance before I make it a PR. My change uses the existing
|
I definitely think this should be built-in to VS Code. Until then, here's a great workaround: https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.save-without-format#overview |
There is now a new command "Save without Formatting" with the keybinding |
Verify: see #38695 (comment) |
Thanks! 🎉🎊🍕🎈 Are there extensions with participants unrelated to code formatting in common use? If so "Save without Transforms" or "Save Verbatim" might also make sense. Otherwise, "Save without Formatting" sounds good. |
@coreh yeah "Save without Formatting" would even mean that any extensions cannot participate even if not doing any formatting. But my rationale was to cover the 99% case of why one would actually use that action in the first place and that is probably to prevent any kind of format to happen. |
Maybe "Save without Extensions". This will disable all kind of code actions that run on save and that's actually a thing. |
I am not convinced. People might confuse this to "save the file without a file extension". I am not sure there is any use case for using this command other than preventing any formatting from happening, so I would stick with the name or something similar in that direction. |
@bpasero I tried to save a file without formatting following your suggestion: "Cmd+K S", but instead of saving without formatting, VSCode just brought up the menu for key bindings. (VSCode can be so confusing at times. I used to happily use |
@vivaldus looks like the keybind changed... Remember you can usually (if not always) search within Visual Studio Code. Yay for VS Code being such a useful tool. |
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:
(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 thepatch-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 insidenode_modules
disabling the options), but neither is an ideal solution.Thanks in advance!
The text was updated successfully, but these errors were encountered: