denoland/deno · error

Unable to convert completion details: {:#}

Error message

Unable to convert completion details: {:#}

What it means

On completionItem/resolve, tsc completion details are merged into the chosen LSP item via as_completion_item; this wraps a conversion failure at that second-phase round trip. Because resolve happens after the user interacted with the list, the document frequently changed since the original completion request — stale positions are the classic cause. Note the adjacent code tolerates a None details result with only a warning; an actual conversion error is what produces this message.

Source

Thrown at cli/lsp/ts_server.rs:686

        let CompletionItemData::TsJs(data) = data else {
          return Ok(item);
        };
        match ts_server
          .get_completion_details(
            snapshot.clone(),
            module,
            data.position,
            data.name.clone(),
            data.source.clone(),
            data.data.clone(),
            token,
          )
          .await
        {
          Ok(Some(completion_details)) => completion_details
            .as_completion_item(&item, &data, module, &snapshot)
            .map_err(|err| {
              anyhow!("Unable to convert completion details: {:#}", err)
            }),
          Ok(None) => {
            if !token.is_cancelled() {
              lsp_warn!(
                "Received undefined completion details from TypeScript for item: {:#?}",
                &item,
              );
            }
            Ok(item)
          }
          Err(err) => {
            if !token.is_cancelled() {
              lsp_warn!(
                "Unable to get completion details from TypeScript: {:#}",
                err
              );
            }
            Ok(item)

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Re-trigger the completion list instead of accepting a stale item, so positions are recomputed.
  2. Save the file and retry if one entry consistently fails to resolve.
  3. Update the Deno CLI and extension; run "Deno: Restart Language Server" if resolve keeps failing.
Defensive patterns

Strategy: fallback

Try / catch

// On resolve failures, keep the unresolved item — it still carries
// label/kind from the original completion list.
async function resolveCompletionSafe(client, item) {
  try {
    return await client.sendRequest('completionItem/resolve', item);
  } catch (err) {
    if (String(err?.message).includes('Unable to convert completion details')) {
      return item; // usable without the extra detail/documentation
    }
    throw err;
  }
}

Prevention

When it happens

Trigger: Resolving (selecting) a completion item after the document was edited since the completion was requested, so the stored position/data no longer maps; or an unexpected details shape from tsc for that entry.

Common situations: Accepting a completion while an auto-save or formatter modified the file in between; older builds with resolve-conversion gaps for auto-import items.

Related errors


AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20). Data as JSON: /api/errors/f941b4c19dfa09ac. Report an issue: GitHub.