mirror of
https://github.com/denoland/deno
synced 2024-08-24 18:47:06 +00:00
perf(lsp): fix redundant walk when collecting tsc code lenses (#20974)
This commit is contained in:
parent
be97170a19
commit
79a9f2a77c
|
@ -427,6 +427,11 @@ async fn collect_tsc(
|
|||
line_index: Arc<LineIndex>,
|
||||
navigation_tree: &NavigationTree,
|
||||
) -> Result<Vec<lsp::CodeLens>, AnyError> {
|
||||
if !workspace_settings.code_lens.implementations
|
||||
&& !workspace_settings.code_lens.references
|
||||
{
|
||||
return Ok(vec![]);
|
||||
}
|
||||
let code_lenses = Rc::new(RefCell::new(Vec::new()));
|
||||
navigation_tree.walk(&|i, mp| {
|
||||
let mut code_lenses = code_lenses.borrow_mut();
|
||||
|
|
Loading…
Reference in a new issue