MCPcopy
hub / github.com/codeaashu/claude-code / checkReservedShortcuts

Function checkReservedShortcuts

src/keybindings/validate.ts:373–399  ·  view source on GitHub ↗
(
  bindings: ParsedBinding[],
)

Source from the content-addressed store, hash-verified

371 * Check for reserved shortcuts that may not work.
372 */
373export function checkReservedShortcuts(
374 bindings: ParsedBinding[],
375): KeybindingWarning[] {
376 const warnings: KeybindingWarning[] = []
377 const reserved = getReservedShortcuts()
378
379 for (const binding of bindings) {
380 const keyDisplay = chordToString(binding.chord)
381 const normalizedKey = normalizeKeyForComparison(keyDisplay)
382
383 // Check against reserved shortcuts
384 for (const res of reserved) {
385 if (normalizeKeyForComparison(res.key) === normalizedKey) {
386 warnings.push({
387 type: 'reserved',
388 severity: res.severity,
389 message: `"${keyDisplay}" may not work: ${res.reason}`,
390 key: keyDisplay,
391 context: binding.context,
392 action: binding.action ?? undefined,
393 })
394 }
395 }
396 }
397
398 return warnings
399}
400
401/**
402 * Parse user blocks into bindings for validation.

Callers 1

validateBindingsFunction · 0.85

Calls 4

getReservedShortcutsFunction · 0.85
chordToStringFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected