提交 2f088e6d 编写于 作者: M Matt Bierner

Strict null check fileEditorTracker

上级 def06bab
......@@ -229,6 +229,7 @@
"./vs/workbench/contrib/feedback/electron-browser/feedback.ts",
"./vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts",
"./vs/workbench/contrib/files/browser/editors/binaryFileEditor.ts",
"./vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts",
"./vs/workbench/contrib/files/browser/files.ts",
"./vs/workbench/contrib/files/browser/views/emptyView.ts",
"./vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts",
......
......@@ -110,7 +110,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut
private onFileOperation(e: FileOperationEvent): void {
// Handle moves specially when file is opened
if (e.operation === FileOperation.MOVE) {
if (e.operation === FileOperation.MOVE && e.target) {
this.handleMovedFileInOpenedEditors(e.resource, e.target.resource);
}
......@@ -300,8 +300,8 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut
//
// Note: we also consider the added event because it could be that a file was added
// and updated right after.
distinct([...e.getUpdated(), ...e.getAdded()]
.map(u => this.textFileService.models.get(u.resource))
distinct(coalesce([...e.getUpdated(), ...e.getAdded()]
.map(u => this.textFileService.models.get(u.resource)))
.filter(model => model && !model.isDirty()), m => m.getResource().toString())
.forEach(model => this.queueModelLoad(model));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册