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