{"record":{"id":"5d0e07b644a352c3","repo":"neoclide/coc.nvim","slug":"invalid-action-action","errorCode":null,"errorMessage":"Invalid action ${action}","messagePattern":"Invalid action (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/list/mappings.ts","lineNumber":298,"sourceCode":"    if (Array.isArray(key)) {\n      for (let k of key) {\n        mappings.set(k, fn)\n      }\n    } else {\n      mappings.set(key, fn)\n    }\n  }\n\n  private addAction(key: string, fn: (expr?: string) => void | Promise<void>): void {\n    this.actions.set(key, fn)\n  }\n\n  public getAction(action: string): () => void | Promise<void> {\n    if (this.actions.has(action)) return () => {\n      return this.doAction(action)\n    }\n    let [key, expr] = action.split(':', 2)\n    if (!expr || !this.actions.has(key)) throw new Error(`Invalid action ${action}`)\n    return () => {\n      return this.doAction(key, expr)\n    }\n  }\n\n  public async doAction(key: string, expr?: string): Promise<void> {\n    let fn = this.actions.get(key)\n    if (!fn) throw new Error(`Action ${key} doesn't exist`)\n    await Promise.resolve(fn(expr))\n  }\n\n  private scrollPreview(dir: 'up' | 'down'): void {\n    const floatPreview = listConfiguration.get<boolean>('floatPreview', false)\n    let { nvim } = this\n    nvim.pauseNotification()\n    nvim.call('coc#list#scroll_preview', [dir, floatPreview], true)\n    nvim.command('redraw', true)\n    nvim.resumeNotification(false, true)","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/neoclide/coc.nvim/blob/50e974d9692461a69147d5cab146a8d3e439abe4/src/list/mappings.ts#L280-L316","documentation":"ListMappings.getAction resolves a list action name either to a registered action or to a key:expression pair (e.g. 'j:myexpr'). If the string is neither a known action nor a valid '<knownKey>:<expr>' form (missing expression or unknown key), it throws so the caller knows the mapping is invalid.","triggerScenarios":"Calling mappings.getAction(name) with a typo, an unregistered action name, a bare 'j:' with no expression, or a 'foo:expr' where 'foo' is not a registered action key.","commonSituations":"User-defined list mappings in coc-settings.json or list configuration referencing non-existent actions; extension authors wiring custom keybindings with wrong action names; version changes renaming list actions.","solutions":["Use a registered action name (see :CocList action docs / mappings.actions keys)","Ensure the '<key>:<expr>' form uses a valid action key before the colon and a non-empty expression","Check spelling against the built-in action list (do, quit, toggleSelect, etc.)","Update outdated custom mappings after upgrading coc.nvim"],"exampleFix":"// before\nmappings.getAction('dd:delete') // 'dd' not a registered key\n// after\nmappings.getAction('d:delete')  // 'd' is a registered action key","handlingStrategy":"validation","validationCode":"function canResolveAction(mappings: ListMappings, action: string): boolean {\n  const [key, expr] = action.split(':', 2)\n  return (expr === undefined && /* action exists check via try */ true) || (!!expr && action.split(':').length === 2 && !!key)\n}\n// Prefer: wrap in try/catch since registration set is internal to mappings","typeGuard":null,"tryCatchPattern":"let fn\ntry {\n  fn = mappings.getAction(name)\n} catch (e) {\n  if (String(e.message).startsWith('Invalid action')) {\n    console.warn(`Unknown list action '${name}', check coc-list mapping docs`)\n    return\n  }\n  throw e\n}","preventionTips":["Validate user-configured mappings at startup and warn early","Keep a lookup of valid action names from mappings to check against","Handle 'key:expr' strings with both parts non-empty","Test custom mappings after coc.nvim upgrades"],"tags":["list","mapping","validation","configuration"],"backgroundTag":"invalid-action-name","analyzedSha":"50e974d9692461a69147d5cab146a8d3e439abe4","analyzedAt":"2026-08-31T11:17:23.966Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}