Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/syntax_editor/mapping.rs')
| -rw-r--r-- | crates/syntax/src/syntax_editor/mapping.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/syntax/src/syntax_editor/mapping.rs b/crates/syntax/src/syntax_editor/mapping.rs index b2c677c869..9bb5e6d933 100644 --- a/crates/syntax/src/syntax_editor/mapping.rs +++ b/crates/syntax/src/syntax_editor/mapping.rs @@ -1,3 +1,7 @@ +//! Maps syntax elements through disjoint syntax nodes. +//! +//! [`SyntaxMappingBuilder`] should be used to create mappings to add to a [`SyntaxEditor`] + use itertools::Itertools; use rustc_hash::FxHashMap; @@ -168,11 +172,11 @@ impl SyntaxMapping { match (input_mapping, input_ancestor) { (Some(input_mapping), _) => { // A mapping exists at the input, follow along the tree - Some(self.upmap_child(&input_mapping, &input_mapping, &output_root)) + Some(self.upmap_child(&input_mapping, &input_mapping, output_root)) } (None, Some(input_ancestor)) => { // A mapping exists at an ancestor, follow along the tree - Some(self.upmap_child(input, &input_ancestor, &output_root)) + Some(self.upmap_child(input, &input_ancestor, output_root)) } (None, None) => { // No mapping exists at all, is the same position in the final tree |