{"record":{"id":"53c0e7d310337ad0","repo":"neoclide/coc.nvim","slug":"name-not-exists","errorCode":null,"errorMessage":"${name} not exists","messagePattern":"(.+?) not exists","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/completion/source-vim.ts","lineNumber":16,"sourceCode":"'use strict'\nimport { Range } from 'vscode-languageserver-types'\nimport { getLineAndPosition } from '../core/ui'\nimport snippetManager from '../snippets/manager'\nimport { CancellationToken } from '../util/protocol'\nimport { byteSlice, characterIndex } from '../util/string'\nimport workspace from '../workspace'\nimport Source from './source'\nimport * as Is from '../util/is'\nimport { CompleteOption, CompleteResult, ExtendedCompleteItem } from './types'\n\nexport function getMethodName(name: string, names: ReadonlyArray<string>): string | undefined {\n  if (names.includes(name)) return name\n  let key = name[0].toUpperCase() + name.slice(1)\n  if (names.includes(key)) return key\n  throw new Error(`${name} not exists`)\n}\n\nexport function checkInclude(name: string, fns: ReadonlyArray<string>): boolean {\n  if (fns.includes(name)) return true\n  let key = name[0].toUpperCase() + name.slice(1)\n  return fns.includes(key)\n}\n\nexport default class VimSource extends Source {\n\n  private async callOptionalFunc(fname: string, args: any[], isNotify = false): Promise<any> {\n    let exists = checkInclude(fname, this.remoteFns)\n    if (!exists) return null\n    let name = `coc#source#${this.name}#${getMethodName(fname, this.remoteFns)}`\n    if (isNotify) return this.nvim.call(name, args, true)\n    return await this.nvim.call(name, args)\n  }\n","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/neoclide/coc.nvim/blob/50e974d9692461a69147d5cab146a8d3e439abe4/src/completion/source-vim.ts#L1-L34","documentation":"Remote (vim-script) completion sources expose config/complete functions whose names may be capitalized or not; getMethodName normalizes the case and throws when neither the given name nor its capitalized variant is found in the list of functions exported by the vim source file. It means the .vim source does not provide the expected function.","triggerScenarios":"A remote vim completion source file (autoload function set) lacks the required 'init' or 'complete' function (in either casing), so creating the source via createVimSources fails.","commonSituations":"Third-party .vim completion sources written against an old coc convention; typos like 'Complet' vs 'complete' in the source file's function names.","solutions":["Ensure the .vim source defines both coc#source#<name>#init and coc#source#<name>#complete (any capitalization)","Fix the function name casing in the source file","Update or reinstall the completion source plugin"],"exampleFix":"// before (in the .vim source)\nfunction! coc#source#mytag#Complet(...)\n// after\nfunction! coc#source#mytag#complete(...)","handlingStrategy":"validation","validationCode":"// verify the vim source exports required fns before loading\nconst fns = await nvim.call('coc#_remote_fns', name)\nconst has = (n) => fns.includes(n) || fns.includes(n[0].toUpperCase() + n.slice(1))\nif (!has('init') || !has('complete')) throw new Error(`source ${name} incomplete`)","typeGuard":"const isValidVimSource = (fns) =>\n  Array.isArray(fns) && ['init','complete'].every(n =>\n    fns.includes(n) || fns.includes(n[0].toUpperCase() + n.slice(1)))","tryCatchPattern":null,"preventionTips":["Define both init and complete functions in every .vim completion source","Keep function naming consistent with current coc source API","Test source loading with :CocList sources after changes"],"tags":["completion","vim-source","api-contract"],"backgroundTag":"missing-function","analyzedSha":"50e974d9692461a69147d5cab146a8d3e439abe4","analyzedAt":"2026-08-31T11:17:23.966Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}