mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 12:08:36 -05:00
Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)
* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 * disable strict null check
This commit is contained in:
@@ -14,7 +14,7 @@ export class UpdateService implements IUpdateService {
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
|
||||
private _onStateChange = new Emitter<State>();
|
||||
get onStateChange(): Event<State> { return this._onStateChange.event; }
|
||||
readonly onStateChange: Event<State> = this._onStateChange.event;
|
||||
|
||||
private _state: State = State.Uninitialized;
|
||||
get state(): State { return this._state; }
|
||||
|
||||
@@ -11,7 +11,7 @@ import product from 'vs/platform/product/node/product';
|
||||
import { IUpdateService, State, StateType, AvailableForDownload, UpdateType } from 'vs/platform/update/common/update';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IRequestService } from 'vs/platform/request/node/request';
|
||||
import { IRequestService } from 'vs/platform/request/common/request';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
|
||||
export function createUpdateURL(platform: string, quality: string): string {
|
||||
@@ -27,7 +27,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
||||
private _state: State = State.Uninitialized;
|
||||
|
||||
private _onStateChange = new Emitter<State>();
|
||||
get onStateChange(): Event<State> { return this._onStateChange.event; }
|
||||
readonly onStateChange: Event<State> = this._onStateChange.event;
|
||||
|
||||
get state(): State {
|
||||
return this._state;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { AbstractUpdateService, createUpdateURL } from 'vs/platform/update/electron-main/abstractUpdateService';
|
||||
import { IRequestService } from 'vs/platform/request/node/request';
|
||||
import { IRequestService } from 'vs/platform/request/common/request';
|
||||
|
||||
export class DarwinUpdateService extends AbstractUpdateService {
|
||||
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
import { IRequestService } from 'vs/platform/request/node/request';
|
||||
import { State, IUpdate, AvailableForDownload, UpdateType } 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';
|
||||
import { createUpdateURL, AbstractUpdateService } from 'vs/platform/update/electron-main/abstractUpdateService';
|
||||
import { asJson } from 'vs/base/node/request';
|
||||
import { IRequestService, asJson } from 'vs/platform/request/common/request';
|
||||
import { shell } from 'electron';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ abstract class AbstractUpdateService2 implements IUpdateService {
|
||||
private _state: State = State.Uninitialized;
|
||||
|
||||
private _onStateChange = new Emitter<State>();
|
||||
get onStateChange(): Event<State> { return this._onStateChange.event; }
|
||||
readonly onStateChange: Event<State> = this._onStateChange.event;
|
||||
|
||||
get state(): State {
|
||||
return this._state;
|
||||
|
||||
@@ -9,20 +9,21 @@ import * as pfs from 'vs/base/node/pfs';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
import { IRequestService } from 'vs/platform/request/node/request';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { State, IUpdate, StateType, AvailableForDownload, UpdateType } 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';
|
||||
import { createUpdateURL, AbstractUpdateService } from 'vs/platform/update/electron-main/abstractUpdateService';
|
||||
import { download, asJson } from 'vs/base/node/request';
|
||||
import { IRequestService, asJson } from 'vs/platform/request/common/request';
|
||||
import { checksum } from 'vs/base/node/crypto';
|
||||
import { tmpdir } from 'os';
|
||||
import { spawn } from 'child_process';
|
||||
import { shell } from 'electron';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
async function pollUntil(fn: () => boolean, millis = 1000): Promise<void> {
|
||||
while (!fn()) {
|
||||
@@ -65,7 +66,8 @@ export class Win32UpdateService extends AbstractUpdateService {
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IEnvironmentService environmentService: IEnvironmentService,
|
||||
@IRequestService requestService: IRequestService,
|
||||
@ILogService logService: ILogService
|
||||
@ILogService logService: ILogService,
|
||||
@IFileService private readonly fileService: IFileService
|
||||
) {
|
||||
super(lifecycleService, configurationService, environmentService, requestService, logService);
|
||||
|
||||
@@ -143,7 +145,7 @@ export class Win32UpdateService extends AbstractUpdateService {
|
||||
const downloadPath = `${updatePackagePath}.tmp`;
|
||||
|
||||
return this.requestService.request({ url }, CancellationToken.None)
|
||||
.then(context => download(downloadPath, context))
|
||||
.then(context => this.fileService.writeFile(URI.file(downloadPath), context.stream))
|
||||
.then(hash ? () => checksum(downloadPath, update.hash) : () => undefined)
|
||||
.then(() => pfs.rename(downloadPath, updatePackagePath))
|
||||
.then(() => updatePackagePath);
|
||||
@@ -239,10 +241,10 @@ export class Win32UpdateService extends AbstractUpdateService {
|
||||
});
|
||||
|
||||
const readyMutexName = `${product.win32MutexName}-ready`;
|
||||
const isActive = (require.__$__nodeRequire('windows-mutex') as any).isActive;
|
||||
const mutex = await import('windows-mutex');
|
||||
|
||||
// poll for mutex-ready
|
||||
pollUntil(() => isActive(readyMutexName))
|
||||
pollUntil(() => mutex.isActive(readyMutexName))
|
||||
.then(() => this.setState(State.Ready(update)));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { localize } from 'vs/nls';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
|
||||
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
|
||||
configurationRegistry.registerConfiguration({
|
||||
@@ -38,8 +39,9 @@ configurationRegistry.registerConfiguration({
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
scope: ConfigurationScope.APPLICATION,
|
||||
description: localize('enableWindowsBackgroundUpdates', "Enables Windows background updates. The updates are fetched from a Microsoft online service."),
|
||||
tags: ['usesOnlineServices']
|
||||
title: localize('enableWindowsBackgroundUpdatesTitle', "Enable Background Updates on Windows"),
|
||||
description: localize('enableWindowsBackgroundUpdates', "Enable to download and install new VS Code Versions in the background on Windows"),
|
||||
included: isWindows
|
||||
},
|
||||
'update.showReleaseNotes': {
|
||||
type: 'boolean',
|
||||
|
||||
Reference in New Issue
Block a user