Files
swift-mirror/test/SourceKit/InterfaceGen/gen_swift_module.swift.from_swiftinterface.response
Nathan Hawes 2420b6d28b [SourceKit] Don't report the ObjC runtime name without @objc(Name)
We used to compute the mangled name in other cases, but document structure is
a syntactic request and can't guarantee that the class/protocol we're getting
the mangled name of is valid in any way so it often breaks assumptions in the
mangler and causes it to crash. It's not clear if the runtime_name is actually
being used anymore, so this change restricts reporting it to just the cases
where we don't need to mangle.

rdar://problem/40956377
2020-02-14 11:40:09 -08:00

112 lines
2.3 KiB
Plaintext

public class MyClass {
public func pub_method()
}
public func pub_function()
[
{
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: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 14,
key.length: 7
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 29,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 36,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 41,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 57,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 64,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 69,
key.length: 12
}
]
<<NULL>>
[
{
key.kind: source.lang.swift.decl.class,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "MyClass",
key.offset: 8,
key.length: 47,
key.nameoffset: 14,
key.namelength: 7,
key.bodyoffset: 23,
key.bodylength: 31,
key.attributes: [
{
key.offset: 1,
key.length: 6,
key.attribute: source.decl.attribute.public
}
],
key.substructure: [
{
key.kind: source.lang.swift.decl.function.method.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "pub_method()",
key.offset: 36,
key.length: 17,
key.nameoffset: 41,
key.namelength: 12,
key.attributes: [
{
key.offset: 29,
key.length: 6,
key.attribute: source.decl.attribute.public
}
]
}
]
},
{
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "pub_function()",
key.offset: 64,
key.length: 19,
key.nameoffset: 69,
key.namelength: 14,
key.attributes: [
{
key.offset: 57,
key.length: 6,
key.attribute: source.decl.attribute.public
}
]
}
]