Merge from vscode ad407028575a77ea387eb7cc219b323dc017b686

This commit is contained in:
ADS Merger
2020-08-22 06:06:52 +00:00
committed by Anthony Dresser
parent 404260b8a0
commit 4ad73d381c
480 changed files with 14360 additions and 14122 deletions

View File

@@ -6,13 +6,13 @@
import * as nls from 'vs/nls';
import { URI } from 'vs/base/common/uri';
import * as errors from 'vs/base/common/errors';
import { equals, deepClone } from 'vs/base/common/objects';
import { equals } from 'vs/base/common/objects';
import * as DOM from 'vs/base/browser/dom';
import { IAction, Separator } from 'vs/base/common/actions';
import { IFileService } from 'vs/platform/files/common/files';
import { toResource, IUntitledTextResourceEditorInput, SideBySideEditor, pathsToEditors } from 'vs/workbench/common/editor';
import { IEditorService, IResourceEditorInputType } from 'vs/workbench/services/editor/common/editorService';
import { ITelemetryService, crashReporterIdStorageKey } from 'vs/platform/telemetry/common/telemetry';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWindowSettings, IOpenFileRequest, IWindowsConfiguration, getTitleBarStyle, IAddFoldersRequest } from 'vs/platform/windows/common/windows';
import { IRunActionInWindowRequest, IRunKeybindingInWindowRequest, INativeOpenFileRequest } from 'vs/platform/windows/node/window';
import { ITitleService } from 'vs/workbench/services/title/common/titleService';
@@ -22,8 +22,7 @@ import { setFullscreen, getZoomLevel } from 'vs/base/browser/browser';
import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands';
import { IResourceEditorInput } from 'vs/platform/editor/common/editor';
import { KeyboardMapperFactory } from 'vs/workbench/services/keybinding/electron-browser/nativeKeymapService';
import { CrashReporterStartOptions } from 'vs/base/parts/sandbox/common/electronTypes';
import { crashReporter, ipcRenderer } from 'vs/base/parts/sandbox/electron-sandbox/globals';
import { ipcRenderer } from 'vs/base/parts/sandbox/electron-sandbox/globals';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing';
import { IMenuService, MenuId, IMenu, MenuItemAction, ICommandAction, SubmenuItemAction, MenuRegistry } from 'vs/platform/actions/common/actions';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
@@ -33,8 +32,8 @@ import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { LifecyclePhase, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { IWorkspaceFolderCreationData, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
import { IIntegrityService } from 'vs/workbench/services/integrity/common/integrity';
import { isWindows, isMacintosh, isLinux } from 'vs/base/common/platform';
import { IProductService, IAppCenterConfiguration } from 'vs/platform/product/common/productService';
import { isWindows, isMacintosh } from 'vs/base/common/platform';
import { IProductService } 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';
@@ -46,7 +45,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { MenubarControl } from '../browser/parts/titlebar/menubarControl';
import { ILabelService } from 'vs/platform/label/common/label';
import { IUpdateService } from 'vs/platform/update/common/update';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IPreferencesService } from '../services/preferences/common/preferences';
import { IMenubarData, IMenubarMenu, IMenubarKeybinding, IMenubarMenuItemSubmenu, IMenubarMenuItemAction, MenubarMenuItem } from 'vs/platform/menubar/common/menubar';
import { IMenubarService } from 'vs/platform/menubar/electron-sandbox/menubar';
@@ -108,9 +107,8 @@ export class NativeWindow extends Disposable {
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
@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,
@IRemoteAuthorityResolverService private readonly remoteAuthorityResolverService: IRemoteAuthorityResolverService
) {
super();
@@ -416,23 +414,6 @@ export class NativeWindow extends Disposable {
// Touchbar menu (if enabled)
this.updateTouchbarMenu();
// Crash reporter (if enabled)
if (!this.environmentService.disableCrashReporter && this.configurationService.getValue('telemetry.enableCrashReporter')) {
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
if (this.environmentService.crashReporterDirectory) {
this.setupCrashReporter(companyName, productName, undefined, this.environmentService.crashReporterDirectory);
}
// With appCenter enabled, crashes will be uploaded
else if (this.productService.appCenter) {
this.setupCrashReporter(companyName, productName, this.productService.appCenter, undefined);
}
}
}
private setupOpenHandlers(): void {
@@ -470,10 +451,10 @@ export class NativeWindow extends Disposable {
return (await this.remoteAuthorityResolverService.resolveAuthority(remoteAuthority)).authority;
}
} : undefined;
const tunnel = await this.tunnelService.openTunnel(addressProvider, undefined, portMappingRequest.port);
const tunnel = await this.tunnelService.openTunnel(addressProvider, portMappingRequest.address, portMappingRequest.port);
if (tunnel) {
return {
resolved: uri.with({ authority: `127.0.0.1:${tunnel.tunnelLocalPort}` }),
resolved: uri.with({ authority: tunnel.localAddress }),
dispose: () => tunnel.dispose(),
};
}
@@ -550,42 +531,6 @@ export class NativeWindow extends Disposable {
}
}
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: 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;
}
const info = await this.telemetryService.getTelemetryInfo();
const crashReporterId = this.storageService.get(crashReporterIdStorageKey, StorageScope.GLOBAL)!;
// base options with product info
const options: CrashReporterStartOptions = {
companyName,
productName,
submitURL: (submitURL?.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', info.sessionId)) || '',
extra: {
vscode_version: this.productService.version,
vscode_commit: this.productService.commit || ''
},
// If `crashesDirectory` is specified, we do not upload
uploadToServer: !crashesDirectory,
};
// start crash reporter in the main process first.
// On windows crashpad excepts a name pipe for the client to connect,
// this pipe is created by crash reporter initialization from the main process,
// changing this order of initialization will cause issues.
// For more info: https://chromium.googlesource.com/crashpad/crashpad/+/HEAD/doc/overview_design.md#normal-registration
await this.electronService.startCrashReporter(options);
// start crash reporter right here
crashReporter.start(deepClone(options));
}
private onAddFoldersRequest(request: IAddFoldersRequest): void {
// Buffer all pending requests