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

Commit 58e1797

Browse files
More code cleanup
1 parent df89a29 commit 58e1797

18 files changed

+80
-22
lines changed

src/GitHub.App/Services/PullRequestEditorService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ public Task<IDifferenceViewer> OpenDiff(
250250
return OpenDiff(session, relativePath, thread.CommitSha, thread.LineNumber - 1);
251251
}
252252

253+
/// <inheritdoc/>
253254
public async Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, string relativePath, string headSha, int fromLine)
254255
{
255256
var diffViewer = await OpenDiff(session, relativePath, headSha, scrollToFirstDiff: false);

src/GitHub.App/ViewModels/GitHubPane/PullRequestAnnotationItemViewModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ public class PullRequestAnnotationItemViewModel : ViewModelBase, IPullRequestAnn
2222
/// <summary>
2323
/// Initializes the <see cref="PullRequestAnnotationItemViewModel"/>.
2424
/// </summary>
25+
/// <param name="checkSuite">The check suite model.</param>
26+
/// <param name="checkRun">The check run model.</param>
2527
/// <param name="annotation">The check run annotation model.</param>
28+
/// <param name="session">The pull request session.</param>
29+
/// <param name="editorService">The pull request editor service.</param>
2630
public PullRequestAnnotationItemViewModel(CheckSuiteModel checkSuite,
2731
CheckRunModel checkRun,
2832
CheckRunAnnotationModel annotation,
@@ -43,6 +47,7 @@ public PullRequestAnnotationItemViewModel(CheckSuiteModel checkSuite,
4347
});
4448
}
4549

50+
/// <inheritdoc />
4651
public bool IsFileInPullRequest { get; }
4752

4853
/// <inheritdoc />
@@ -51,6 +56,7 @@ public PullRequestAnnotationItemViewModel(CheckSuiteModel checkSuite,
5156
/// <inheritdoc />
5257
public string LineDescription => $"{Annotation.StartLine}:{Annotation.EndLine}";
5358

59+
/// <inheritdoc />
5460
public ReactiveCommand<Unit> OpenAnnotation { get; }
5561

5662
/// <inheritdoc />

src/GitHub.App/ViewModels/GitHubPane/PullRequestAnnotationsViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class PullRequestAnnotationsViewModel : PanePageViewModelBase, IPullReque
2727
/// Initializes a new instance of the <see cref="PullRequestAnnotationsViewModel"/> class.
2828
/// </summary>
2929
/// <param name="sessionManager">The pull request session manager.</param>
30+
/// <param name="pullRequestEditorService">The pull request editor service.</param>
3031
[ImportingConstructor]
3132
public PullRequestAnnotationsViewModel(IPullRequestSessionManager sessionManager, IPullRequestEditorService pullRequestEditorService)
3233
{

src/GitHub.Exports.Reactive/Models/IInlineAnnotationModel.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,34 @@ public interface IInlineAnnotationModel
2020
/// </summary>
2121
CheckAnnotationLevel AnnotationLevel { get; }
2222

23+
/// <summary>
24+
/// Gets the annotation title.
25+
/// </summary>
2326
string Title { get; }
27+
28+
/// <summary>
29+
/// Gets the annotation message.
30+
/// </summary>
2431
string Message { get; }
25-
string FileName { get; }
32+
33+
/// <summary>
34+
/// Gets the annotation path.
35+
/// </summary>
36+
string Path { get; }
37+
38+
/// <summary>
39+
/// Gets the a descriptor for the line(s) reported.
40+
/// </summary>
2641
string LineDescription { get; }
42+
43+
/// <summary>
44+
/// Gets the name of the check run.
45+
/// </summary>
2746
string CheckRunName { get; }
47+
48+
/// <summary>
49+
/// Gets the sha the check run was created on.
50+
/// </summary>
2851
string HeadSha { get; }
2952
}
3053
}

src/GitHub.Exports.Reactive/Models/InlineAnnotationModel.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public InlineAnnotationModel(CheckSuiteModel checkSuite, CheckRunModel checkRun,
2626
this.annotation = annotation;
2727
}
2828

29-
public string FileName => annotation.Path;
29+
public string Path => annotation.Path;
3030

3131
/// <inheritdoc />
3232
public int StartLine => annotation.StartLine;
@@ -37,16 +37,19 @@ public InlineAnnotationModel(CheckSuiteModel checkSuite, CheckRunModel checkRun,
3737
/// <inheritdoc />
3838
public CheckAnnotationLevel AnnotationLevel => annotation.AnnotationLevel;
3939

40+
/// <inheritdoc />
4041
public string CheckRunName => checkRun.Name;
4142

43+
/// <inheritdoc />
4244
public string Title => annotation.Title;
4345

44-
public CheckAnnotationLevel AnnotationLevel => annotation.AnnotationLevel.Value;
45-
46+
/// <inheritdoc />
4647
public string Message => annotation.Message;
4748

49+
/// <inheritdoc />
4850
public string HeadSha => checkSuite.HeadSha;
4951

52+
/// <inheritdoc />
5053
public string LineDescription => $"{StartLine}:{EndLine}";
5154
}
5255
}

