File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Sources/IssueReporting/IssueReporters Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -26,3 +26,10 @@ class ItemsModel {
26
26
return lastItem
27
27
}
28
28
}
29
+
30
+ struct Previews : PreviewProvider {
31
+ static var previews : some View {
32
+ let model = ItemsModel ( )
33
+ Text ( model. lastItem? . description ?? " No last item " )
34
+ }
35
+ }
Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ public struct _RuntimeWarningReporter: IssueReporter {
66
66
column: UInt
67
67
) {
68
68
#if canImport(os)
69
+ guard ProcessInfo . processInfo. environment [ " XCODE_RUNNING_FOR_PREVIEWS " ] != " 1 "
70
+ else {
71
+ print ( " 🟣 \( fileID) : \( line) : \( message ( ) ?? " " ) " )
72
+ return
73
+ }
69
74
let moduleName = String (
70
75
Substring ( " \( fileID) " . utf8. prefix ( while: { $0 != UTF8 . CodeUnit ( ascii: " / " ) } ) )
71
76
)
You can’t perform that action at this time.
0 commit comments