Change:
<!-- Do Not Delete This! featurerequesttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --<!-- Describe the feature you'd like. --It would be nice to have either a toggle or a third option (or even just have this as default behavior for "modifications" mode of format on save) that tells VS Code to format the entire file on save if version control is unavailable. I find it annoying to have to configure every new repository workspace I make to use modifications instead of my User setting of file. Perhaps there is already an extension for this that I've not found yet. Either way, code for thought.
Actually, I've had a look into the code-base and it looks fairly easy to do, so I'll add the third option approach myself and create a PR. Up to you legends what you do with it tho

Discussion:
} const editorOrModel = findEditor(textEditorModel, this.codeEditorService) || textEditorModel; <del> const mode = this.configurationService.getValue<'file' | 'modifications'>('editor.formatOnSaveMode', overrides); if (mode === 'modifications') { // format modifications </del> <ins> const mode = this.configurationService.getValue<'file' | 'modifications' | 'modificationsIfAvailable'>('editor.formatOnSaveMode', overrides); // keeping things DRY :) const formatWholeFile = async () => { await this.instantiationService.invokeFunction(formatDocumentWithSelectedProvider, editorOrModel, FormattingMode.Silent, nestedProgress, token); } if (mode === 'modifications' || mode === 'modificationsIfAvailable') { // try formatting modifications </ins> const ranges = await this.instantiationService.invokeFunction(getModifiedRanges, isCodeEditor(editorOrModel) ? editorOrModel.getModel() : editorOrModel); if (ranges) { <ins> // version control reports changes </ins> await this.instantiationService.invokeFunction(formatDocumentRangesWithSelectedProvider, editorOrModel, ranges, FormattingMode.Silent, nestedProgress, token); <ins> } else if (ranges === null) { // version control not found formatWholeFile(); </ins> } } else { <del> // format the whole file await this.instantiationService.invokeFunction(formatDocumentWithSelectedProvider, editorOrModel, FormattingMode.Silent, nestedProgress, token); </del> <ins> formatWholeFile(); </ins> } } }

'default': 'file', 'enum': [ 'file', <del> 'modifications' </del> <ins> 'modifications', 'modificationsIfAvailable' </ins> ], 'enumDescriptions': [ nls.localize({ key: 'everything', comment: ['This is the description of an option'] }, "Format the whole file."), nls.localize({ key: 'modification', comment: ['This is the description of an option'] }, "Format modifications (requires source control)."), <ins> nls.localize({ key: 'modificationIfAvailable', comment: ['This is the description of an option'] }, "Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted."), </ins> ], 'markdownDescription': nls.localize('formatOnSaveMode', "Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."), 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE,

}); <del> export async function getModifiedRanges(accessor: ServicesAccessor, modified: ITextModel): Promise<Range[] | undefined> { </del> <ins> export async function getModifiedRanges(accessor: ServicesAccessor, modified: ITextModel): Promise<Range[] | undefined | null> { </ins> const scmService = accessor.get(ISCMService); const workerService = accessor.get(IEditorWorkerService); const modelService = accessor.get(ITextModelService); const original = await getOriginalResource(scmService, modified.uri); if (!original) { <del> return undefined; </del> <ins> return null; // let undefined signify no changes, null represents no source control (there's probably a better way, but I can't think of one rn) </ins> } const ranges: Range[] = [];