{"record":{"id":"f941b4c19dfa09ac","repo":"denoland/deno","slug":"unable-to-convert-completion-details","errorCode":null,"errorMessage":"Unable to convert completion details: {:#}","messagePattern":"Unable to convert completion details: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/ts_server.rs","lineNumber":686,"sourceCode":"        let CompletionItemData::TsJs(data) = data else {\n          return Ok(item);\n        };\n        match ts_server\n          .get_completion_details(\n            snapshot.clone(),\n            module,\n            data.position,\n            data.name.clone(),\n            data.source.clone(),\n            data.data.clone(),\n            token,\n          )\n          .await\n        {\n          Ok(Some(completion_details)) => completion_details\n            .as_completion_item(&item, &data, module, &snapshot)\n            .map_err(|err| {\n              anyhow!(\"Unable to convert completion details: {:#}\", err)\n            }),\n          Ok(None) => {\n            if !token.is_cancelled() {\n              lsp_warn!(\n                \"Received undefined completion details from TypeScript for item: {:#?}\",\n                &item,\n              );\n            }\n            Ok(item)\n          }\n          Err(err) => {\n            if !token.is_cancelled() {\n              lsp_warn!(\n                \"Unable to get completion details from TypeScript: {:#}\",\n                err\n              );\n            }\n            Ok(item)","sourceCodeStart":668,"sourceCodeEnd":704,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lsp/ts_server.rs#L668-L704","documentation":"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.","triggerScenarios":"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.","commonSituations":"Accepting a completion while an auto-save or formatter modified the file in between; older builds with resolve-conversion gaps for auto-import items.","solutions":["Re-trigger the completion list instead of accepting a stale item, so positions are recomputed.","Save the file and retry if one entry consistently fails to resolve.","Update the Deno CLI and extension; run \"Deno: Restart Language Server\" if resolve keeps failing."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// On resolve failures, keep the unresolved item — it still carries\n// label/kind from the original completion list.\nasync function resolveCompletionSafe(client, item) {\n  try {\n    return await client.sendRequest('completionItem/resolve', item);\n  } catch (err) {\n    if (String(err?.message).includes('Unable to convert completion details')) {\n      return item; // usable without the extra detail/documentation\n    }\n    throw err;\n  }\n}","preventionTips":["Re-trigger completions after document edits instead of accepting items from a stale list","Save between completing and accepting auto-import entries","Update Deno — resolve-conversion gaps for auto-import items get patched"],"tags":["lsp","completions","resolve","tsc"],"backgroundTag":"lsp-tsc-conversion-failed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}