mirror of
https://github.com/microsoft/vscode.git
synced 2026-06-05 15:16:06 +01:00
Add an option to disable closing open files that are removed from the directory (#21962)
This commit is contained in:
@@ -210,31 +210,6 @@ suite('Files - TextFileEditorModel', () => {
|
||||
}, error => onError(error, done));
|
||||
});
|
||||
|
||||
test('Conflict Resolution Mode', function (done) {
|
||||
const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8');
|
||||
|
||||
model.load().done(() => {
|
||||
model.setConflictResolutionMode();
|
||||
model.textEditorModel.setValue('foo');
|
||||
|
||||
assert.ok(model.isDirty());
|
||||
assert.equal(model.getState(), ModelState.CONFLICT);
|
||||
|
||||
return model.revert().then(() => {
|
||||
model.textEditorModel.setValue('bar');
|
||||
assert.ok(model.isDirty());
|
||||
|
||||
return model.save().then(() => {
|
||||
assert.ok(!model.isDirty());
|
||||
|
||||
model.dispose();
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
}, error => onError(error, done));
|
||||
});
|
||||
|
||||
test('Auto Save triggered when model changes', function (done) {
|
||||
let eventCounter = 0;
|
||||
const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index.txt'), 'utf8');
|
||||
@@ -382,6 +357,25 @@ suite('Files - TextFileEditorModel', () => {
|
||||
}, error => onError(error, done));
|
||||
});
|
||||
|
||||
test('setOrphaned basics', function (done) {
|
||||
const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8');
|
||||
|
||||
return model.load().then(() => {
|
||||
let undo = model.setOrphaned();
|
||||
assert.equal(model.isDirty(), true);
|
||||
undo();
|
||||
assert.equal(model.isDirty(), false);
|
||||
|
||||
// can not undo when model changed meanwhile
|
||||
undo = model.setOrphaned();
|
||||
model.textEditorModel.setValue('foo');
|
||||
undo();
|
||||
assert.equal(model.isDirty(), true);
|
||||
|
||||
done();
|
||||
}, error => onError(error, done));
|
||||
});
|
||||
|
||||
test('SaveSequentializer - pending basics', function (done) {
|
||||
const sequentializer = new SaveSequentializer();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user