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 {
2626 return lastItem
2727 }
2828}
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 {
6666 column: UInt
6767 ) {
6868 #if canImport(os)
69+ guard ProcessInfo . processInfo. environment [ " XCODE_RUNNING_FOR_PREVIEWS " ] != " 1 "
70+ else {
71+ print ( " 🟣 \( fileID) : \( line) : \( message ( ) ?? " " ) " )
72+ return
73+ }
6974 let moduleName = String (
7075 Substring ( " \( fileID) " . utf8. prefix ( while: { $0 != UTF8 . CodeUnit ( ascii: " / " ) } ) )
7176 )
You can’t perform that action at this time.
0 commit comments