-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Description
#38695 had introduced the option of save without formatting which is very useful in working on projects which don't already have a formatter enabled and keeps diffs small and relevant to the lines being changed.
Problem:
But I had assumed that "files.insertFinalNewline": true, was an independent feature which can be turned on or off. But I realized when I found the above issue that save without formatting was designed to silently disable other flags as well. This leads to a situation where I have to remember to add a newline manually when saving without formatting. Recently I found a workaround in the form of an extension which does exactly what I want, so I have a working solution (at least until that extension breaks for some future version), but I believe giving user control over what gets disabled as part of save without formatting would help, or at least visibility into what it disables (so that there are no surprises, because for sometime I suspected it was because of the vscode-neovim plugin).
Other considerations:
- I didn't want to disable formatting altogether for the project because for new files in the same project I would like to save (with formatting).
- Or maybe
format filecan become a separate option that users can explicitly call (similar to trim trailing whitespaces). That will also allow me flexibility to opt-in to formatting (as a special feature) rather than it being done implicitly together with newline and trailing whitespace.