Skip to content

Commit 30999bd

Browse files
authored
Merge pull request microsoft#189411 from microsoft/aamunger/cleanup
removed redundant conflict check, cleanup disposable handling
2 parents 3f23ab3 + 935465e commit 30999bd

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

src/vs/workbench/contrib/notebook/common/notebookCommon.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,6 @@ export interface INotebookEditorModel extends IEditorModel {
797797
readonly viewType: string;
798798
readonly notebook: INotebookTextModel | undefined;
799799
readonly hasErrorState: boolean;
800-
readonly hasConflictState: boolean;
801800
isResolved(): this is IResolvedNotebookEditorModel;
802801
isDirty(): boolean;
803802
isModified(): boolean;

src/vs/workbench/contrib/notebook/common/notebookEditorInput.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ export class NotebookEditorInput extends AbstractResourceEditorInput {
158158

159159
override isSaving(): boolean {
160160
const model = this._editorModelReference?.object;
161-
if (!model || !model.isDirty() || model.hasErrorState || model.hasConflictState) {
162-
return false; // require the model to be dirty and not in error or conflict state
161+
if (!model || !model.isDirty() || model.hasErrorState) {
162+
return false; // require the model to be dirty and not in an error state
163163
}
164164

165165
// if a short auto save is configured, treat this as being saved

src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE
116116
return false;
117117
}
118118

119-
get hasConflictState(): boolean {
120-
if (this._workingCopy && 'hasState' in this._workingCopy) {
121-
return this._workingCopy.hasState(StoredFileWorkingCopyState.CONFLICT);
122-
}
123-
124-
return false;
125-
}
126-
127119
revert(options?: IRevertOptions): Promise<void> {
128120
assertType(this.isResolved());
129121
return this._workingCopy!.revert(options);
@@ -149,7 +141,7 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE
149141
this._workingCopyListeners.add(this._workingCopy.onDidChangeOrphaned(() => this._onDidChangeOrphaned.fire()));
150142
this._workingCopyListeners.add(this._workingCopy.onDidChangeReadonly(() => this._onDidChangeReadonly.fire()));
151143
}
152-
this._workingCopyListeners.add(this._workingCopy.onDidChangeDirty(() => this._onDidChangeDirty.fire(), undefined, this._workingCopyListeners));
144+
this._workingCopyListeners.add(this._workingCopy.onDidChangeDirty(() => this._onDidChangeDirty.fire(), undefined));
153145

154146
this._workingCopyListeners.add(this._workingCopy.onWillDispose(() => {
155147
this._workingCopyListeners.clear();

src/vs/workbench/contrib/notebook/test/browser/testNotebookEditor.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ export class NotebookEditorTestModel extends EditorModel implements INotebookEdi
139139
return false;
140140
}
141141

142-
get hasConflictState() {
143-
return false;
144-
}
145-
146142
isModified(): boolean {
147143
return this._dirty;
148144
}

0 commit comments

Comments
 (0)