mirror of
https://github.com/Microsoft/vscode
synced 2024-09-15 00:15:06 +00:00
Fixes #24022
This commit is contained in:
parent
75811f214d
commit
705fe98da2
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue