neoclide/coc.nvim · warning

No workspace symbols provider registered

Error message

No workspace symbols provider registered

What it means

The `symbols` list queries workspace symbols. Before querying, it checks with `languages.hasProvider(ProviderName.WorkspaceSymbols, ...)` whether any provider is registered for workspace symbols; if none is, it throws instead of calling `getWorkspaceSymbols`.

Source

Thrown at src/list/source/symbols.ts:41

export default class Symbols extends LocationList {
  public readonly interactive = true
  public readonly description = 'search workspace symbols'
  public readonly detail = 'Symbols list is provided by server, it works on interactive mode only.'
  public fuzzyMatch = workspace.createFuzzyMatch()
  public name = 'symbols'
  public options = [{
    name: '-k, -kind KIND',
    description: 'Filter symbols by kind.',
    hasValue: true
  }]

  public async loadItems(context: ListContext, token: CancellationToken): Promise<ListItem[]> {
    let { input } = context
    let args = this.parseArguments(context.args)
    let filterKind = args.kind ? args.kind.toString().toLowerCase() : ''
    if (!languages.hasProvider(ProviderName.WorkspaceSymbols, { uri: 'file:///1', languageId: '' })) {
      throw new Error('No workspace symbols provider registered')
    }
    let symbols = await languages.getWorkspaceSymbols(input, token)
    if (token.isCancellationRequested) return []
    let config = this.getConfig()
    let excludes = config.get<string[]>('excludes', [])
    let items: (ListItem & ItemToSort)[] = []
    this.fuzzyMatch.setPattern(input, true)
    for (let s of symbols) {
      let kind = getSymbolKind(s.kind)
      if (filterKind && kind.toLowerCase() != filterKind) {
        continue
      }
      let file = formatUri(s.location.uri, workspace.cwd)
      if (excludes.some(p => minimatch(file, p))) {
        continue
      }
      let item = await this.createListItem(input, s, kind, file)
      if (token.isCancellationRequested) break

View on GitHub (pinned to 50e974d969)

Solutions

  1. Install/enable a language server extension that provides workspace symbols (e.g. coc-tsserver for TS/JS)
  2. Confirm with `:CocCommand workspace.showOutput` that the server advertises workspaceSymbolProvider
  3. Wait for the language server to finish initializing before listing symbols
  4. Check the buffer filetype is detected so the provider extension activates
Defensive patterns

Strategy: validation

Validate before calling

if (!languages.hasProvider(ProviderName.WorkspaceSymbols, { uri: 'file:///1', languageId: '' })) {
  window.showMessage('No workspace symbols provider — install a language server extension first', 'warning')
} else {
  await cocList.start(['--normal', 'symbols'])
}

Try / catch

try {
  await cocList.start(['--normal', 'symbols', input])
} catch (e) {
  if (/No workspace symbols provider/.test(e.message)) {
    window.showMessage('Install a language server with workspace symbol support', 'warning')
  } else throw e
}

Prevention

When it happens

Trigger: Running `:CocList symbols` (or `:CocList symbols -k kind`) in a workspace where no language server or extension registered a workspaceSymbolProvider.

Common situations: No LSP server attached for any open file; the language server does not implement the workspace/symbol capability; TypeScript/other extension not installed or failed to activate; querying before the server finished initializing.

Related errors


AI-assisted analysis of neoclide/coc.nvim@50e974d969 (2026-08-31). Data as JSON: /api/errors/bf90385f8f39761f. Report an issue: GitHub.