diff options
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r-- | cli/lsp/tsc.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 79c1817e2..335d91ed7 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -1024,15 +1024,19 @@ impl NavigationTree { ) -> bool { let mut should_include = self.should_include_entry(); if !should_include - && self.child_items.as_ref().map_or(true, |v| v.is_empty()) + && self + .child_items + .as_ref() + .map(|v| v.is_empty()) + .unwrap_or(true) { return false; } let children = self .child_items - .as_ref() - .map_or(&[] as &[NavigationTree], |v| v.as_slice()); + .as_deref() + .unwrap_or(&[] as &[NavigationTree]); for span in self.spans.iter() { let range = TextRange::at(span.start.into(), span.length.into()); let mut symbol_children = Vec::<lsp::DocumentSymbol>::new(); @@ -1514,7 +1518,8 @@ impl RefactorActionInfo { .iter() .find(|action| action.matches(&self.name)); maybe_match - .map_or(lsp::CodeActionKind::REFACTOR, |action| action.kind.clone()) + .map(|action| action.kind.clone()) + .unwrap_or(lsp::CodeActionKind::REFACTOR) } } |