{"record":{"id":"4bea4a06b4d1ed4c","repo":"denoland/deno","slug":"unable-to-convert-definition-info","errorCode":null,"errorMessage":"Unable to convert definition info: {:#}","messagePattern":"Unable to convert definition info: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/ts_server.rs","lineNumber":565,"sourceCode":"      Self::Js(ts_server) => {\n        let definition_info = ts_server\n          .get_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            .flat_map(|i| &i.definitions)\n            .flatten()\n            .map(|i| (&i.document_span, module)),\n          snapshot,\n          token,\n        )\n        .map_err(|err| anyhow!(\"Unable to convert definition info: {:#}\", err))\n      }\n    }\n  }\n\n  pub async fn provide_type_definition(\n    &self,\n    module: &DocumentModule,\n    position: lsp::Position,\n    snapshot: &Arc<StateSnapshot>,\n    token: &CancellationToken,\n  ) -> Result<Option<lsp::request::GotoTypeDefinitionResponse>, AnyError> {\n    match self {\n      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)?,","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lsp/ts_server.rs#L547-L583","documentation":"Go-to-definition results from tsc (definition info entries) are converted into an LSP GotoDefinitionResponse via DocumentSpan::collect_into_goto_definition_response; this wraps a failure of that conversion. Failures usually come from mapping a definition's span in the TARGET document — resolving the target file's line index or converting its span can fail even though the file the request was made from is fine.","triggerScenarios":"A textDocument/definition request where one returned definition span fails to convert — the target document changed or was closed between snapshot and conversion, or the span falls outside the target's current content.","commonSituations":"Ctrl+click / Go to Definition immediately after edits in the destination file; definitions inside generated or just-created files whose snapshot state is inconsistent.","solutions":["Save dirty files (especially likely jump targets) and retry the navigation.","Retry the request — transient snapshot races clear on the next attempt.","Run \"Deno: Restart Language Server\" if a specific target file always fails.","Update Deno; inspect the wrapped error after the colon in the language server output."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Definition conversion failures are transient snapshot races on target\n// documents; retry once, then surface a soft 'no definition found'.\nasync function definitionSafe(client, params) {\n  try {\n    return await client.sendRequest('textDocument/definition', params);\n  } catch (err) {\n    if (String(err?.message).includes('Unable to convert definition info')) {\n      await sleep(250);\n      return await client.sendRequest('textDocument/definition', params);\n    }\n    throw err;\n  }\n}","preventionTips":["Save likely jump-target files before navigating to definitions","Retry navigation after a moment instead of assuming the definition is missing","Restart the language server when one target file always fails; keep Deno updated"],"tags":["lsp","go-to-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"}