From 0edca427dbef03a8bfd80a004bbec99003a88f7f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 24 Mar 2016 12:09:58 +0100 Subject: [PATCH] fwd error when document cannot be opened, fixes #4577 --- src/vs/workbench/api/node/extHostEditors.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/node/extHostEditors.ts b/src/vs/workbench/api/node/extHostEditors.ts index 0a6a73b859a..dd59e5c1972 100644 --- a/src/vs/workbench/api/node/extHostEditors.ts +++ b/src/vs/workbench/api/node/extHostEditors.ts @@ -94,7 +94,7 @@ export class ExtHostEditors { if (editor) { return editor; } else { - throw new Error('Failed to create editor with id: ' + id); + throw new Error(`Failed to show text document ${document.uri.toString()}, should show in editor #${id}`); } }); } @@ -626,6 +626,10 @@ export class MainThreadEditors { return this._workbenchEditorService.openEditor(input, position).then(editor => { + if (!editor) { + return; + } + return new TPromise(c => { // not very nice but the way it is: changes to the editor state aren't // send to the ext host as they happen but stuff is delayed a little. in