mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -11,7 +11,6 @@ import { checksum } from 'vs/base/node/crypto';
|
||||
import { EventEmitter } from 'events';
|
||||
import { tmpdir } from 'os';
|
||||
import { spawn } from 'child_process';
|
||||
import { mkdirp } from 'vs/base/node/extfs';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
import { Promise, TPromise } from 'vs/base/common/winjs.base';
|
||||
import { download, asJson } from 'vs/base/node/request';
|
||||
@@ -43,7 +42,7 @@ export class Win32AutoUpdaterImpl extends EventEmitter implements IAutoUpdater {
|
||||
get cachePath(): TPromise<string> {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const result = path.join(tmpdir(), `sqlops-update-${process.arch}`);
|
||||
return new TPromise<string>((c, e) => mkdirp(result, null, err => err ? e(err) : c(result)));
|
||||
return pfs.mkdirp(result, null).then(() => result);
|
||||
}
|
||||
|
||||
setFeedURL(url: string): void {
|
||||
|
||||
@@ -9,10 +9,9 @@ import * as fs from 'original-fs';
|
||||
import * as path from 'path';
|
||||
import * as electron from 'electron';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import Event, { Emitter, once, filterEvent } from 'vs/base/common/event';
|
||||
import Event, { Emitter, once, filterEvent, fromNodeEventEmitter } from 'vs/base/common/event';
|
||||
import { always, Throttler } from 'vs/base/common/async';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
import { fromEventEmitter } from 'vs/base/node/event';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { Win32AutoUpdaterImpl } from './auto-updater.win32';
|
||||
import { LinuxAutoUpdaterImpl } from './auto-updater.linux';
|
||||
@@ -23,6 +22,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IUpdateService, State, IAutoUpdater, IUpdate, IRawUpdate } from 'vs/platform/update/common/update';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class UpdateService implements IUpdateService {
|
||||
|
||||
@@ -53,22 +53,22 @@ export class UpdateService implements IUpdateService {
|
||||
|
||||
@memoize
|
||||
private get onRawError(): Event<string> {
|
||||
return fromEventEmitter(this.raw, 'error', (_, message) => message);
|
||||
return fromNodeEventEmitter(this.raw, 'error', (_, message) => message);
|
||||
}
|
||||
|
||||
@memoize
|
||||
private get onRawUpdateNotAvailable(): Event<void> {
|
||||
return fromEventEmitter<void>(this.raw, 'update-not-available');
|
||||
return fromNodeEventEmitter<void>(this.raw, 'update-not-available');
|
||||
}
|
||||
|
||||
@memoize
|
||||
private get onRawUpdateAvailable(): Event<{ url: string; version: string; }> {
|
||||
return filterEvent(fromEventEmitter(this.raw, 'update-available', (_, url, version) => ({ url, version })), ({ url }) => !!url);
|
||||
return filterEvent(fromNodeEventEmitter(this.raw, 'update-available', (_, url, version) => ({ url, version })), ({ url }) => !!url);
|
||||
}
|
||||
|
||||
@memoize
|
||||
private get onRawUpdateDownloaded(): Event<IRawUpdate> {
|
||||
return fromEventEmitter(this.raw, 'update-downloaded', (_, releaseNotes, version, date, url) => ({ releaseNotes, version, date }));
|
||||
return fromNodeEventEmitter(this.raw, 'update-downloaded', (_, releaseNotes, version, date, url) => ({ releaseNotes, version, date }));
|
||||
}
|
||||
|
||||
get state(): State {
|
||||
@@ -89,7 +89,8 @@ export class UpdateService implements IUpdateService {
|
||||
@ILifecycleService private lifecycleService: ILifecycleService,
|
||||
@IConfigurationService private configurationService: IConfigurationService,
|
||||
@ITelemetryService private telemetryService: ITelemetryService,
|
||||
@IEnvironmentService private environmentService: IEnvironmentService
|
||||
@IEnvironmentService private environmentService: IEnvironmentService,
|
||||
@ILogService private logService: ILogService
|
||||
) {
|
||||
if (process.platform === 'win32') {
|
||||
this.raw = new Win32AutoUpdaterImpl(requestService);
|
||||
@@ -122,7 +123,7 @@ export class UpdateService implements IUpdateService {
|
||||
|
||||
// Start checking for updates after 30 seconds
|
||||
this.scheduleCheckForUpdates(30 * 1000)
|
||||
.done(null, err => console.error(err));
|
||||
.done(null, err => this.logService.error(err));
|
||||
}
|
||||
|
||||
private scheduleCheckForUpdates(delay = 60 * 60 * 1000): TPromise<void> {
|
||||
@@ -225,9 +226,7 @@ export class UpdateService implements IUpdateService {
|
||||
}
|
||||
|
||||
private getUpdateChannel(): string {
|
||||
const config = this.configurationService.getConfiguration<{ channel: string; }>('update');
|
||||
const channel = config && config.channel;
|
||||
|
||||
const channel = this.configurationService.getValue<string>('update.channel');
|
||||
return channel === 'none' ? null : product.quality;
|
||||
}
|
||||
|
||||
@@ -271,7 +270,10 @@ export class UpdateService implements IUpdateService {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
this.logService.trace('update#quitAndInstall(): before lifecycle quit()');
|
||||
|
||||
this.lifecycleService.quit(true /* from update */).done(vetod => {
|
||||
this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${vetod}`);
|
||||
if (vetod) {
|
||||
return;
|
||||
}
|
||||
@@ -280,9 +282,11 @@ export class UpdateService implements IUpdateService {
|
||||
// we workaround this issue by forcing an explicit flush of the storage data.
|
||||
// see also https://github.com/Microsoft/vscode/issues/172
|
||||
if (process.platform === 'darwin') {
|
||||
this.logService.trace('update#quitAndInstall(): calling flushStorageData()');
|
||||
electron.session.defaultSession.flushStorageData();
|
||||
}
|
||||
|
||||
this.logService.trace('update#quitAndInstall(): running raw#quitAndInstall()');
|
||||
this.raw.quitAndInstall();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user