{"record":{"id":"c333a1d12595d467","repo":"denoland/deno","slug":"error-getting-navigation-tree-for","errorCode":null,"errorMessage":"Error getting navigation tree for \"{}\": {:#}","messagePattern":"Error getting navigation tree for \"(.+?)\": (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/ts_server.rs","lineNumber":221,"sourceCode":"  }\n\n  pub async fn provide_code_lenses(\n    &self,\n    module: &DocumentModule,\n    settings: &CodeLensSettings,\n    snapshot: Arc<StateSnapshot>,\n    token: &CancellationToken,\n  ) -> Result<Option<Vec<lsp::CodeLens>>, AnyError> {\n    match self {\n      Self::Js(ts_server) => {\n        if !settings.implementations && !settings.references {\n          return Ok(None);\n        }\n        let navigation_tree = ts_server\n          .get_navigation_tree(snapshot, module, token)\n          .await\n          .map_err(|err| {\n            anyhow!(\n              \"Error getting navigation tree for \\\"{}\\\": {:#}\",\n              &module.specifier,\n              err,\n            )\n          })?;\n        let code_lenses = crate::lsp::code_lens::collect_tsc(\n          &module.uri,\n          settings,\n          &module.line_index,\n          &navigation_tree,\n          token,\n        )?;\n        if code_lenses.is_empty() {\n          Ok(None)\n        } else {\n          Ok(Some(code_lenses))\n        }\n      }","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lsp/ts_server.rs#L203-L239","documentation":"The code lens provider (reference/implementations counts shown above symbols) first asks the embedded TypeScript compiler isolate for the file's navigation tree; this error wraps a failure of that tsc request for the given module specifier. The underlying tsc error text follows the colon. It usually indicates request cancellation or a tsc isolate-level failure for that document, not a problem with the user's source code.","triggerScenarios":"A textDocument/codeLens request while deno.codeLens.references or deno.codeLens.implementations is enabled, and ts_server.get_navigation_tree returns an error — the token was cancelled mid-flight, the tsc worker crashed or is wedged, or the module is in a state tsc cannot process.","commonSituations":"Large files edited rapidly while lenses are being computed; the language server under memory pressure; older Deno builds with tsc request bugs — typically intermittent in the Deno VS Code extension.","solutions":["Retry by moving the cursor or closing/reopening the file — most navigation-tree failures are transient cancellation races.","Run \"Deno: Restart Language Server\" from the command palette to reset the tsc isolate.","Read the wrapped error after the colon in the Deno Language Server output panel to identify the real tsc failure.","Update the Deno CLI and IDE extension to matching current versions; as a workaround set deno.codeLens.references and deno.codeLens.implementations to false."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Client side: navigation-tree failures are usually transient cancellation\n// races. Retry the codeLens request once after a short delay.\nasync function codeLensWithRetry(client, params) {\n  try {\n    return await client.sendRequest('textDocument/codeLens', params);\n  } catch (err) {\n    if (String(err?.message).includes('navigation tree')) {\n      await sleep(250);\n      return await client.sendRequest('textDocument/codeLens', params);\n    }\n    throw err;\n  }\n}","preventionTips":["Save files and let edits settle before relying on reference/implementation lenses","Restart the language server via the command palette when one file keeps failing","Keep the Deno CLI and IDE extension versions matched and current","As a last resort disable deno.codeLens.references and deno.codeLens.implementations"],"tags":["lsp","code-lens","tsc","navigation-tree","typescript"],"backgroundTag":"lsp-tsc-request-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"}