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

1fun processUserInput(input: String?): String {
2 return input.uppercase()
3}
4
5fun main() {
6 val input: String? = null
7 val result = processUserInput(input)
8 println(result)
9}
10

After

1fun processUserInput(input: String?): String {
2 if (input == null) {
3 return ""
4 }
5 return input.uppercase()
6}
7
8fun main() {
9 val input: String? = null
10 val result = processUserInput(input)
11 println(result)
12}
13

Before

source_file
function_declaration
fun "fun"
identifier "processUserInput"
function_value_parameters
( "("
parameter
identifier "input"
: ":"
nullable_type
user_type
identifier "String"
? "?"
) ")"
: ":"
user_type
identifier "String"
function_body
block
{ "{"
return_expression
return "return"
call_expression
navigation_expression
identifier "input"
. "."
identifier "uppercase"
value_arguments
( "("
) ")"
} "}"
function_declaration (+40 nodes collapsed)

After

source_file
function_declaration
fun "fun"
identifier "processUserInput"
function_value_parameters
( "("
parameter
identifier "input"
: ":"
nullable_type
user_type
identifier "String"
? "?"
) ")"
: ":"
user_type
identifier "String"
function_body
block
{ "{"
if_expression
if "if"
( "("
binary_expression
identifier "input"
== "=="
identifier "null"
) ")"
block
{ "{"
return_expression
return "return"
string_literal
" "\""
" "\""
} "}"
return_expression
return "return"
call_expression
navigation_expression
identifier "input"
. "."
identifier "uppercase"
value_arguments
( "("
) ")"
} "}"
function_declaration (+40 nodes collapsed)