Skip to content

Commit abe697f

Browse files
authored
[Debug] Rename DebugDescription fallback property to lldbDescription (#75305)
From feedback, replace the name `_debugDescription`, which was confusing because of the underscore, with `lldbDescription`. This new name also indicates that this property may contain [LLDB Summary Strings](https://lldb.llvm.org/use/variable.html#summary-strings).
1 parent 4f8eb5f commit abe697f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/Macros/Sources/SwiftMacros/DebugDescriptionMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ extension _DebugDescriptionPropertyMacro: PeerMacro {
262262

263263
/// The names of properties that can be converted to LLDB type summaries, in priority order.
264264
fileprivate let DESCRIPTION_PROPERTIES = [
265-
"_debugDescription",
265+
"lldbDescription",
266266
"debugDescription",
267267
"description",
268268
]

stdlib/public/core/DebuggerSupport.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ import SwiftShims
4444
/// }
4545
///
4646
/// The `DebugDescription` macro supports both `debugDescription`, `description`,
47-
/// as well as a third option: a property named `_debugDescription`. The first
47+
/// as well as a third option: a property named `lldbDescription`. The first
4848
/// two are implemented when conforming to the `CustomDebugStringConvertible`
49-
/// and `CustomStringConvertible` protocols. The additional `_debugDescription`
49+
/// and `CustomStringConvertible` protocols. The additional `lldbDescription`
5050
/// property is useful when both `debugDescription` and `description` are
5151
/// implemented, but don't meet the requirements of the `DebugDescription`
52-
/// macro. If `_debugDescription` is implemented, `DebugDescription` choose it
52+
/// macro. If `lldbDescription` is implemented, `DebugDescription` choose it
5353
/// over `debugDescription` and `description`. Likewise, `debugDescription` is
5454
/// preferred over `description`.
5555
///

stdlib/public/core/ObjectIdentifier+DebugDescription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#if !$Embedded
1414
@DebugDescription
1515
extension ObjectIdentifier {
16-
var _debugDescription: String {
16+
var lldbDescription: String {
1717
return "ObjectIdentifier(\(_value))"
1818
}
1919
}

test/Macros/DebugDescription/supported_description.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct MyStruct2: CustomDebugStringConvertible {
3131
struct MyStruct3: CustomDebugStringConvertible {
3232
var description: String { "thirty" }
3333
var debugDescription: String { "eleven" }
34-
var _debugDescription: String { "two" }
34+
var lldbDescription: String { "two" }
3535
}
3636
// CHECK: static let _lldb_summary = (
3737
// CHECK: /* version */ 1 as UInt8,

0 commit comments

Comments
 (0)