Files
swift-mirror/test/SourceKit/CodeComplete/complete_optionalmethod.swift.response
Rintaro Ishizaki 66c71d1bf7 [SourceKit] Force print '?' for optional method call in code completion. (#16910)
Calling '@objc optional func' requires '?' or '!' after its name. When
completing method calls for them, 'key.sourcetext' should have '?'
whereas 'key.name' shouldn't.
Note that we deliberately do not use optional type name for
'key.typename'. This is consistent with optional chain '?.<propertyName>'
behavior.

rdar://problem/37904574
2018-05-31 16:06:23 -07:00

25 lines
743 B
Plaintext

{
key.results: [
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "optionalMethod()",
key.sourcetext: "optionalMethod?()",
key.description: "optionalMethod?()",
key.typename: "Int",
key.context: source.codecompletion.context.superclass,
key.num_bytes_to_erase: 0,
key.associated_usrs: "c:@M@complete_optionalmethod@objc(pl)Proto(im)optionalMethod",
key.modulename: "complete_optionalmethod"
},
{
key.kind: source.lang.swift.keyword,
key.name: "self",
key.sourcetext: "self",
key.description: "self",
key.typename: "T",
key.context: source.codecompletion.context.thisclass,
key.num_bytes_to_erase: 0
}
]
}