{"record":{"id":"f9e6117da3762389","repo":"neoclide/coc.nvim","slug":"select-kind-kind-not-supported","errorCode":null,"errorMessage":"select kind \"${kind}\" not supported","messagePattern":"select kind \"(.+?)\" not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cursors/index.ts","lineNumber":114,"sourceCode":"      let line = doc.getline(pos.line)\n      if (pos.character >= line.length) {\n        range = Range.create(pos.line, Math.max(0, line.length - 1), pos.line, line.length)\n      } else {\n        range = Range.create(pos.line, pos.character, pos.line, pos.character + 1)\n      }\n      session.addRange(range)\n      await nvim.command(`silent! call repeat#set(\"\\\\<Plug>(coc-cursors-${kind})\", -1)`)\n    } else if (kind == 'range') {\n      await nvim.call('eval', 'feedkeys(\"\\\\<esc>\", \"in\")')\n      let range = await window.getSelectedRange(mode)\n      if (range) {\n        let ranges = mode == '\\x16' ? getVisualRanges(doc, range) : splitRange(doc, range)\n        for (let r of ranges) {\n          session.addRange(r)\n        }\n      }\n    } else {\n      throw new Error(`select kind \"${kind}\" not supported`)\n    }\n    session.checkRanges()\n  }\n\n  public createSession(doc: Document): CursorSession {\n    let { bufnr } = doc\n    let session = this.getSession(bufnr)\n    if (session) return session\n    session = new CursorSession(this.nvim, doc, this.config)\n    this.sessionsMap.set(bufnr, session)\n    session.onDidCancel(() => {\n      session.dispose()\n      this.sessionsMap.delete(bufnr)\n    })\n    return session\n  }\n\n  // Add ranges to current document","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/neoclide/coc.nvim/blob/50e974d9692461a69147d5cab146a8d3e439abe4/src/cursors/index.ts#L96-L132","documentation":"CursorManager.select dispatches on the 'kind' argument; only known kinds (e.g. character-wise selection modes) are handled. Any other kind string reaches the else branch and throws. It signals an unsupported selection kind was requested for multi-cursor selection.","triggerScenarios":"Calling cursors.select(range, kind) with a kind other than the supported mode characters/values (e.g. 'v', '\\x16' visual, or line kinds handled above) — any unrecognized string or number kind.","commonSituations":"Extension or mapping code passes a descriptive string like 'block' or 'line' that the API doesn't support; copy-pasted code from a different coc-cursors version; typo in the kind parameter.","solutions":["Use one of the supported kind values accepted by select (check the select signature/docs in src/cursors/index.ts).","Map your custom kind to a supported one before calling select.","Upgrade coc-cursors/coc.nvim if a newer version supports the kind you need."],"exampleFix":"// before\nawait cursors.select(range, 'block') // throws\n// after\nawait cursors.select(range, 'v') // supported character-wise visual kind","handlingStrategy":"validation","validationCode":"const SUPPORTED_KINDS = ['v', '\\x16' /* ctrl-v */, 'V']\nif (!SUPPORTED_KINDS.includes(kind)) {\n  throw new Error(`Unsupported select kind: ${kind}`)\n}","typeGuard":"function isSelectKind(v: unknown): v is 'v' | '\\x16' | 'V' {\n  return typeof v === 'string' && ['v', '\\x16', 'V'].includes(v)\n}","tryCatchPattern":"try {\n  await cursors.select(range, kind)\n} catch (e) {\n  if (e.message.includes('not supported')) {\n    logger.warn(`kind ${kind} unsupported, defaulting to 'v'`)\n    await cursors.select(range, 'v')\n  } else throw e\n}","preventionTips":["Check the select() signature in src/cursors/index.ts and use only documented kinds.","Type the kind argument as a union of supported values.","Map user-facing mode names ('block', 'line') to supported kind characters before calling."],"tags":["cursors","invalid-argument","api-misuse"],"backgroundTag":"unsupported-enum-value","analyzedSha":"50e974d9692461a69147d5cab146a8d3e439abe4","analyzedAt":"2026-08-31T11:17:23.966Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}