This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed
GitHub.Exports.Reactive/ViewModels
GitHub.InlineReviews/Tags Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public CommentThreadViewModelDesigner()
7575 public IReadOnlyReactiveList < ICommentViewModel > Comments { get ; }
7676 = new ReactiveList < ICommentViewModel > ( ) ;
7777
78- public IReadOnlyList < IInlineAnnotationViewModel > Annotations { get ; }
78+ public IReadOnlyCollection < IInlineAnnotationViewModel > Annotations { get ; }
7979
8080 public IActorViewModel CurrentUser { get ; set ; }
8181 = new ActorViewModel { Login = "shana" } ;
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public CommentThreadViewModel(
5858 public IActorViewModel CurrentUser { get ; private set ; }
5959
6060 /// <inheritdoc/>
61- public IReadOnlyList < IInlineAnnotationViewModel > Annotations { get ; private set ; }
61+ public IReadOnlyCollection < IInlineAnnotationViewModel > Annotations { get ; private set ; }
6262
6363 /// <inheritdoc/>
6464 IReadOnlyReactiveList < ICommentViewModel > ICommentThreadViewModel . Comments => comments ;
@@ -96,7 +96,7 @@ protected IDisposable AddPlaceholder(ICommentViewModel placeholder)
9696 /// </summary>
9797 /// <param name="currentUser">The current user.</param>
9898 /// <param name="annotations"></param>
99- protected Task InitializeAsync ( ActorModel currentUser , IReadOnlyList < IInlineAnnotationViewModel > annotations )
99+ protected Task InitializeAsync ( ActorModel currentUser , IReadOnlyCollection < IInlineAnnotationViewModel > annotations )
100100 {
101101 Annotations = annotations ;
102102 Guard . ArgumentNotNull ( currentUser , nameof ( currentUser ) ) ;
Original file line number Diff line number Diff line change 11using System ;
2+ using System . Collections . Generic ;
23using System . ComponentModel . Composition ;
34using System . Globalization ;
45using System . Linq ;
@@ -75,9 +76,8 @@ public bool IsNewThread
7576 public bool NeedsPush => needsPush . Value ;
7677
7778 /// <inheritdoc/>
78- public async Task InitializeAsync (
79- IPullRequestSession session ,
80- IInlineAnnotationViewModel [ ] annotations ,
79+ public async Task InitializeAsync ( IPullRequestSession session ,
80+ IReadOnlyCollection < IInlineAnnotationViewModel > annotations ,
8181 IPullRequestSessionFile file ,
8282 IInlineCommentThreadModel thread ,
8383 bool addPlaceholder )
Original file line number Diff line number Diff line change @@ -41,6 +41,6 @@ public interface ICommentThreadViewModel : IViewModel
4141 /// <summary>
4242 /// Gets the annotations displayed.
4343 /// </summary>
44- IReadOnlyList < IInlineAnnotationViewModel > Annotations { get ; }
44+ IReadOnlyCollection < IInlineAnnotationViewModel > Annotations { get ; }
4545 }
4646}
Original file line number Diff line number Diff line change 1- using System . Threading . Tasks ;
1+ using System . Collections . Generic ;
2+ using System . Threading . Tasks ;
23using GitHub . Models ;
34using GitHub . Services ;
45
@@ -45,14 +46,14 @@ public interface IPullRequestReviewCommentThreadViewModel : ICommentThreadViewMo
4546 /// Initializes the view model with data.
4647 /// </summary>
4748 /// <param name="session">The pull request session.</param>
49+ /// <param name="annotations"></param>
4850 /// <param name="file">The file that the comment is on.</param>
4951 /// <param name="thread">The thread.</param>
5052 /// <param name="addPlaceholder">
51- /// Whether to add a placeholder comment at the end of the thread.
53+ /// Whether to add a placeholder comment at the end of the thread.
5254 /// </param>
53- Task InitializeAsync (
54- IPullRequestSession session ,
55- IInlineAnnotationViewModel [ ] annotations ,
55+ Task InitializeAsync ( IPullRequestSession session ,
56+ IReadOnlyCollection < IInlineAnnotationViewModel > annotations ,
5657 IPullRequestSessionFile file ,
5758 IInlineCommentThreadModel thread ,
5859 bool addPlaceholder ) ;
Original file line number Diff line number Diff line change @@ -110,8 +110,7 @@ public IEnumerable<ITagSpan<InlineCommentTag>> GetTags(NormalizedSnapshotSpanCol
110110 var snapshot = span . Snapshot ;
111111 var snapshotLine = snapshot . GetLineFromLineNumber ( line ) ;
112112
113- IInlineCommentThreadModel thread ;
114- if ( spanThreadsByLine . TryGetValue ( line , out thread ) )
113+ if ( spanThreadsByLine . TryGetValue ( line , out var thread ) )
115114 {
116115 var isThreadDeleteSide = thread . DiffLineType == DiffChangeType . Delete ;
117116 var sidesMatch = side == DiffSide . Left && isThreadDeleteSide || side == DiffSide . Right && ! isThreadDeleteSide ;
You can’t perform that action at this time.
0 commit comments