This commit is contained in:
Alex Dima 2017-04-12 17:50:54 +02:00
parent 75811f214d
commit 705fe98da2
3 changed files with 3 additions and 9 deletions

View file

@ -19,14 +19,12 @@ export interface IResolveResult {
export class KeybindingResolver {
private readonly _defaultKeybindings: ResolvedKeybindingItem[];
private readonly _keybindings: ResolvedKeybindingItem[];
private readonly _shouldWarnOnConflict: boolean;
private readonly _defaultBoundCommands: Map<string, boolean>;
private readonly _map: Map<string, ResolvedKeybindingItem[]>;
private readonly _lookupMap: Map<string, ResolvedKeybindingItem[]>;
constructor(defaultKeybindings: ResolvedKeybindingItem[], overrides: ResolvedKeybindingItem[], shouldWarnOnConflict: boolean = true) {
constructor(defaultKeybindings: ResolvedKeybindingItem[], overrides: ResolvedKeybindingItem[]) {
this._defaultKeybindings = defaultKeybindings;
this._shouldWarnOnConflict = shouldWarnOnConflict;
this._defaultBoundCommands = new Map<string, boolean>();
for (let i = 0, len = defaultKeybindings.length; i < len; i++) {
@ -125,10 +123,6 @@ export class KeybindingResolver {
if (KeybindingResolver.whenIsEntirelyIncluded(true, conflict.when, item.when)) {
// `item` completely overwrites `conflict`
if (this._shouldWarnOnConflict && item.isDefault) {
console.warn('Conflict detected, command `' + conflict.command + '` cannot be triggered due to ' + item.command);
}
// Remove conflict from the lookupMap
this._removeFromLookupMap(conflict);
}

View file

@ -140,7 +140,7 @@ suite('AbstractKeybindingService', () => {
}
};
let resolver = new KeybindingResolver(items, [], false);
let resolver = new KeybindingResolver(items, []);
return new TestKeybindingService(resolver, contextKeyService, commandService, messageService, statusbarService);
};

View file

@ -322,7 +322,7 @@ suite('KeybindingResolver', () => {
)
];
let resolver = new KeybindingResolver(items, [], false);
let resolver = new KeybindingResolver(items, []);
let testKey = (commandId: string, expectedKeys: number[]) => {
// Test lookup