{"record":{"id":"3cba4cab9862f775","repo":"denoland/deno","slug":"unable-to-convert-completion-info","errorCode":null,"errorMessage":"Unable to convert completion info: {:#}","messagePattern":"Unable to convert completion info: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/ts_server.rs","lineNumber":650,"sourceCode":"          });\n        completion_info\n          .map(|completion_info| {\n            completion_info\n              .as_completion_response(\n                &module.line_index,\n                &snapshot\n                  .config\n                  .language_settings_for_specifier(&module.specifier)\n                  .cloned()\n                  .unwrap_or_default()\n                  .suggest,\n                module,\n                position,\n                language_server,\n                token,\n              )\n              .map_err(|err| {\n                anyhow!(\"Unable to convert completion info: {:#}\", err)\n              })\n          })\n          .transpose()\n      }\n    }\n  }\n\n  pub async fn resolve_completion_item(\n    &self,\n    module: &DocumentModule,\n    item: lsp::CompletionItem,\n    data: completions::CompletionItemData,\n    snapshot: Arc<StateSnapshot>,\n    token: &CancellationToken,\n  ) -> Result<lsp::CompletionItem, AnyError> {\n    match self {\n      Self::Js(ts_server) => {\n        let CompletionItemData::TsJs(data) = data else {","sourceCodeStart":632,"sourceCodeEnd":668,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lsp/ts_server.rs#L632-L668","documentation":"Autocomplete converts tsc's CompletionInfo into LSP completion items (get_completions in the source); this wraps a failure of that conversion. Causes include mapping the replacement range or detail spans against a line index that no longer matches the document (edits between request and conversion), and unexpected completion-entry shapes returned by the embedded TypeScript version.","triggerScenarios":"A textDocument/completion request where converting tsc's CompletionInfo fails — typically mid-typing churn where positions moved, or a specific entry (e.g. auto-import data) whose conversion is unsupported.","commonSituations":"Completion invoked during fast typing so the document changes under the request; a particular symbol or auto-import entry consistently failing conversion in older Deno builds.","solutions":["Keep typing or re-open the completion list — the next request re-syncs positions and usually succeeds.","Save the file and retry if one specific completion always fails.","Update the Deno CLI and IDE extension (completion-entry conversion bugs are patched regularly).","Run \"Deno: Restart Language Server\" if completions stay broken for a file."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Completion conversion usually fails against a moving document; re-trigger\n// the completion instead of surfacing the internal error.\nasync function completionsSafe(client, params) {\n  try {\n    return await client.sendRequest('textDocument/completion', params);\n  } catch (err) {\n    if (String(err?.message).includes('Unable to convert completion info')) {\n      await sleep(200); // let didChange flush\n      return await client.sendRequest('textDocument/completion', params);\n    }\n    throw err;\n  }\n}","preventionTips":["Re-open the completion list after edits settle rather than trusting a stale popup","Save the file if one specific completion always fails to appear","Keep Deno and the extension current; restart the language server if completions stay broken"],"tags":["lsp","completions","tsc","autocomplete"],"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"}