{"record":{"id":"6076b222570563f6","repo":"denoland/deno","slug":"unable-to-convert-type-definition-info","errorCode":null,"errorMessage":"Unable to convert type definition info: {:#}","messagePattern":"Unable to convert type definition info: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/ts_server.rs","lineNumber":596,"sourceCode":"      Self::Js(ts_server) => {\n        let definition_info = ts_server\n          .get_type_definition(\n            snapshot.clone(),\n            module,\n            module.line_index.offset_tsc(position)?,\n            token,\n          )\n          .await?;\n        super::tsc::DocumentSpan::collect_into_goto_definition_response(\n          definition_info\n            .iter()\n            .flatten()\n            .map(|i| (&i.document_span, module)),\n          snapshot,\n          token,\n        )\n        .map_err(|err| {\n          anyhow!(\"Unable to convert type definition info: {:#}\", err)\n        })\n      }\n    }\n  }\n\n  pub async fn provide_completion(\n    &self,\n    module: &DocumentModule,\n    position: lsp::Position,\n    context: Option<&lsp::CompletionContext>,\n    language_server: &language_server::Inner,\n    snapshot: Arc<StateSnapshot>,\n    token: &CancellationToken,\n  ) -> Result<Option<lsp::CompletionResponse>, AnyError> {\n    match self {\n      Self::Js(ts_server) => {\n        let position = module.line_index.offset_tsc(position)?;\n        let completion_info = ts_server","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lsp/ts_server.rs#L578-L614","documentation":"Same conversion path as go-to-definition but for textDocument/typeDefinition: tsc's type-definition info is converted through DocumentSpan::collect_into_goto_definition_response and a failure is wrapped with this message. Root causes are span-to-range conversion failures in the target documents where the types are declared, not the mechanics of the request itself.","triggerScenarios":"A textDocument/typeDefinition request where converting a returned document span fails — the target type-declaration file changed since the snapshot, or its span no longer maps to current content.","commonSituations":"Jumping to type definition right after editing the file that declares the type; targets in .d.ts or generated files with stale snapshots.","solutions":["Save the file(s) involved and retry the type-definition navigation.","Run \"Deno: Restart Language Server\" when a specific target keeps failing.","Update the Deno CLI and extension.","Check the wrapped error after the colon in the Deno Language Server output panel."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Type-definition conversion: same transient shape as definition — retry\n// once before giving up.\nasync function typeDefinitionSafe(client, params) {\n  try {\n    return await client.sendRequest('textDocument/typeDefinition', params);\n  } catch (err) {\n    if (String(err?.message).includes('Unable to convert type definition info')) {\n      await sleep(250);\n      return await client.sendRequest('textDocument/typeDefinition', params);\n    }\n    throw err;\n  }\n}","preventionTips":["Save declaration files (including .d.ts) before jumping to type definitions","Retry the navigation — snapshot races clear on the next request","Restart the language server and update Deno when a specific type target keeps failing"],"tags":["lsp","go-to-type-definition","tsc","navigation"],"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-14T05:17:10.506Z"}