Share IWpfDifferenceViewerExtensions with EditorFeatures.Cocoa#51759
Share IWpfDifferenceViewerExtensions with EditorFeatures.Cocoa#51759sharwell merged 1 commit intodotnet:mainfrom
Conversation
9207761 to
8af7125
Compare
| diffViewer.ViewMode = mode; | ||
|
|
||
| // This code path must be invoked on UI thread. | ||
| AssertIsForeground(); |
There was a problem hiding this comment.
All the foreground assertions are now gone?
There was a problem hiding this comment.
Foreground assertions are unnecessary in asynchronous code. If code needs a specific thread, and can and should switch to that thread. The caller's thread is generally irrelevant.
There was a problem hiding this comment.
Yup, I saw some codepaths did not change to switch to the main thread, but I assume this was because they're only called inside the UI thread context.
LGTM
jasonmalinowski
left a comment
There was a problem hiding this comment.
I can confirm this makes the code look like what's in IWpfDifferenceViewerExtensions, but I didn't actually confirm if that makes any sense in the first place. I'd be curious what actually sharing the code under an #ifdef looks like, but this is an improvement at least.
|
@jasonmalinowski Sharing mostly works. I used that approach originally, but switched to this approach due to differences on these lines: I figure if we do share in the future, this change makes that sharing easier. |
|
@sharwell: yeah, in that case because it's small enough my preference is we share the file and |
No description provided.