提交 705fe98d 编写于 作者: A Alex Dima

Fixes #24022

上级 75811f21
...@@ -19,14 +19,12 @@ export interface IResolveResult { ...@@ -19,14 +19,12 @@ export interface IResolveResult {
export class KeybindingResolver { export class KeybindingResolver {
private readonly _defaultKeybindings: ResolvedKeybindingItem[]; private readonly _defaultKeybindings: ResolvedKeybindingItem[];
private readonly _keybindings: ResolvedKeybindingItem[]; private readonly _keybindings: ResolvedKeybindingItem[];
private readonly _shouldWarnOnConflict: boolean;
private readonly _defaultBoundCommands: Map<string, boolean>; private readonly _defaultBoundCommands: Map<string, boolean>;
private readonly _map: Map<string, ResolvedKeybindingItem[]>; private readonly _map: Map<string, ResolvedKeybindingItem[]>;
private readonly _lookupMap: 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._defaultKeybindings = defaultKeybindings;
this._shouldWarnOnConflict = shouldWarnOnConflict;
this._defaultBoundCommands = new Map<string, boolean>(); this._defaultBoundCommands = new Map<string, boolean>();
for (let i = 0, len = defaultKeybindings.length; i < len; i++) { for (let i = 0, len = defaultKeybindings.length; i < len; i++) {
...@@ -125,10 +123,6 @@ export class KeybindingResolver { ...@@ -125,10 +123,6 @@ export class KeybindingResolver {
if (KeybindingResolver.whenIsEntirelyIncluded(true, conflict.when, item.when)) { if (KeybindingResolver.whenIsEntirelyIncluded(true, conflict.when, item.when)) {
// `item` completely overwrites `conflict` // `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 // Remove conflict from the lookupMap
this._removeFromLookupMap(conflict); this._removeFromLookupMap(conflict);
} }
......
...@@ -140,7 +140,7 @@ suite('AbstractKeybindingService', () => { ...@@ -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); return new TestKeybindingService(resolver, contextKeyService, commandService, messageService, statusbarService);
}; };
......
...@@ -322,7 +322,7 @@ suite('KeybindingResolver', () => { ...@@ -322,7 +322,7 @@ suite('KeybindingResolver', () => {
) )
]; ];
let resolver = new KeybindingResolver(items, [], false); let resolver = new KeybindingResolver(items, []);
let testKey = (commandId: string, expectedKeys: number[]) => { let testKey = (commandId: string, expectedKeys: number[]) => {
// Test lookup // Test lookup
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册