Change:
Filing this issue here to keep in mind and planned for the current iteration.
good call - custom editors do not get saved if they are closed <1s after an edit, so I'll just revert that change. Notebooks do get saved tho, and we have reduced to only a simple provider now, so it's probably taken care of through the working copy service. I can keep looking to make sure we're not trying to dispose of it early tho
For notebooks, it looks like an extra reference is held to the working copy while it is dirty, so it isn't disposed until after it is saved and becomes non-dirty. So, this looks safe for notebooks from what I can see, but let me know if there's still something else I should be looking at.
yes, that piece is critical and should be sufficient from a working copy perspective. Working copies are meant to be somewhat independent from the editors they are edited in. For example, you can change working copies and save them all without any opened editor. We do this for example in text files to support workspace edits over many files, such as search/replace. For notebook working copies, the key question is whether there is anything setup/disposed during the lifecycle of a notebook editor that is required for the save to function? In other words, is there any kind of disposal happening when a notebook editor closes that is required to implement the methods that the working copy needs for saving? Essentially, does method work (cc
oh, I forgot one other case: it is possible for the save operation to fail. In that case, we force reopen the file (at least as far as I can remember). So the additional test to make is whether this works: auto save is on notebook is changed and quickly closed save fails (something we probably can best test running out of sources, for example throwing in  for certain paths) does the notebook reopen? how does the user deal with the error now? Implementation for text files is here: Edit: just tested this and it seems the notebook is not immediately reopened, though you get an error notification.
I played around with this myself and I'm planning to revert because: after the save fails, the file no longer shows dirty at all - there is no error state for the notebook editor, so it always claims that it is just about to save. That makes it hard to understand that there are unsaved changes.

Discussion:
import { IWorkingCopyIdentifier } from 'vs/workbench/services/workingCopy/common/workingCopy'; import { NotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookProvider'; import { NotebookPerfMarks } from 'vs/workbench/contrib/notebook/common/notebookPerformance'; <del> import { AutoSaveMode, IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; </del> <ins> import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; </ins> import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { localize } from 'vs/nls'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService';

return await this._editorModelReference.object.saveAs(target); } <del> override isSaving(): boolean { if (this.isDirty() && !this.hasCapability(EditorInputCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) { return true; // will be saved soon } return super.isSaving(); } </del> private async _suggestName(provider: NotebookProviderInfo, suggestedFilename: string) { // guess file extensions const firstSelector = provider.selectors[0];