any 3:2 multi-map group: any pairing of the 3 with the 2 is valid, one is shown
all 3:1 all-to-all group: each of the 3 corresponds to the 1
inserted
deleted
updated
moved
click a highlight to reveal its counterpart
This mapping has 2 multi-map groups: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.
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
1function fetchData() {
2 return new Promise((resolve) => {
3 setTimeout(() => {
4resolve("data");
5 }, 1000);
6 });
7}
8
9fetchData().then((data) => {
10 console.log(data);
11});
12
After
1function fetchData() {
2 return new Promise((resolve, reject) => {
3 setTimeout(() => {
4try {
5resolve("data");
6} catch (error) {
7 reject(error);
8 }
9 }, 1000);
10 });
11}
12
13fetchData()
14.then((data) => {
15 console.log(data);
16 })
17.catch((error) => {
18 console.error("Error:", error);
19 });
20
Before
1function fetchData() {
2 return new Promise((resolve) => {
3 setTimeout(() => {
4 resolve("data");
5 }, 1000);
6 });
7}
8
9fetchData().then((data) => {
10 console.log(data);
11});
12
After
1function fetchData() {
2 return new Promise((resolve, reject) => {
3 setTimeout(() => {
4try {
5 resolve("data");
6} catch (error) {
7reject(error);
8}
9 }, 1000);
10 });
11}
12
13fetchData()
14 .then((data) => {
15 console.log(data);
16 })
17.catch((error) => {
18console.error("Error:", error);
19});
20
Before
1function fetchData() {
2 return new Promise((resolve) => {
3 setTimeout(() => {
4resolve("data");
5 }, 1000);
6 });
7}
8
9fetchData().then((data) => {
10 console.log(data);
11});
12
After
1function fetchData() {
2 return new Promise((resolve, reject) => {
3 setTimeout(() => {
4 try {
5resolve("data");
6 } catch (error) {
7 reject(error);
8 }
9 }, 1000);
10 });
11}
12
13fetchData()
14 .then((data) => {
15 console.log(data);
16 })
17 .catch((error) => {
18 console.error("Error:", error);
19 });
20
Before
programfunction_declaration
function "function"
identifier "fetchData"
formal_parameters
( "("
) ")"
statement_block
{ "{"
return_statement
return "return"
new_expression
new "new"
identifier "Promise"
arguments
( "("
arrow_functionformal_parameters
( "("
identifier "resolve"
) ")"
=> "=>"
statement_block
{ "{"
expression_statementcall_expression
identifier "setTimeout"
arguments
( "("
arrow_functionformal_parameters
( "("
) ")"
=> "=>"
statement_block
{ "{"
expression_statementcall_expression
identifier "resolve"
arguments
( "("
string
" "\""
string_fragment "data"
" "\""
) ")"
; ";"
} "}"
, ","
number "1000"
) ")"
; ";"
} "}"
) ")"
; ";"
} "}"
expression_statementcall_expression any 2:3member_expression any 1:2call_expression any 2:3
identifier "fetchData"
arguments
( "("
) ")"
. "."
property_identifier "then"
arguments (+23 nodes collapsed)
; ";"
After
programfunction_declaration
function "function"
identifier "fetchData"
formal_parameters
( "("
) ")"
statement_block
{ "{"
return_statement
return "return"
new_expression
new "new"
identifier "Promise"
arguments
( "("
arrow_functionformal_parameters
( "("
identifier "resolve"
, ","
identifier "reject"
) ")"
=> "=>"
statement_block
{ "{"
expression_statementcall_expression
identifier "setTimeout"
arguments
( "("
arrow_functionformal_parameters
( "("
) ")"
=> "=>"
statement_block
{ "{"
try_statement
try "try"
statement_block
{ "{"
expression_statementcall_expression
identifier "resolve"
arguments
( "("
string
" "\""
string_fragment "data"
" "\""
) ")"
; ";"
} "}"
catch_clause
catch "catch"
( "("
identifier "error"
) ")"
statement_block
{ "{"
expression_statementcall_expression
identifier "reject"
arguments
( "("
identifier "error"
) ")"
; ";"
} "}"
} "}"
, ","
number "1000"
) ")"
; ";"
} "}"
) ")"
; ";"
} "}"
expression_statementcall_expression any 2:3member_expression any 1:2call_expression any 2:3member_expression any 1:2call_expression any 2:3