Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 99203ff

Browse files
Addressing feedback
1 parent de64ba8 commit 99203ff

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/GitHub.App/SampleData/CommentThreadViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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" };

src/GitHub.App/ViewModels/CommentThreadViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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));

src/GitHub.App/ViewModels/PullRequestReviewCommentThreadViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.ComponentModel.Composition;
34
using System.Globalization;
45
using 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)

src/GitHub.Exports.Reactive/ViewModels/ICommentThreadViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/GitHub.Exports.Reactive/ViewModels/IPullRequestReviewCommentThreadViewModel.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
2+
using System.Threading.Tasks;
23
using GitHub.Models;
34
using 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);

src/GitHub.InlineReviews/Tags/InlineCommentTagger.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)