mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
misc fixes
This commit is contained in:
parent
d929121f7b
commit
69e8393963
3 changed files with 20 additions and 26 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue