Don't prompt for save when JSON column untitled file is closed (version 2) (#17327)

* Stops flagging untitled editors with pre-loaded content as dirty

* Code changes address broken unit tests.

* Completes original comment

* Defines new non dirty text editor model

* Revert "Completes original comment"

This reverts commit 6d0e90bb9f0650eead5a0ec1ca8524dfe96c56cd.

* Revert "Code changes address broken unit tests."

This reverts commit 5b8cdd9f0bb43638bdd427a454ea177f6fbc024d.

* Revert "Stops flagging untitled editors with pre-loaded content as dirty"

This reverts commit 7a39226b7961af3aba8dc2f08113ed09eb2a1d61.

* Stops marking untitled editors with JSON as dirty

* Code clean up.
This commit is contained in:
Lewis Sanchez
2021-10-08 17:37:08 -07:00
committed by GitHub
parent faa29945a3
commit 8b1fa3ea52
2 changed files with 9 additions and 0 deletions

View File

@@ -694,6 +694,8 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
const input = this.untitledEditorService.create({ mode: column.isXml ? 'xml' : 'json', initialValue: content });
await input.resolve();
await this.instantiationService.invokeFunction(formatDocumentWithSelectedProvider, input.textEditorModel, FormattingMode.Explicit, Progress.None, CancellationToken.None);
input.setDirty(false);
return this.editorService.openEditor(input);
});
}