src/GitHub.Exports.Reactive/ViewModels/GitHubPane/IPullRequestAnnotationItemViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ public interface IPullRequestAnnotationItemViewModel
2424
/// </summary>
2525
bool IsExpanded { get; set; }
2626

27+
/// <summary>
28+
/// Gets a flag which indicates this annotation item is from a file changed in this pull request.
29+
/// </summary>
2730
bool IsFileInPullRequest { get; }
31+
32+
/// <summary>
33+
/// Gets a command which opens the annotation in the diff view.
34+
/// </summary>
2835
ReactiveCommand<Unit> OpenAnnotation { get; }
2936
}
3037
}

src/GitHub.InlineReviews/Commands/NextInlineCommentCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace GitHub.InlineReviews.Commands
1212
{
1313
/// <summary>
14-
/// Navigates to and opens the the next inline review in the currently active text view.
14+
/// Navigates to and opens the the next inline comment thread in the currently active text view.
1515
/// </summary>
1616
[Export(typeof(INextInlineCommentCommand))]
1717
class NextInlineCommentCommand : InlineCommentNavigationCommand, INextInlineCommentCommand

src/GitHub.InlineReviews/Commands/PreviousInlineCommentCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace GitHub.InlineReviews.Commands
1212
{
1313
/// <summary>
14-
/// Navigates to and opens the the previous inline review in the currently active text view.
14+
/// Navigates to and opens the the previous inline comment thread in the currently active text view.
1515
/// </summary>
1616
[Export(typeof(IPreviousInlineCommentCommand))]
1717
class PreviousInlineCommentCommand : InlineCommentNavigationCommand, IPreviousInlineCommentCommand

src/GitHub.InlineReviews/Peek/InlineCommentPeekableItemSource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class InlineCommentPeekableItemSource : IPeekableItemSource
1414
{
1515
readonly IInlineCommentPeekService peekService;
1616
readonly IPullRequestSessionManager sessionManager;
17-
readonly INextInlineCommentCommand _nextCommentCommand;
17+
readonly INextInlineCommentCommand nextCommentCommand;
1818
readonly IPreviousInlineCommentCommand previousCommentCommand;
1919
readonly ICommentService commentService;
2020

@@ -26,7 +26,7 @@ public InlineCommentPeekableItemSource(IInlineCommentPeekService peekService,
2626
{
2727
this.peekService = peekService;
2828
this.sessionManager = sessionManager;
29-
this._nextCommentCommand = nextCommentCommand;
29+
this.nextCommentCommand = nextCommentCommand;
3030
this.previousCommentCommand = previousCommentCommand;
3131
this.commentService = commentService;
3232
}
@@ -39,7 +39,7 @@ public void AugmentPeekSession(IPeekSession session, IList<IPeekableItem> peekab
3939
peekService,
4040
session,
4141
sessionManager,
42-
_nextCommentCommand,
42+
nextCommentCommand,
4343
previousCommentCommand,
4444
commentService);
4545
viewModel.Initialize().Forget();

src/GitHub.InlineReviews/Peek/InlineCommentPeekableItemSourceProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class InlineCommentPeekableItemSourceProvider : IPeekableItemSourceProvider
1818
{
1919
readonly IInlineCommentPeekService peekService;
2020
readonly IPullRequestSessionManager sessionManager;
21-
readonly INextInlineCommentCommand _nextCommentCommand;
21+
readonly INextInlineCommentCommand nextCommentCommand;
2222
readonly IPreviousInlineCommentCommand previousCommentCommand;
2323
readonly ICommentService commentService;
2424

@@ -32,7 +32,7 @@ public InlineCommentPeekableItemSourceProvider(
3232
{
3333
this.peekService = peekService;
3434
this.sessionManager = sessionManager;
35-
this._nextCommentCommand = nextCommentCommand;
35+
this.nextCommentCommand = nextCommentCommand;
3636
this.previousCommentCommand = previousCommentCommand;
3737
this.commentService = commentService;
3838
}
@@ -42,7 +42,7 @@ public IPeekableItemSource TryCreatePeekableItemSource(ITextBuffer textBuffer)
4242
return new InlineCommentPeekableItemSource(
4343
peekService,
4444
sessionManager,
45-
_nextCommentCommand,
45+
nextCommentCommand,
4646
previousCommentCommand,
4747
commentService);
4848
}

0 commit comments

Comments
 (0)