mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
perf(lsp): fix redundant walk when collecting tsc code lenses (#20974)
This commit is contained in:
parent
be97170a19
commit
79a9f2a77c
1 changed files with 5 additions and 0 deletions
|
@ -427,6 +427,11 @@ async fn collect_tsc(
|
||||||
line_index: Arc<LineIndex>,
|
line_index: Arc<LineIndex>,
|
||||||
navigation_tree: &NavigationTree,
|
navigation_tree: &NavigationTree,
|
||||||
) -> Result<Vec<lsp::CodeLens>, AnyError> {
|
) -> 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()));
|
let code_lenses = Rc::new(RefCell::new(Vec::new()));
|
||||||
navigation_tree.walk(&|i, mp| {
|
navigation_tree.walk(&|i, mp| {
|
||||||
let mut code_lenses = code_lenses.borrow_mut();
|
let mut code_lenses = code_lenses.borrow_mut();
|
||||||
|
|
Loading…
Reference in a new issue