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.

Before

…lines 1–7 unchanged (7 lines)
8// See https://swift.org/LICENSE.txt for license information
9//
10//===----------------------------------------------------------------------===//
11
12#if compiler(>=6.0)
13internal import ArgumentParserToolInfo
14internal import class Foundation.JSONEncoder
15#else
16import ArgumentParserToolInfo
17import class Foundation.JSONEncoder
18#endif
19
20internal struct DumpHelpGenerator {
21 private var toolInfo: ToolInfoV0
22
23 init(_ type: ParsableArguments.Type) {
24 self.init(commandStack: [type.asCommand])
25 }
26
27 init(commandStack: [ParsableCommand.Type]) {
28 self.toolInfo = ToolInfoV0(commandStack: commandStack)
29 }
30
31 func rendered() -> String {
32 let encoder = JSONEncoder()
33 encoder.outputFormatting = .prettyPrinted
34 encoder.outputFormatting.insert(.sortedKeys)
35 guard let encoded = try? encoder.encode(self.toolInfo) else { return "" }
36 return String(data: encoded, encoding: .utf8) ?? ""
37 }
38}
39
40extension BidirectionalCollection where Element == ParsableCommand.Type {
41 /// Returns the ArgumentSet for the last command in this stack, including
42 /// help and version flags, when appropriate.
…lines 43–219 unchanged (177 lines)

After

…lines 1–7 unchanged (7 lines)
8// See https://swift.org/LICENSE.txt for license information
9//
10//===----------------------------------------------------------------------===//
11
12#if compiler(>=6.0)
13internal import ArgumentParserToolInfo
14#else
15import ArgumentParserToolInfo
16#endif
17
18internal struct DumpHelpGenerator {
19 private var toolInfo: ToolInfoV0
20
21 init(_ type: ParsableArguments.Type) {
22 self.init(commandStack: [type.asCommand])
23 }
24
25 init(commandStack: [ParsableCommand.Type]) {
26 self.toolInfo = ToolInfoV0(commandStack: commandStack)
27 }
28
29 func rendered() -> String {
30 JSONEncoder.encode(self.toolInfo)
31 }
32}
33
34extension BidirectionalCollection where Element == ParsableCommand.Type {
35 /// Returns the ArgumentSet for the last command in this stack, including
36 /// help and version flags, when appropriate.
…lines 37–213 unchanged (177 lines)

Before

source_file
comment "//===-------------------------------------------------------"...
comment "//"
comment "// This source file is part of the Swift Argument Parser ope"...
comment "//"
comment "// Copyright (c) 2020 Apple Inc. and the Swift project autho"...
comment "// Licensed under Apache License v2.0 with Runtime Library E"...
comment "//"
comment "// See https://swift.org/LICENSE.txt for license information"
comment "//"
comment "//===-------------------------------------------------------"...
directive
#if "#if"
compiler "compiler"
( "("
>= ">="
integer_literal "6"
. "."
integer_literal "0"
) ")"
import_declaration
modifiers
visibility_modifier
internal "internal"
import "import"
identifier
simple_identifier "ArgumentParserToolInfo"
import_declaration
modifiers
visibility_modifier
internal "internal"
import "import"
class "class"
identifier
simple_identifier "Foundation"
. "."
simple_identifier "JSONEncoder"
directive
#else "#else"
import_declaration
import "import"
identifier
simple_identifier "ArgumentParserToolInfo"
import_declaration
import "import"
class "class"
identifier
simple_identifier "Foundation"
. "."
simple_identifier "JSONEncoder"
directive
#endif "#endif"
class_declaration
modifiers
visibility_modifier
internal "internal"
struct "struct"
type_identifier "DumpHelpGenerator"
class_body
{ "{"
property_declaration
modifiers
visibility_modifier
private "private"
value_binding_pattern
var "var"
pattern
simple_identifier "toolInfo"
type_annotation
: ":"
user_type
type_identifier "ToolInfoV0"
init_declaration (+39 nodes collapsed)
init_declaration (+38 nodes collapsed)
function_declaration
func "func"
simple_identifier "rendered"
( "("
) ")"
-> "->"
user_type
type_identifier "String"
function_body
{ "{"
statements
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "encoder"
= "="
call_expression
simple_identifier "JSONEncoder"
call_suffix
value_arguments
( "("
) ")"
assignment
directly_assignable_expression
navigation_expression any 4:1
simple_identifier "encoder"
navigation_suffix
. "."
simple_identifier "outputFormatting"
= "="
prefix_expression
. "."
simple_identifier "prettyPrinted"
call_expression any 3:1
navigation_expression any 4:1
navigation_expression any 4:1
simple_identifier "encoder"
navigation_suffix
. "."
simple_identifier "outputFormatting"
navigation_suffix
. "."
simple_identifier "insert"
call_suffix
value_arguments
( "("
value_argument
prefix_expression
. "."
simple_identifier "sortedKeys"
) ")"
guard_statement
guard "guard"
value_binding_pattern
let "let"
simple_identifier "encoded"
= "="
try_expression
try_operator
try "try"
? "?"
call_expression any 3:1
navigation_expression any 4:1
simple_identifier "encoder"
navigation_suffix
. "."
simple_identifier "encode"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
self_expression
self "self"
navigation_suffix
. "."
simple_identifier "toolInfo"
) ")"
else "else"
{ "{"
statements
control_transfer_statement
return "return"
line_string_literal
" "\""
" "\""
} "}"
control_transfer_statement
return "return"
nil_coalescing_expression
call_expression any 3:1
simple_identifier "String"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "data"
: ":"
simple_identifier "encoded"
, ","
value_argument
value_argument_label
simple_identifier "encoding"
: ":"
prefix_expression
. "."
simple_identifier "utf8"
) ")"
?? "??"
line_string_literal
" "\""
" "\""
} "}"
} "}"
class_declaration (+164 nodes collapsed)
class_declaration (+110 nodes collapsed)
class_declaration (+341 nodes collapsed)
class_declaration (+451 nodes collapsed)
class_declaration (+111 nodes collapsed)
class_declaration (+146 nodes collapsed)
class_declaration (+154 nodes collapsed)
class_declaration (+218 nodes collapsed)

