Skip to content

Commit 49094db

Browse files
Merge pull request #21962 from ChayimFriedman2/fix-syntaxeditor
fix: Fix SyntaxEditor upmapping of nodes with mapped ancestor that aren't mapped themselves
2 parents b2ce569 + 3cbcf89 commit 49094db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/syntax/src/syntax_editor/mapping.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl SyntaxMapping {
161161
// Try to follow the mapping tree, if it exists
162162
let input_mapping = self.upmap_node_single(input);
163163
let input_ancestor =
164-
input.ancestors().find_map(|ancestor| self.upmap_node_single(&ancestor));
164+
input.ancestors().find(|ancestor| self.upmap_node_single(ancestor).is_some());
165165

166166
match (input_mapping, input_ancestor) {
167167
(Some(input_mapping), _) => {

0 commit comments

Comments
 (0)