From 29f740bf0e59666b5c53042dd0f6a8a27ad36b3a Mon Sep 17 00:00:00 2001 From: skcd Date: Wed, 21 Feb 2024 13:39:28 +0000 Subject: [PATCH] [sidecar] return false answer early --- sidecar/src/inline_completion/types.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sidecar/src/inline_completion/types.rs b/sidecar/src/inline_completion/types.rs index 598eae3e5..0b05644b1 100644 --- a/sidecar/src/inline_completion/types.rs +++ b/sidecar/src/inline_completion/types.rs @@ -451,6 +451,9 @@ fn walk_tree_for_no_errors(cursor: &mut TreeCursor, inserted_range: &Range) -> b if cursor.goto_first_child() { answer = answer && walk_tree_for_no_errors(cursor, inserted_range); + if !answer { + return answer; + } cursor.goto_parent(); }