提交 b3699ea3 编写于 作者: B Benjamin Pasero

add some log msg to debug issue

上级 c8914ccd
......@@ -204,6 +204,9 @@ export class TextFileEditorModelManager implements ITextFileEditorModelManager {
this.mapResourceToPendingModelLoaders[resource.toString()] = modelPromise;
return modelPromise.then(model => {
if (model.isDisposed()) {
console.error('Adding disposed model into cache!!!'); // TODO@Ben remove me
}
// Make known to manager (if not already known)
this.add(resource, model);
......
......@@ -312,4 +312,18 @@ suite('Files - TextFileEditorModelManager', () => {
});
});
});
test('disposing model takes it out of the manager', function (done) {
const manager: TextFileEditorModelManager = instantiationService.createInstance(TextFileEditorModelManager);
const resource = toResource('/path/index_something.txt');
manager.loadOrCreate(resource, 'utf8').then(model => {
model.dispose();
assert.ok(!manager.get(resource));
manager.dispose();
done();
});
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册