Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -16,6 +16,7 @@ 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';
interface CurrentChord {
keypress: string;
@@ -32,18 +33,21 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
protected _onDidUpdateKeybindings: Emitter<IKeybindingEvent>;
private _contextKeyService: IContextKeyService;
protected _commandService: ICommandService;
private _statusService: IStatusbarService;
private _messageService: IMessageService;
protected _commandService: ICommandService;
protected _telemetryService: ITelemetryService;
constructor(
contextKeyService: IContextKeyService,
commandService: ICommandService,
telemetryService: ITelemetryService,
messageService: IMessageService,
statusService?: IStatusbarService
) {
this._contextKeyService = contextKeyService;
this._commandService = commandService;
this._telemetryService = telemetryService;
this._statusService = statusService;
this._messageService = messageService;
@@ -161,6 +165,13 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs || {}).done(undefined, err => {
this._messageService.show(Severity.Warning, err);
});
/* __GDPR__
"workbenchActionExecuted" : {
"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"from": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this._telemetryService.publicLog('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });
}
return shouldPreventDefault;

View File

@@ -162,7 +162,7 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry {
public registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule): void {
this.registerKeybindingRule(desc);
CommandsRegistry.registerCommand(desc.id, desc);
CommandsRegistry.registerCommand(desc);
}
private static _mightProduceChar(keyCode: KeyCode): boolean {

View File

@@ -19,6 +19,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';
import { OS } from 'vs/base/common/platform';
import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
function createContext(ctx: any) {
return {
@@ -40,7 +41,7 @@ suite('AbstractKeybindingService', () => {
messageService: IMessageService,
statusService?: IStatusbarService
) {
super(contextKeyService, commandService, messageService, statusService);
super(contextKeyService, commandService, NullTelemetryService, messageService, statusService);
this._resolver = resolver;
}
@@ -123,6 +124,7 @@ suite('AbstractKeybindingService', () => {
let messageService: IMessageService = {
_serviceBrand: undefined,
hideAll: undefined,
confirmSync: undefined,
confirm: undefined,
show: (sev: Severity, message: any): () => void => {
showMessageCalls.push({