Files
swift-mirror/test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.explicit.response
Ben Barham cb81c1a1aa [SourceKit] Add structure node for SubscriptExpr
Arguments in `SubscriptExpr` are visited since the recent `ArgumentList`
refactoring, but were being added to the containing `CallExpr`. Add a
node for the `SubscriptExpr` itself so that its argument is added there
instead of the `CallExpr`.

Also remove `key.nameoffset` and `key.namelength` from the response when
both are 0 to match the rest of the offsets and lengths.

Resolves rdar://85412164.
2021-11-30 19:56:48 +10:00

83 lines
1.6 KiB
Plaintext

public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32
[
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 1,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 8,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 13,
key.length: 31
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 45,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 47,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 50,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 60,
key.length: 5
}
]
[
{
key.kind: source.lang.swift.ref.struct,
key.offset: 50,
key.length: 5,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 60,
key.length: 5,
key.is_system: 1
}
]
[
{
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fooHelperExplicitFrameworkFunc1(_:)",
key.offset: 8,
key.length: 57,
key.typename: "Int32",
key.nameoffset: 13,
key.namelength: 43,
key.attributes: [
{
key.offset: 1,
key.length: 6,
key.attribute: source.decl.attribute.public
}
],
key.substructure: [
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "a",
key.offset: 45,
key.length: 10,
key.typename: "Int32"
}
]
}
]