Merge from vscode 4d91d96e5e121b38d33508cdef17868bab255eae

This commit is contained in:
ADS Merger
2020-06-18 04:32:54 +00:00
committed by AzureDataStudio
parent a971aee5bd
commit 5e7071e466
1002 changed files with 24201 additions and 13193 deletions

View File

@@ -178,7 +178,8 @@ class DesktopMain extends Disposable {
serviceCollection.set(IWorkbenchEnvironmentService, this.environmentService);
// Product
serviceCollection.set(IProductService, { _serviceBrand: undefined, ...product });
const productService: IProductService = { _serviceBrand: undefined, ...product };
serviceCollection.set(IProductService, productService);
// Log
const logService = this._register(new DesktopLogService(this.configuration.windowId, mainProcessService, this.environmentService));
@@ -193,7 +194,7 @@ class DesktopMain extends Disposable {
serviceCollection.set(ISignService, signService);
// Remote Agent
const remoteAgentService = this._register(new RemoteAgentService(this.environmentService, remoteAuthorityResolverService, signService, logService));
const remoteAgentService = this._register(new RemoteAgentService(this.environmentService, remoteAuthorityResolverService, signService, logService, productService));
serviceCollection.set(IRemoteAgentService, remoteAgentService);
// Electron

View File

@@ -34,7 +34,7 @@ import { LifecyclePhase, ILifecycleService } from 'vs/platform/lifecycle/common/
import { IWorkspaceFolderCreationData, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
import { IIntegrityService } from 'vs/workbench/services/integrity/common/integrity';
import { isRootUser, isWindows, isMacintosh, isLinux } from 'vs/base/common/platform';
import product from 'vs/platform/product/common/product';
import { IProductService, IAppCenterConfiguration } from 'vs/platform/product/common/productService';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
@@ -64,6 +64,7 @@ import { AutoSaveMode, IFilesConfigurationService } from 'vs/workbench/services/
import { Event } from 'vs/base/common/event';
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService';
import { clearAllFontInfos } from 'vs/editor/browser/config/configuration';
import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver';
export class NativeWindow extends Disposable {
@@ -107,6 +108,8 @@ export class NativeWindow extends Disposable {
@IWorkingCopyService private readonly workingCopyService: IWorkingCopyService,
@IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService,
@IStorageService private readonly storageService: IStorageService,
@IProductService private readonly productService: IProductService,
@IRemoteAuthorityResolverService private readonly remoteAuthorityResolverService: IRemoteAuthorityResolverService,
) {
super();
@@ -182,6 +185,7 @@ export class NativeWindow extends Disposable {
this.notificationService.info(message);
});
// Display change events
ipcRenderer.on('vscode:displayChanged', () => {
clearAllFontInfos();
});
@@ -395,8 +399,8 @@ export class NativeWindow extends Disposable {
// Handle open calls
this.setupOpenHandlers();
// Emit event when vscode is ready
this.lifecycleService.when(LifecyclePhase.Ready).then(() => ipcRenderer.send('vscode:workbenchReady', this.electronService.windowId));
// Notify main side when window ready
this.lifecycleService.when(LifecyclePhase.Ready).then(() => this.electronService.notifyReady());
// Integrity warning
this.integrityService.isPure().then(res => this.titleService.updateProperties({ isPure: res.isPure }));
@@ -415,7 +419,7 @@ export class NativeWindow extends Disposable {
// Show warning message (unix only)
if (isAdmin && !isWindows) {
this.notificationService.warn(nls.localize('runningAsRoot', "It is not recommended to run {0} as root user.", product.nameShort));
this.notificationService.warn(nls.localize('runningAsRoot', "It is not recommended to run {0} as root user.", this.productService.nameShort));
}
});
@@ -424,8 +428,8 @@ export class NativeWindow extends Disposable {
// Crash reporter (if enabled)
if (!this.environmentService.disableCrashReporter && this.configurationService.getValue('telemetry.enableCrashReporter')) {
const companyName = product.crashReporter?.companyName || 'Microsoft';
const productName = product.crashReporter?.productName || product.nameShort;
const companyName = this.productService.crashReporter?.companyName || 'Microsoft';
const productName = this.productService.crashReporter?.productName || this.productService.nameShort;
// With a provided crash reporter directory, crashes
// will be stored only locally in that folder
@@ -434,8 +438,8 @@ export class NativeWindow extends Disposable {
}
// With appCenter enabled, crashes will be uploaded
else if (product.appCenter) {
this.setupCrashReporter(companyName, productName, product.appCenter, undefined);
else if (this.productService.appCenter) {
this.setupCrashReporter(companyName, productName, this.productService.appCenter, undefined);
}
}
}
@@ -469,7 +473,8 @@ export class NativeWindow extends Disposable {
if (options?.allowTunneling) {
const portMappingRequest = extractLocalHostUriMetaDataForPortMapping(uri);
if (portMappingRequest) {
const tunnel = await this.tunnelService.openTunnel(undefined, portMappingRequest.port);
const resolvedRemote = this.environmentService.configuration.remoteAuthority ? await this.remoteAuthorityResolverService.resolveAuthority(this.environmentService.configuration.remoteAuthority) : undefined;
const tunnel = await this.tunnelService.openTunnel(resolvedRemote?.authority, undefined, portMappingRequest.port);
if (tunnel) {
return {
resolved: uri.with({ authority: `127.0.0.1:${tunnel.tunnelLocalPort}` }),
@@ -549,9 +554,9 @@ export class NativeWindow extends Disposable {
}
}
private async setupCrashReporter(companyName: string, productName: string, appCenter: typeof product.appCenter, crashesDirectory: undefined): Promise<void>;
private async setupCrashReporter(companyName: string, productName: string, appCenter: IAppCenterConfiguration, crashesDirectory: undefined): Promise<void>;
private async setupCrashReporter(companyName: string, productName: string, appCenter: undefined, crashesDirectory: string): Promise<void>;
private async setupCrashReporter(companyName: string, productName: string, appCenter: typeof product.appCenter | undefined, crashesDirectory: string | undefined): Promise<void> {
private async setupCrashReporter(companyName: string, productName: string, appCenter: IAppCenterConfiguration | undefined, crashesDirectory: string | undefined): Promise<void> {
let submitURL: string | undefined = undefined;
if (appCenter) {
submitURL = isWindows ? appCenter[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64'] : isLinux ? appCenter[`linux-x64`] : appCenter.darwin;
@@ -566,8 +571,8 @@ export class NativeWindow extends Disposable {
productName,
submitURL: (submitURL?.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', info.sessionId)) || '',
extra: {
vscode_version: product.version,
vscode_commit: product.commit || ''
vscode_version: this.productService.version,
vscode_commit: this.productService.commit || ''
},
// If `crashesDirectory` is specified, we do not upload
@@ -635,7 +640,7 @@ export class NativeWindow extends Disposable {
private async trackClosedWaitFiles(waitMarkerFile: URI, resourcesToWaitFor: URI[]): Promise<void> {
// Wait for the resources to be closed in the editor...
await this.editorService.whenClosed(resourcesToWaitFor, { waitForSaved: true });
await this.editorService.whenClosed(resourcesToWaitFor.map(resource => ({ resource })), { waitForSaved: true });
// ...before deleting the wait marker file
await this.fileService.del(waitMarkerFile);