Merge VS Code 1.21 source code (#1067)

* Initial VS Code 1.21 file copy with patches

* A few more merges

* Post npm install

* Fix batch of build breaks

* Fix more build breaks

* Fix more build errors

* Fix more build breaks

* Runtime fixes 1

* Get connection dialog working with some todos

* Fix a few packaging issues

* Copy several node_modules to package build to fix loader issues

* Fix breaks from master

* A few more fixes

* Make tests pass

* First pass of license header updates

* Second pass of license header updates

* Fix restore dialog issues

* Remove add additional themes menu items

* fix select box issues where the list doesn't show up

* formatting

* Fix editor dispose issue

* Copy over node modules to correct location on all platforms
This commit is contained in:
Karl Burtram
2018-04-04 15:27:51 -07:00
committed by GitHub
parent 5fba3e31b4
commit dafb780987
9412 changed files with 141255 additions and 98813 deletions

View File

@@ -7,16 +7,15 @@
import * as nls from 'vs/nls';
import { ResolvedKeybinding, Keybinding } from 'vs/base/common/keyCodes';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import Severity from 'vs/base/common/severity';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { KeybindingResolver, IResolveResult } from 'vs/platform/keybinding/common/keybindingResolver';
import { IKeybindingEvent, IKeybindingService, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey';
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
import { IMessageService } from 'vs/platform/message/common/message';
import Event, { Emitter } from 'vs/base/common/event';
import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { INotificationService } from 'vs/platform/notification/common/notification';
interface CurrentChord {
keypress: string;
@@ -34,7 +33,7 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
private _contextKeyService: IContextKeyService;
private _statusService: IStatusbarService;
private _messageService: IMessageService;
private _notificationService: INotificationService;
protected _commandService: ICommandService;
protected _telemetryService: ITelemetryService;
@@ -42,14 +41,14 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
contextKeyService: IContextKeyService,
commandService: ICommandService,
telemetryService: ITelemetryService,
messageService: IMessageService,
notificationService: INotificationService,
statusService?: IStatusbarService
) {
this._contextKeyService = contextKeyService;
this._commandService = commandService;
this._telemetryService = telemetryService;
this._statusService = statusService;
this._messageService = messageService;
this._notificationService = notificationService;
this._currentChord = null;
this._currentChordStatusMessage = null;
@@ -163,7 +162,7 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
shouldPreventDefault = true;
}
this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs || {}).done(undefined, err => {
this._messageService.show(Severity.Warning, err);
this._notificationService.warn(err);
});
/* __GDPR__
"workbenchActionExecuted" : {

View File

@@ -52,15 +52,20 @@ export interface IKeybindingRule2 {
when: ContextKeyExpr;
}
export const enum KeybindingRuleSource {
Core = 0,
Extension = 1
}
export interface ICommandAndKeybindingRule extends IKeybindingRule {
handler: ICommandHandler;
description?: ICommandHandlerDescription;
}
export interface IKeybindingsRegistry {
registerKeybindingRule(rule: IKeybindingRule): void;
registerKeybindingRule2(rule: IKeybindingRule2): void;
registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule): void;
registerKeybindingRule(rule: IKeybindingRule, source?: KeybindingRuleSource): void;
registerKeybindingRule2(rule: IKeybindingRule2, source?: KeybindingRuleSource): void;
registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule, source?: KeybindingRuleSource): void;
getDefaultKeybindings(): IKeybindingItem[];
WEIGHT: {
@@ -142,31 +147,31 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry {
return kb;
}
public registerKeybindingRule(rule: IKeybindingRule): void {
public registerKeybindingRule(rule: IKeybindingRule, source: KeybindingRuleSource = KeybindingRuleSource.Core): void {
let actualKb = KeybindingsRegistryImpl.bindToCurrentPlatform(rule);
if (actualKb && actualKb.primary) {
this._registerDefaultKeybinding(createKeybinding(actualKb.primary, OS), rule.id, rule.weight, 0, rule.when);
this._registerDefaultKeybinding(createKeybinding(actualKb.primary, OS), rule.id, rule.weight, 0, rule.when, source);
}
if (actualKb && Array.isArray(actualKb.secondary)) {
for (let i = 0, len = actualKb.secondary.length; i < len; i++) {
const k = actualKb.secondary[i];
this._registerDefaultKeybinding(createKeybinding(k, OS), rule.id, rule.weight, -i - 1, rule.when);
this._registerDefaultKeybinding(createKeybinding(k, OS), rule.id, rule.weight, -i - 1, rule.when, source);
}
}
}
public registerKeybindingRule2(rule: IKeybindingRule2): void {
public registerKeybindingRule2(rule: IKeybindingRule2, source: KeybindingRuleSource = KeybindingRuleSource.Core): void {
let actualKb = KeybindingsRegistryImpl.bindToCurrentPlatform2(rule);
if (actualKb && actualKb.primary) {
this._registerDefaultKeybinding(actualKb.primary, rule.id, rule.weight, 0, rule.when);
this._registerDefaultKeybinding(actualKb.primary, rule.id, rule.weight, 0, rule.when, source);
}
}
public registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule): void {
this.registerKeybindingRule(desc);
public registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule, source: KeybindingRuleSource = KeybindingRuleSource.Core): void {
this.registerKeybindingRule(desc, source);
CommandsRegistry.registerCommand(desc);
}
@@ -204,8 +209,8 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry {
}
}
private _registerDefaultKeybinding(keybinding: Keybinding, commandId: string, weight1: number, weight2: number, when: ContextKeyExpr): void {
if (OS === OperatingSystem.Windows) {
private _registerDefaultKeybinding(keybinding: Keybinding, commandId: string, weight1: number, weight2: number, when: ContextKeyExpr, source: KeybindingRuleSource): void {
if (source === KeybindingRuleSource.Core && OS === OperatingSystem.Windows) {
if (keybinding.type === KeybindingType.Chord) {
this._assertNoCtrlAlt(keybinding.firstPart, commandId);
} else {