Skip to content

Commit e4f6d24

Browse files
committed
Flatten this out too
1 parent dea921d commit e4f6d24

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

crates/ark/src/lsp/completions/completion_utils.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,22 @@ pub fn check_for_function_value(context: &DocumentContext, node_context: &NodeCo
129129
}
130130

131131
pub fn check_for_help(node_context: &NodeContext) -> bool {
132-
if let Some(parent_node) = node_context.parent_node {
133-
if parent_node.is_unary_operator() {
134-
if let NodeType::UnaryOperator(UnaryOperatorType::Help) = parent_node.node_type() {
135-
return true;
136-
}
137-
}
132+
if node_context.parent_node.is_none() {
133+
return false;
138134
}
139-
false
135+
136+
let parent_node = node_context.parent_node.unwrap();
137+
138+
if !parent_node.is_unary_operator() {
139+
return false;
140+
}
141+
142+
if !matches!(
143+
parent_node.node_type(),
144+
NodeType::UnaryOperator(UnaryOperatorType::Help)
145+
) {
146+
return false;
147+
}
148+
149+
true
140150
}

0 commit comments

Comments
 (0)