Merge from vscode 892353d48e17303de203bb5071f21ea69573367d

This commit is contained in:
ADS Merger
2020-09-05 03:17:42 +00:00
parent b8d0e2a9e3
commit 6718c7565d
40 changed files with 330 additions and 130 deletions

View File

@@ -45,6 +45,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { IOutputChannelRegistry, Extensions } from 'vs/workbench/services/output/common/output';
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService';
import { isUUID } from 'vs/base/common/uuid';
import { join } from 'vs/base/common/path';
export interface ILocalProcessExtensionHostInitData {
readonly autoStart: boolean;
@@ -154,17 +155,24 @@ export class LocalProcessExtensionHost implements IExtensionHost {
]).then(data => {
const pipeName = data[0];
const portNumber = data[1];
const env = objects.mixin(objects.deepClone(process.env), {
AMD_ENTRYPOINT: 'vs/workbench/services/extensions/node/extensionHostProcess',
PIPE_LOGGING: 'true',
VERBOSE_LOGGING: true,
VSCODE_IPC_HOOK_EXTHOST: pipeName,
VSCODE_HANDLES_UNCAUGHT_ERRORS: true,
VSCODE_LOG_STACK: !this._isExtensionDevTestFromCli && (this._isExtensionDevHost || !this._environmentService.isBuilt || this._productService.quality !== 'stable' || this._environmentService.verbose),
VSCODE_LOG_LEVEL: this._environmentService.verbose ? 'trace' : this._environmentService.log
});
if (platform.isMacintosh) {
// Unset `DYLD_LIBRARY_PATH`, as it leads to extension host crashes
// See https://github.com/microsoft/vscode/issues/104525
delete env['DYLD_LIBRARY_PATH'];
}
const opts = {
env: objects.mixin(objects.deepClone(process.env), {
AMD_ENTRYPOINT: 'vs/workbench/services/extensions/node/extensionHostProcess',
PIPE_LOGGING: 'true',
VERBOSE_LOGGING: true,
VSCODE_IPC_HOOK_EXTHOST: pipeName,
VSCODE_HANDLES_UNCAUGHT_ERRORS: true,
VSCODE_LOG_STACK: !this._isExtensionDevTestFromCli && (this._isExtensionDevHost || !this._environmentService.isBuilt || this._productService.quality !== 'stable' || this._environmentService.verbose),
VSCODE_LOG_LEVEL: this._environmentService.verbose ? 'trace' : this._environmentService.log
}),
env: env,
// We only detach the extension host on windows. Linux and Mac orphan by default
// and detach under Linux and Mac create another process group.
// We detach because we have noticed that when the renderer exits, its child processes
@@ -199,6 +207,11 @@ export class LocalProcessExtensionHost implements IExtensionHost {
crashReporterStartOptions.submitURL = submitURL.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', crashReporterId);
crashReporterStartOptions.uploadToServer = true;
}
// In the upload to server case, there is a bug in electron that creates client_id file in the current
// working directory. Setting the env BREAKPAD_DUMP_LOCATION will force electron to create the file in that location,
// For https://github.com/microsoft/vscode/issues/105743
const extHostCrashDirectory = this._environmentService.crashReporterDirectory || this._environmentService.userDataPath;
opts.env.BREAKPAD_DUMP_LOCATION = join(extHostCrashDirectory, `${ExtensionHostLogFileName} Crash Reports`);
opts.env.CRASH_REPORTER_START_OPTIONS = JSON.stringify(crashReporterStartOptions);
}

View File

@@ -30,11 +30,6 @@ export interface IHoverService {
* ```
*/
showHover(options: IHoverOptions, focus?: boolean): void;
/**
* Hides the hover if it was visible.
*/
hideHover(): void;
}
export interface IHoverOptions {

View File

@@ -12,6 +12,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { HoverWidget } from 'vs/workbench/services/hover/browser/hoverWidget';
import { IContextViewProvider, IDelegate } from 'vs/base/browser/ui/contextview/contextview';
import { IDisposable } from 'vs/base/common/lifecycle';
export class HoverService implements IHoverService {
declare readonly _serviceBrand: undefined;
@@ -35,14 +36,20 @@ export class HoverService implements IHoverService {
const provider = this._contextViewService as IContextViewProvider;
provider.showContextView(new HoverContextViewDelegate(hover, focus));
hover.onRequestLayout(() => provider.layout());
if ('IntersectionObserver' in window) {
const observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });
const firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;
observer.observe(firstTargetElement);
hover.onDispose(() => observer.disconnect());
}
}
hideHover(): void {
if (!this._currentHoverOptions) {
return;
private _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {
const entry = entries[entries.length - 1];
if (!entry.isIntersecting) {
hover.dispose();
}
this._currentHoverOptions = undefined;
this._contextViewService.hideContextView();
}
}

View File

@@ -31,7 +31,7 @@ import { IUserKeybindingItem, KeybindingIO, OutputBuilder } from 'vs/workbench/s
import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper';
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { Action2, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
import { MenuRegistry } from 'vs/platform/actions/common/actions';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { commandsExtensionPoint } from 'vs/workbench/api/common/menusExtensionPoint';
import { Disposable } from 'vs/base/common/lifecycle';
@@ -48,7 +48,6 @@ import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE } from 'vs/base/com
import { flatten } from 'vs/base/common/arrays';
import { BrowserFeatures, KeyboardSupport } from 'vs/base/browser/canIUse';
import { ILogService } from 'vs/platform/log/common/log';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
interface ContributedKeyBinding {
@@ -745,26 +744,6 @@ let schema: IJSONSchema = {
}
};
const preferencesCategory = nls.localize('preferences', "Preferences");
class ToggleKeybindingsLogAction extends Action2 {
constructor() {
super({
id: 'workbench.action.toggleKeybindingsLog',
title: { value: nls.localize('toggleKeybindingsLog', "Toggle Keyboard Shortcuts Troubleshooting"), original: 'Toggle Keyboard Shortcuts Troubleshooting' },
category: preferencesCategory,
f1: true
});
}
run(accessor: ServicesAccessor): void {
accessor.get(IKeybindingService).toggleLogging();
}
}
registerAction2(ToggleKeybindingsLogAction);
let schemaRegistry = Registry.as<IJSONContributionRegistry>(Extensions.JSONContribution);
schemaRegistry.registerSchema(schemaId, schema);

View File

@@ -3,9 +3,10 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { JSONSchemaType } from 'vs/base/common/jsonSchema';
import { isArray } from 'vs/base/common/types';
import * as nls from 'vs/nls';
import { JSONSchemaType } from 'vs/base/common/jsonSchema';
import { Color } from 'vs/base/common/color';
import { isArray } from 'vs/base/common/types';
import { IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry';
type Validator<T> = { enabled: boolean, isValid: (value: T) => boolean; message: string };
@@ -111,6 +112,11 @@ function getStringValidators(prop: IConfigurationPropertySchema) {
isValid: ((value: string) => patternRegex!.test(value)),
message: prop.patternErrorMessage || nls.localize('validations.regex', "Value must match regex `{0}`.", prop.pattern)
},
{
enabled: prop.format === 'color-hex',
isValid: ((value: string) => Color.Format.CSS.parseHex(value)),
message: nls.localize('validations.colorFormat', "Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.")
}
].filter(validation => validation.enabled);
}

View File

@@ -19,7 +19,7 @@ export class FileUserDataProvider extends Disposable implements
IFileSystemProviderWithOpenReadWriteCloseCapability,
IFileSystemProviderWithFileReadStreamCapability {
readonly capabilities: FileSystemProviderCapabilities = this.fileSystemProvider.capabilities;
get capabilities() { return this.fileSystemProvider.capabilities; }
readonly onDidChangeCapabilities: Event<void> = this.fileSystemProvider.onDidChangeCapabilities;
private readonly _onDidChangeFile = this._register(new Emitter<readonly IFileChange[]>());