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

Commit 81c4beb

Browse files
authored
Merge branch 'master' into fixes/include-e_sqlite.dll-in-vsix
2 parents 7868846 + dd19d59 commit 81c4beb

File tree

8 files changed

+17
-14
lines changed

8 files changed

+17
-14
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Most of the extension UI lives in the Team Explorer pane, which is available fro
1818
Official builds of this extension are available at [the official website](https://visualstudio.github.com).
1919

2020
[![Build status](https://ci.appveyor.com/api/projects/status/dl8is5iqwt9qf3t7/branch/master?svg=true)](https://ci.appveyor.com/project/github-windows/visualstudio/branch/master)
21+
[![Build Status](https://github-editor-tools.visualstudio.com/VisualStudio/_apis/build/status/github.VisualStudio?branchName=master)](https://github-editor-tools.visualstudio.com/VisualStudio/_build/latest?definitionId=4&branchName=master)
2122
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/github-visual-studio/localized.svg)](https://crowdin.com/project/github-visual-studio)
2223
[![codecov](https://codecov.io/gh/GitHub/VisualStudio/branch/master/graph/badge.svg)](https://codecov.io/gh/GitHub/VisualStudio)
2324

src/GitHub.App/Services/PullRequestEditorService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,13 @@ public Task<IDifferenceViewer> OpenDiff(
298298
}
299299

300300
/// <inheritdoc/>
301-
public async Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, string relativePath, string headSha, int fromLine)
301+
public async Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, string relativePath, string headSha, int nextInlineTagFromLine)
302302
{
303303
var diffViewer = await OpenDiff(session, relativePath, headSha, scrollToFirstDraftOrDiff: false);
304304

305305
var param = (object) new InlineCommentNavigationParams
306306
{
307-
FromLine = fromLine,
307+
FromLine = nextInlineTagFromLine,
308308
};
309309

310310
// HACK: We need to wait here for the inline comment tags to initialize so we can find the next inline comment.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ private async Task OpenFirstAnnotation(IPullRequestEditorService editorService,
8383

8484
if (annotationModel != null)
8585
{
86-
await editorService.OpenDiff(pullRequestSession, file.RelativePath, annotationModel.HeadSha, annotationModel.EndLine);
86+
//AnnotationModel.EndLine is a 1-based number
87+
//EditorService.OpenDiff takes a 0-based line number to start searching AFTER and will open the next tag
88+
var nextInlineCommentFromLine = annotationModel.EndLine - 2;
89+
await editorService.OpenDiff(pullRequestSession, file.RelativePath, annotationModel.HeadSha, nextInlineCommentFromLine);
8790
}
8891
}
8992

@@ -247,7 +250,7 @@ async Task<InlineAnnotationModel> GetFirstAnnotation(IPullRequestFileNode file,
247250
var sessionFile = await pullRequestSession.GetFile(file.RelativePath);
248251
var annotations = sessionFile.InlineAnnotations;
249252

250-
return annotations.FirstOrDefault(model => model.AnnotationLevel == annotationLevel);
253+
return annotations.OrderBy(model => model.EndLine).FirstOrDefault(model => model.AnnotationLevel == annotationLevel);
251254
}
252255

253256
/// <summary>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public InlineAnnotationModel(CheckSuiteModel checkSuite, CheckRunModel checkRun,
3535
public string Path => annotation.Path;
3636

3737
/// <summary>
38-
/// Gets the start line of the annotation.
38+
/// Gets the 1-based start line of the annotation.
3939
/// </summary>
4040
public int StartLine => annotation.StartLine;
4141

4242
/// <summary>
43-
/// Gets the end line of the annotation.
43+
/// Gets the 1-based end line of the annotation.
4444
/// </summary>
4545
public int EndLine => annotation.EndLine;
4646

src/GitHub.Exports.Reactive/Services/IPullRequestEditorService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public interface IPullRequestEditorService
5555
/// The commit SHA of the right hand side of the diff. Pass null to compare with the
5656
/// working directory, or "HEAD" to compare with the HEAD commit of the pull request.
5757
/// </param>
58-
/// <param name="fromLine">The line number to open</param>
58+
/// <param name="nextInlineTagFromLine">The 0-based line number to execute NextInlineCommentCommand from</param>
5959
/// <returns>The opened diff viewer.</returns>
60-
Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, string relativePath, string headSha, int fromLine);
60+
Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, string relativePath, string headSha, int nextInlineTagFromLine);
6161

6262
/// <summary>
6363
/// Find the active text view.

src/GitHub.Exports/Models/AnnotationModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
public class CheckRunAnnotationModel
77
{
88
/// <summary>
9-
/// The starting line number (1 indexed).
9+
/// The starting 1-based line number (1 indexed).
1010
/// </summary>
1111
public int StartLine { get; set; }
1212

1313
/// <summary>
14-
/// The ending line number (1 indexed).
14+
/// The ending 1-based line number (1 indexed).
1515
/// </summary>
1616
public int EndLine { get; set; }
1717

src/GitHub.InlineReviews/Commands/NextInlineCommentCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public override Task Execute(InlineCommentNavigationParams parameter)
5353
if (tags.Count > 0)
5454
{
5555
var cursorPoint = GetCursorPoint(textViews[0], parameter);
56-
var next = tags.FirstOrDefault(x => x.Point >= cursorPoint) ?? tags.First();
56+
var next = tags.FirstOrDefault(x => x.Point > cursorPoint) ?? tags.First();
5757
ShowPeekComments(parameter, next.TextView, next.Tag, textViews);
5858
}
5959

src/GitHub.InlineReviews/Tags/InlineCommentTagger.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ public IEnumerable<ITagSpan<InlineCommentTag>> GetTags(NormalizedSnapshotSpanCol
9595
Dictionary<int, InlineAnnotationModel[]> spanAnnotationsByLine = null;
9696
if (side == DiffSide.Right)
9797
{
98-
var spanAnnotations = file.InlineAnnotations.Where(x =>
98+
var spanAnnotations = file.InlineAnnotations?.Where(x =>
9999
x.EndLine - 1 >= startLine &&
100100
x.EndLine - 1 <= endLine);
101101

102-
spanAnnotationsByLine = spanAnnotations
103-
.GroupBy(model => model.EndLine)
102+
spanAnnotationsByLine = spanAnnotations?.GroupBy(model => model.EndLine)
104103
.ToDictionary(models => models.Key - 1, models => models.ToArray());
105104
}
106105

0 commit comments

Comments
 (0)