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

1// RUN: %swift -typecheck %s -verify -target arm64-apple-ios7.0 -parse-stdlib
2// RUN: %swift-ide-test -test-input-complete -source-filename=%s -target arm64-apple-ios7.0
3
4#if os(tvOS) || os(watchOS)
5// This block should not parse.
6// os(iOS) does not imply os(TVOS) or os(watchOS).
7let i: Int = "Hello"
8#endif
9
10#if arch(arm64) && os(iOS) && _runtime(_ObjC) && _endian(little) && _pointerBitWidth(_64)
11#if _hasAtomicBitWidth(_8) && _hasAtomicBitWidth(_16) && _hasAtomicBitWidth(_32) && _hasAtomicBitWidth(_64) && _hasAtomicBitWidth(_128)
12class C {}
13var x = C()
14#endif
15#endif
16var y = x
17

After

1// RUN: %swift -typecheck %s -verify -target arm64-apple-ios7.0 -parse-stdlib
2// RUN: %swift-ide-test -test-input-complete -source-filename=%s -target arm64-apple-ios7.0
3
4#if os(tvOS) || os(watchOS)
5// This block should not be type checked.
6// os(iOS) does not imply os(TVOS) or os(watchOS).
7let i: Int = "Hello"
8#endif
9
10#if arch(arm64) && os(iOS) && _runtime(_ObjC) && _endian(little) && _pointerBitWidth(_64)
11#if _hasAtomicBitWidth(_8) && _hasAtomicBitWidth(_16) && _hasAtomicBitWidth(_32) && _hasAtomicBitWidth(_64) && _hasAtomicBitWidth(_128)
12class C {}
13var x = C()
14#endif
15#endif
16var y = x
17
18#if os(anyAppleOS)
19// os(iOS) implies os(anyAppleOS)
20func hasAnyAppleOS() { }
21#endif
22hasAnyAppleOS()
23

Before

source_file
comment "// RUN: %swift -typecheck %s -verify -target arm64-apple-ios"...
comment "// RUN: %swift-ide-test -test-input-complete -source-filenam"...
directive
#if "#if"
os "os"
( "("
simple_identifier "tvOS"
) ")"
|| "||"
os "os"
( "("
simple_identifier "watchOS"
) ")"
comment "// This block should not parse."
comment "// os(iOS) does not imply os(TVOS) or os(watchOS)."
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "i"
type_annotation
: ":"
user_type
type_identifier "Int"
= "="
line_string_literal
" "\""
line_str_text "Hello"
" "\""
directive
#endif "#endif"
conjunction_expression (+40 nodes collapsed)
conjunction_expression (+50 nodes collapsed)
class_declaration
class "class"
type_identifier "C"
class_body
{ "{"
} "}"
property_declaration
value_binding_pattern
var "var"
pattern
simple_identifier "x"
= "="
call_expression
simple_identifier "C"
call_suffix
value_arguments
( "("
) ")"
directive
#endif "#endif"
directive
#endif "#endif"
property_declaration
value_binding_pattern
var "var"
pattern
simple_identifier "y"
= "="
simple_identifier "x"

After

source_file
comment "// RUN: %swift -typecheck %s -verify -target arm64-apple-ios"...
comment "// RUN: %swift-ide-test -test-input-complete -source-filenam"...
directive
#if "#if"
os "os"
( "("
simple_identifier "tvOS"
) ")"
|| "||"
os "os"
( "("
simple_identifier "watchOS"
) ")"
comment "// This block should not be type checked."
comment "// os(iOS) does not imply os(TVOS) or os(watchOS)."
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "i"
type_annotation
: ":"
user_type
type_identifier "Int"
= "="
line_string_literal
" "\""
line_str_text "Hello"
" "\""
directive
#endif "#endif"
conjunction_expression (+40 nodes collapsed)
conjunction_expression (+50 nodes collapsed)
class_declaration
class "class"
type_identifier "C"
class_body
{ "{"
} "}"
property_declaration
value_binding_pattern
var "var"
pattern
simple_identifier "x"
= "="
call_expression
simple_identifier "C"
call_suffix
value_arguments
( "("
) ")"
directive
#endif "#endif"
directive
#endif "#endif"
property_declaration
value_binding_pattern
var "var"
pattern
simple_identifier "y"
= "="
simple_identifier "x"
directive
#if "#if"
os "os"
( "("
simple_identifier "anyAppleOS"
) ")"
comment "// os(iOS) implies os(anyAppleOS)"
function_declaration
func "func"
simple_identifier "hasAnyAppleOS"
( "("
) ")"
function_body
{ "{"
} "}"
directive
#endif "#endif"
call_expression
simple_identifier "hasAnyAppleOS"
call_suffix
value_arguments
( "("
) ")"