debt - do not ignore dirty when invoking save participants

if a save participant changes the model and the save fails, the document
is not marked as dirty
This commit is contained in:
Benjamin Pasero 2020-02-14 09:31:20 +01:00
parent 7a8596fd4b
commit 9cda3b7bda

View file

@ -627,13 +627,9 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
// Save participants can also be skipped through API.
if (this.isResolved() && this.textFileService.saveParticipant && !options.skipSaveParticipants) {
try {
this.ignoreDirtyOnModelContentChange = true;
await this.textFileService.saveParticipant.participate(this, { reason: options.reason ?? SaveReason.EXPLICIT }, saveParticipantCancellation.token);
} catch (error) {
// Ignore
} finally {
this.ignoreDirtyOnModelContentChange = false;
}
}