mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This change makes us treat it exactly as we do 'init'. We don't allow renaming the base name,
and don't fail if the basename doesn't match for calls.
Also:
- explicit init calls/references like `MyType.init(42)` are now reported with
'init' as a keywordBase range, rather than nothing.
- cursor info no longer reports rename as available on init/callAsFunction
calls without arguments, as there's nothing to rename in that case.
- Improved detection of when a referenced function is a call (rather than
reference) across syntactic rename, cursor-info, and indexing.
Resolves rdar://problem/60340429
162 lines
4.7 KiB
Plaintext
162 lines
4.7 KiB
Plaintext
{
|
|
key.dependencies: [
|
|
{
|
|
key.kind: source.lang.swift.import.module.swift,
|
|
key.name: "Swift",
|
|
key.filepath: Swift.swiftmodule,
|
|
key.is_system: 1
|
|
}
|
|
],
|
|
key.entities: [
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.name: "ClassA",
|
|
key.usr: "s:15index_operators6ClassAC",
|
|
key.line: 4,
|
|
key.column: 7,
|
|
key.entities: [
|
|
{
|
|
key.kind: source.lang.swift.decl.function.constructor,
|
|
key.name: "init()",
|
|
key.usr: "s:15index_operators6ClassACACycfc",
|
|
key.line: 5,
|
|
key.column: 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.operator.infix,
|
|
key.name: "+(_:_:)",
|
|
key.usr: "s:15index_operators1poiyAA6ClassACAD_ADtF",
|
|
key.line: 8,
|
|
key.column: 6,
|
|
key.entities: [
|
|
{
|
|
key.kind: source.lang.swift.ref.class,
|
|
key.name: "ClassA",
|
|
key.usr: "s:15index_operators6ClassAC",
|
|
key.line: 8,
|
|
key.column: 13
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.class,
|
|
key.name: "ClassA",
|
|
key.usr: "s:15index_operators6ClassAC",
|
|
key.line: 8,
|
|
key.column: 26
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.class,
|
|
key.name: "ClassA",
|
|
key.usr: "s:15index_operators6ClassAC",
|
|
key.line: 8,
|
|
key.column: 37
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.struct,
|
|
key.name: "StructB",
|
|
key.usr: "s:15index_operators7StructBV",
|
|
key.line: 12,
|
|
key.column: 8,
|
|
key.entities: [
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.name: "method()",
|
|
key.usr: "s:15index_operators7StructBV6methodyyF",
|
|
key.line: 13,
|
|
key.column: 10,
|
|
key.entities: [
|
|
{
|
|
key.kind: source.lang.swift.ref.class,
|
|
key.name: "ClassA",
|
|
key.usr: "s:15index_operators6ClassAC",
|
|
key.line: 14,
|
|
key.column: 17
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.function.constructor,
|
|
key.name: "init()",
|
|
key.usr: "s:15index_operators6ClassACACycfc",
|
|
key.line: 14,
|
|
key.column: 17
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.function.operator.infix,
|
|
key.name: "+(_:_:)",
|
|
key.usr: "s:15index_operators1poiyAA6ClassACAD_ADtF",
|
|
key.line: 15,
|
|
key.column: 19
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.struct,
|
|
key.name: "StructB",
|
|
key.usr: "s:15index_operators7StructBV",
|
|
key.line: 16,
|
|
key.column: 17
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.function.constructor,
|
|
key.name: "init()",
|
|
key.usr: "s:15index_operators7StructBVACycfc",
|
|
key.line: 16,
|
|
key.column: 17
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.function.operator.infix,
|
|
key.name: "-(_:_:)",
|
|
key.usr: "s:15index_operators7StructBV1soiyA2C_ACtFZ",
|
|
key.line: 17,
|
|
key.column: 19,
|
|
key.receiver_usr: "s:15index_operators7StructBV"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.operator.infix,
|
|
key.name: "-(_:_:)",
|
|
key.usr: "s:15index_operators7StructBV1soiyA2C_ACtFZ",
|
|
key.line: 20,
|
|
key.column: 24,
|
|
key.entities: [
|
|
{
|
|
key.kind: source.lang.swift.ref.struct,
|
|
key.name: "StructB",
|
|
key.usr: "s:15index_operators7StructBV",
|
|
key.line: 20,
|
|
key.column: 31
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.struct,
|
|
key.name: "StructB",
|
|
key.usr: "s:15index_operators7StructBV",
|
|
key.line: 20,
|
|
key.column: 45
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.struct,
|
|
key.name: "StructB",
|
|
key.usr: "s:15index_operators7StructBV",
|
|
key.line: 20,
|
|
key.column: 57
|
|
}
|
|
],
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.public
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.constructor,
|
|
key.usr: "s:15index_operators7StructBVACycfc",
|
|
key.line: 12,
|
|
key.column: 8,
|
|
key.is_implicit: 1
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|