diff --git a/README.md b/README.md index 91566a493db6..5d5ee55c63af 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ a code editor with what developers need for their core edit-build-debug cycle. Code provides comprehensive editing and debugging support, an extensibility model, and lightweight integration with existing tools. +VS Code is updated monthly with new features and bug fixes. You can download it for Windows, Mac and Linux on [VS Code's website](https://code.visualstudio.com/Download). To get the latest releases everyday, you can install the [Insiders version of VS Code](https://code.visualstudio.com/insiders). This builds from the master branch and is updated at least daily. +
;
constructor(init: (complete: TValueCallback ) => void = (c, e, p) => { }, oncancel?: any) {
- super((c, e, p) => { this.completeCallback = c; this.errorCallback = e; this.progressCallback = p; }, oncancel ? oncancel : () => this.oncancel);
+ let captured: any;
+ super((c, e, p) => {
+ captured = { c, e, p };
+ }, oncancel ? oncancel : () => this.oncancel);
+ this.completeCallback = captured.c;
+ this.errorCallback = captured.e;
+ this.progressCallback = captured.p;
}
private oncancel(): void {
diff --git a/src/vs/code/electron-main/launch.ts b/src/vs/code/electron-main/launch.ts
index 026fad8e55b5..e413e7775bf6 100644
--- a/src/vs/code/electron-main/launch.ts
+++ b/src/vs/code/electron-main/launch.ts
@@ -93,7 +93,7 @@ export class LaunchService implements ILaunchService {
let usedWindows: VSCodeWindow[];
if (!!args.extensionDevelopmentPath) {
this.windowsService.openExtensionDevelopmentHostWindow({ context, cli: args, userEnv });
- } else if (args._.length === 0 && args['new-window']) {
+ } else if (args._.length === 0 && args['new-window'] || args['new-window-if-not-first']) {
usedWindows = this.windowsService.open({ context, cli: args, userEnv, forceNewWindow: true, forceEmpty: true });
} else if (args._.length === 0) {
usedWindows = [this.windowsService.focusLastActive(args, context)];
@@ -102,7 +102,7 @@ export class LaunchService implements ILaunchService {
context,
cli: args,
userEnv,
- forceNewWindow: args.wait || args['new-window'],
+ forceNewWindow: args.wait || args['new-window'] || args['new-window-if-not-first'],
preferNewWindow: !args['reuse-window'],
forceReuseWindow: args['reuse-window'],
diffMode: args.diff
diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts
index b9e11a0702a5..5eb0da6e884b 100644
--- a/src/vs/code/electron-main/main.ts
+++ b/src/vs/code/electron-main/main.ts
@@ -257,7 +257,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
} else if (global.macOpenFiles && global.macOpenFiles.length && (!environmentService.args._ || !environmentService.args._.length)) {
windowsMainService.open({ context: OpenContext.DOCK, cli: environmentService.args, pathsToOpen: global.macOpenFiles, initialStartup: true }); // mac: open-file event received on startup
} else {
- windowsMainService.open({ context, cli: environmentService.args, forceNewWindow: environmentService.args['new-window'], diffMode: environmentService.args.diff, initialStartup: true }); // default: read paths from cli
+ windowsMainService.open({ context, cli: environmentService.args, forceNewWindow: environmentService.args['new-window'] || environmentService.args['new-window-if-not-first'], diffMode: environmentService.args.diff, initialStartup: true }); // default: read paths from cli
}
// Install Menu
diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts
index 89779d04901c..5f66d03b6187 100644
--- a/src/vs/code/electron-main/window.ts
+++ b/src/vs/code/electron-main/window.ts
@@ -83,6 +83,7 @@ export interface IWindowConfiguration extends ParsedArgs {
isInitialStartup?: boolean;
perfStartTime?: number;
+ perfAppReady?: number;
perfWindowLoadTime?: number;
workspacePath?: string;
@@ -212,21 +213,6 @@ export class VSCodeWindow implements IVSCodeWindow {
this._win = new BrowserWindow(options);
this._id = this._win.id;
- // TODO@joao: hook this up to some initialization routine
- // this causes a race between setting the headers and doing
- // a request that needs them. chances are low
- getCommonHTTPHeaders().done(headers => {
- if (!this._win) {
- return;
- }
-
- const urls = ['https://marketplace.visualstudio.com/*', 'https://*.vsassets.io/*'];
-
- this._win.webContents.session.webRequest.onBeforeSendHeaders({ urls }, (details, cb) => {
- cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) });
- });
- });
-
if (isFullscreenOrMaximized) {
this.win.maximize();
@@ -245,6 +231,11 @@ export class VSCodeWindow implements IVSCodeWindow {
const windowConfig = this.configurationService.getConfiguration