diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js index 61ca6dd8477..8bdd75c63c0 100644 --- a/src/bootstrap-window.js +++ b/src/bootstrap-window.js @@ -175,11 +175,11 @@ } // Actually require the main module as specified - require(modulePaths, async result => { + require(modulePaths, async firstModule => { try { // Callback only after process environment is resolved - const callbackResult = resultCallback(result, configuration); + const callbackResult = resultCallback(firstModule, configuration); if (callbackResult instanceof Promise) { await callbackResult; diff --git a/src/vs/code/electron-sandbox/workbench/workbench.js b/src/vs/code/electron-sandbox/workbench/workbench.js index c8e4431d6db..3d956e857ed 100644 --- a/src/vs/code/electron-sandbox/workbench/workbench.js +++ b/src/vs/code/electron-sandbox/workbench/workbench.js @@ -23,13 +23,12 @@ 'vs/nls!vs/workbench/workbench.desktop.main', 'vs/css!vs/workbench/workbench.desktop.main' ], - function (_, configuration) { + function (desktopMain, configuration) { // Mark start of workbench performance.mark('code/didLoadWorkbenchMain'); - // @ts-ignore - return require('vs/workbench/electron-sandbox/desktop.main').main(configuration); + return desktopMain.main(configuration); }, { configureDeveloperSettings: function (windowConfig) { diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts index d505032b79a..13bf782cdc0 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -100,14 +100,17 @@ export class Workbench extends Layout { phase: 'configuration'; } type AnnotatedError = AnnotatedLoadingError | AnnotatedFactoryError | AnnotatedValidationError; - (window).require.config({ - onError: (err: AnnotatedError) => { - if (err.phase === 'loading') { - onUnexpectedError(new Error(localize('loaderErrorNative', "Failed to load a required file. Please restart the application to try again. Details: {0}", JSON.stringify(err)))); + + if (typeof (window).require.config === 'function') { + (window).require.config({ + onError: (err: AnnotatedError) => { + if (err.phase === 'loading') { + onUnexpectedError(new Error(localize('loaderErrorNative', "Failed to load a required file. Please restart the application to try again. Details: {0}", JSON.stringify(err)))); + } + console.error(err); } - console.error(err); - } - }); + }); + } } private previousUnexpectedError: { message: string | undefined; time: number } = { message: undefined, time: 0 }; diff --git a/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts b/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts index eeedf8de3d4..342f3dfa671 100644 --- a/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts +++ b/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { AbstractTreeViewState } from 'vs/base/browser/ui/tree/abstractTree'; -import { TestExplorerTreeElement } from 'vs/workbench/contrib/testing/browser/explorerProjections'; +import { TestExplorerTreeElement } from 'vs/workbench/contrib/testing/browser/explorerProjections/index'; import { flatTestItemDelimiter } from 'vs/workbench/contrib/testing/browser/explorerProjections/display'; import { HierarchicalByLocationProjection as HierarchicalByLocationProjection } from 'vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByLocation'; import { ByLocationTestItemElement } from 'vs/workbench/contrib/testing/browser/explorerProjections/hierarchalNodes'; diff --git a/src/vs/workbench/workbench.desktop.main.ts b/src/vs/workbench/workbench.desktop.main.ts index 0bbbc48473b..3876bc2ec98 100644 --- a/src/vs/workbench/workbench.desktop.main.ts +++ b/src/vs/workbench/workbench.desktop.main.ts @@ -162,3 +162,6 @@ import 'vs/workbench/contrib/mergeEditor/electron-sandbox/mergeEditor.contributi import 'vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution'; //#endregion + + +export { main } from 'vs/workbench/electron-sandbox/desktop.main';