After

source_file
comment "//===-------------------------------------------------------"...
comment "//"
comment "// This source file is part of the Swift Argument Parser ope"...
comment "//"
comment "// Copyright (c) 2020 Apple Inc. and the Swift project autho"...
comment "// Licensed under Apache License v2.0 with Runtime Library E"...
comment "//"
comment "// See https://swift.org/LICENSE.txt for license information"
comment "//"
comment "//===-------------------------------------------------------"...
directive
#if "#if"
compiler "compiler"
( "("
>= ">="
integer_literal "6"
. "."
integer_literal "0"
) ")"
import_declaration
modifiers
visibility_modifier
internal "internal"
import "import"
identifier
simple_identifier "ArgumentParserToolInfo"
directive
#else "#else"
import_declaration
import "import"
identifier
simple_identifier "ArgumentParserToolInfo"
directive
#endif "#endif"
class_declaration
modifiers
visibility_modifier
internal "internal"
struct "struct"
type_identifier "DumpHelpGenerator"
class_body
{ "{"
property_declaration
modifiers
visibility_modifier
private "private"
value_binding_pattern
var "var"
pattern
simple_identifier "toolInfo"
type_annotation
: ":"
user_type
type_identifier "ToolInfoV0"
init_declaration (+39 nodes collapsed)
init_declaration (+38 nodes collapsed)
function_declaration
func "func"
simple_identifier "rendered"
( "("
) ")"
-> "->"
user_type
type_identifier "String"
function_body
{ "{"
statements
call_expression any 3:1
navigation_expression any 4:1
simple_identifier "JSONEncoder"
navigation_suffix
. "."
simple_identifier "encode"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
self_expression
self "self"
navigation_suffix
. "."
simple_identifier "toolInfo"
) ")"
} "}"
} "}"
class_declaration (+164 nodes collapsed)
class_declaration (+110 nodes collapsed)
class_declaration (+341 nodes collapsed)
class_declaration (+451 nodes collapsed)
class_declaration (+111 nodes collapsed)
class_declaration (+146 nodes collapsed)
class_declaration (+154 nodes collapsed)
class_declaration (+218 nodes collapsed)