Skip to content

Adopt the underscored variants of PlaygroundQuickLook, CustomPlaygrou… #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Foundation
import AppKit
#endif

extension PlaygroundQuickLook {
extension _PlaygroundQuickLook {
func opaqueRepresentation() throws -> LogEntry.OpaqueRepresentation {
// TODO: don't crash in this function; instead, throw an error so we can encode an error log message instead

Expand Down
6 changes: 3 additions & 3 deletions PlaygroundLogger/PlaygroundLogger/LogEntry+Reflection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ extension LogEntry {
}

// For types which conform to the legacy `CustomPlaygroundQuickLookable` or `_DefaultCustomPlaygroundQuickLookable` protocols, get their `PlaygroundQuickLook` and use that for logging.
else if let customQuickLookable = instance as? CustomPlaygroundQuickLookable {
else if let customQuickLookable = instance as? _CustomPlaygroundQuickLookable {
self = try .init(playgroundQuickLook: customQuickLookable.customPlaygroundQuickLook, name: name, typeName: typeName, summary: generateSummary(for: instance, withTypeName: typeName, using: mirror))
}
else if let defaultQuickLookable = instance as? _DefaultCustomPlaygroundQuickLookable {
else if let defaultQuickLookable = instance as? __DefaultCustomPlaygroundQuickLookable {
self = try .init(playgroundQuickLook: defaultQuickLookable._defaultCustomPlaygroundQuickLook, name: name, typeName: typeName, summary: generateSummary(for: instance, withTypeName: typeName, using: mirror))
}

Expand Down Expand Up @@ -130,7 +130,7 @@ extension LogEntry {
}
}

private init(playgroundQuickLook: PlaygroundQuickLook, name: String, typeName: String, summary: String) throws {
private init(playgroundQuickLook: _PlaygroundQuickLook, name: String, typeName: String, summary: String) throws {
// TODO: figure out when to set `preferBriefSummary` to true
self = try .opaque(name: name, typeName: typeName, summary: summary, preferBriefSummary: false, representation: playgroundQuickLook.opaqueRepresentation())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,12 @@ class LegacyPlaygroundLoggerTests: XCTestCase {
}

func testPlaygroundQuickLookCalledOnce() {
class MyObject : CustomPlaygroundQuickLookable {
class MyObject : _CustomPlaygroundQuickLookable {
var numCalls = 0
var customPlaygroundQuickLook: PlaygroundQuickLook {
var customPlaygroundQuickLook: _PlaygroundQuickLook {
get {
numCalls = numCalls + 1
return PlaygroundQuickLook(reflecting: "Hello world")
return .text("Hello world")
}
}
}
Expand Down