{"record":{"id":"e0b4c948a43f473e","repo":"neoclide/coc.nvim","slug":"links-provider-not-found","errorCode":null,"errorMessage":"Links provider not found.","messagePattern":"Links provider not found\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/list/source/links.ts","lineNumber":34,"sourceCode":"    super()\n\n    this.addAction('open', async item => {\n      let { target } = item.data\n      await workspace.openResource(target)\n    })\n\n    this.addAction('jump', async item => {\n      let { location } = item.data\n      await workspace.jumpTo(location.uri, location.range.start)\n    })\n  }\n\n  public async loadItems(context: ListContext, token: CancellationToken): Promise<ListItem[]> {\n    let buf = await context.window.buffer\n    let doc = workspace.getAttachedDocument(buf.id)\n    let items: ListItem[] = []\n    let links = await languages.getDocumentLinks(doc.textDocument, token)\n    if (links == null) throw new Error('Links provider not found.')\n    for (let link of links) {\n      link = link.target ? link : await languages.resolveDocumentLink(link, token)\n      if (link.target) {\n        items.push({\n          label: formatUri(link.target, workspace.cwd),\n          data: {\n            target: link.target,\n            location: Location.create(doc.uri, link.range)\n          }\n        })\n      }\n    }\n    return items\n  }\n}\n","sourceCodeStart":16,"sourceCodeEnd":50,"githubUrl":"https://github.com/neoclide/coc.nvim/blob/50e974d9692461a69147d5cab146a8d3e439abe4/src/list/source/links.ts#L16-L50","documentation":"The `links` list loads document links for the current buffer via the language client's `getDocumentLinks`. When the language server (or internal provider) returns null instead of an array, coc interprets that as 'no links provider registered for this document' and throws instead of returning an empty list.","triggerScenarios":"Running `:CocList links` in a buffer whose language has no documentLink provider registered, or whose language server returned null for a textDocument/documentLink request.","commonSituations":"Opening a file type with no LSP server attached (plain text, new buffer); the language server for the filetype failed to start; an LSP server that does not implement the documentLink capability; a broken/changed provider registration after an extension update.","solutions":["Install or enable a language server/extension that provides document links for the filetype","Check `:CocCommand workspace.showOutput` to confirm the language server started and advertises documentLinkProvider capability","Verify the buffer's filetype is detected correctly (`:set ft?`) and matches the extension's activation list","Guard the list usage: treat 'Links provider not found' as 'no links available for this file type'"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const doc = workspace.getAttachedDocument(buf.id)\nconst hasProvider = languages.hasProvider(ProviderName.DocumentLink, { uri: doc.uri, languageId: doc.languageId })\nif (!hasProvider) window.showMessage('No document links for this filetype', 'warning')","typeGuard":null,"tryCatchPattern":"try {\n  await cocList.start(['--normal', 'links'])\n} catch (e) {\n  if (/Links provider not found/.test(e.message)) {\n    window.showMessage('This filetype has no document link provider', 'warning')\n  } else throw e\n}","preventionTips":["Install a language server that supports documentLink for your filetypes","Check :checkhealth / :CocCommand workspace.showOutput for server startup failures","Verify filetype detection before invoking the links list"],"tags":["lsp","document-links","missing-provider"],"backgroundTag":"lsp-provider-not-registered","analyzedSha":"50e974d9692461a69147d5cab146a8d3e439abe4","analyzedAt":"2026-08-31T11:17:23.966Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}