Requires N:M multi-map to solve perfectly

This mapping has 7 all-to-all groups: every node on one side corresponds to every node on the other, and none is deleted or inserted. Each member carries an all N:M badge; selecting one highlights all of its counterparts, in the tree and in the code view alike.

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1fn main() {
2 foo();
3 foo();
4 foo();
5 bar();
6}
7

After

1fn main() {
2 bar();
3 foo();
4 foo();
5}
6

Before

source_file
function_item
fn "fn"
identifier "main"
parameters
( "("
) ")"
block
{ "{"
expression_statement all 3:2
call_expression all 3:2
identifier "foo" all 3:2
arguments all 3:2
( "(" all 3:2
) ")" all 3:2
; ";" all 3:2
expression_statement all 3:2
call_expression all 3:2
identifier "foo" all 3:2
arguments all 3:2
( "(" all 3:2
) ")" all 3:2
; ";" all 3:2
expression_statement all 3:2
call_expression all 3:2
identifier "foo" all 3:2
arguments all 3:2
( "(" all 3:2
) ")" all 3:2
; ";" all 3:2
expression_statement
call_expression
identifier "bar"
arguments
( "("
) ")"
; ";"
} "}"

After

source_file
function_item
fn "fn"
identifier "main"
parameters
( "("
) ")"
block
{ "{"
expression_statement
call_expression
identifier "bar"
arguments
( "("
) ")"
; ";"
expression_statement all 3:2
call_expression all 3:2
identifier "foo" all 3:2
arguments all 3:2
( "(" all 3:2
) ")" all 3:2
; ";" all 3:2
expression_statement all 3:2
call_expression all 3:2
identifier "foo" all 3:2
arguments all 3:2
( "(" all 3:2
) ")" all 3:2
; ";" all 3:2
} "}"