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

Commit 5f704e3

Browse files
Merge branch 'master' into packaging-release-branches
2 parents c5eb9d5 + 63cf8e0 commit 5f704e3

File tree

90 files changed

+1764
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1764
-1164
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Localization suggestion
3+
about: Suggest an improvement to our localization
4+
labels: localization, bug
5+
title: 'Localization: '
6+
---
7+
<!-- Hello! Please read the [Contributing Guidelines](https://github.com/github/VisualStudio/blob/master/CONTRIBUTING.md) before submitting an issue regarding the GitHub Extension for Visual Studio. -->
8+
## Language
9+
<!-- Czech -->
10+
<!-- German -->
11+
<!-- Spanish -->
12+
<!-- French -->
13+
<!-- Italian -->
14+
<!-- Japanese -->
15+
<!-- Korean -->
16+
<!-- Polish -->
17+
<!-- Portuguese (Brazil) -->
18+
<!-- Russian -->
19+
<!-- Turkish -->
20+
<!-- Chinese (Simplified) -->
21+
<!-- Chinese (Traditional) -->
22+
23+
## English source
24+
<!-- Translations are made from the English sources, please paste it here. -->
25+
```
26+
27+
```
28+
29+
## Original Translation
30+
<!-- Please paste the original translation here. -->
31+
```
32+
33+
```
34+
35+
## Screenshots
36+
<!-- Translations are sometimes provided by vendors that do not have access to the UI. Providing screenshots can give them a lot of context. -->
37+
38+
## Notes
39+
<!-- If you can, please explain what is incorrect about the translation. -->
40+
41+
## Suggested Translation
42+
<!-- If you can, please suggest an alternate translation. -->
43+
```
44+
45+
```

Directory.Build.Props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<Product>GitHub Extension for Visual Studio</Product>
4-
<Version>2.8.0.0</Version>
4+
<Version>2.9.0.0</Version>
55
<Copyright>Copyright © GitHub, Inc. 2014-2018</Copyright>
66
<LangVersion>7.3</LangVersion>
77
</PropertyGroup>

GitHubVS.sln

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27703.2035
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28603.18
55
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio.Vsix", "src\GitHub.VisualStudio.Vsix\GitHub.VisualStudio.Vsix.csproj", "{D26B4B40-0C94-48AD-8019-0B9BE46E0071}"
7+
EndProject
68
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio", "src\GitHub.VisualStudio\GitHub.VisualStudio.csproj", "{11569514-5AE5-4B5B-92A2-F10B0967DE5F}"
79
ProjectSection(ProjectDependencies) = postProject
810
{7F5ED78B-74A3-4406-A299-70CFB5885B8B} = {7F5ED78B-74A3-4406-A299-70CFB5885B8B}
@@ -33,7 +35,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{8E1F
3335
ProjectSection(SolutionItems) = preProject
3436
scripts\Modules\BuildUtils.psm1 = scripts\Modules\BuildUtils.psm1
3537
scripts\Modules\Debugging.psm1 = scripts\Modules\Debugging.psm1
36-
scripts\Modules\Vsix.psm1 = scripts\Modules\Vsix.psm1
38+
scripts\modules\Versioning.ps1 = scripts\modules\Versioning.ps1
39+
scripts\modules\Vsix.ps1 = scripts\modules\Vsix.ps1
3740
EndProjectSection
3841
EndProject
3942
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{7B6C5F8D-14B3-443D-B044-0E209AE12BDF}"
@@ -141,7 +144,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Octokit.GraphQL.Core", "sub
141144
EndProject
142145
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Octokit.GraphQL", "submodules\octokit.graphql.net\Octokit.GraphQL\Octokit.GraphQL.csproj", "{791B408C-0ABC-465B-9EB1-A2422D67F418}"
143146
EndProject
144-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.StartPage.UnitTests", "test\GitHub.StartPage.UnitTests\GitHub.StartPage.UnitTests.csproj", "{B467682B-9F0E-42D8-8A20-1DE78F798793}"
147+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.StartPage.UnitTests", "test\GitHub.StartPage.UnitTests\GitHub.StartPage.UnitTests.csproj", "{B467682B-9F0E-42D8-8A20-1DE78F798793}"
145148
EndProject
146149
Global
147150
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -151,6 +154,14 @@ Global
151154
ReleaseWithoutVsix|Any CPU = ReleaseWithoutVsix|Any CPU
152155
EndGlobalSection
153156
GlobalSection(ProjectConfigurationPlatforms) = postSolution
157+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
158+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Debug|Any CPU.Build.0 = Debug|Any CPU
159+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.DebugWithoutVsix|Any CPU.ActiveCfg = DebugWithoutVsix|Any CPU
160+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.DebugWithoutVsix|Any CPU.Build.0 = DebugWithoutVsix|Any CPU
161+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Release|Any CPU.ActiveCfg = Release|Any CPU
162+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Release|Any CPU.Build.0 = Release|Any CPU
163+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.ReleaseWithoutVsix|Any CPU.ActiveCfg = ReleaseWithoutVsix|Any CPU
164+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.ReleaseWithoutVsix|Any CPU.Build.0 = ReleaseWithoutVsix|Any CPU
154165
{11569514-5AE5-4B5B-92A2-F10B0967DE5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
155166
{11569514-5AE5-4B5B-92A2-F10B0967DE5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
156167
{11569514-5AE5-4B5B-92A2-F10B0967DE5F}.DebugWithoutVsix|Any CPU.ActiveCfg = DebugWithoutVsix|Any CPU

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Official builds of this extension are available at [the official website](https:
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)
2121
[![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)
22-
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/github-visual-studio/localized.svg)](https://crowdin.com/project/github-visual-studio)
2322
[![codecov](https://codecov.io/gh/GitHub/VisualStudio/branch/master/graph/badge.svg)](https://codecov.io/gh/GitHub/VisualStudio)
2423

2524
[![Follow GitHub for Visual Studio](https://img.shields.io/twitter/follow/GitHubVS.svg?style=social "Follow GitHubVS")](https://twitter.com/githubvs?ref_src=twsrc%5Etfw) [![Join the chat at https://gitter.im/github/VisualStudio](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/github/VisualStudio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: Visual Studio 2017
2-
version: '2.8.0.{build}'
2+
version: '2.9.0.{build}'
33
skip_tags: true
44

55
install:

crowdin.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/using/cloning-a-repository-to-visual-studio.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
After you provide your GitHub or GitHub Enterprise credentials to GitHub for Visual Studio, the extension automatically detects the personal, collaborator and organization repositories you have access to on your account.
44

5-
## Opening the clone dialog
5+
## Opening the clone dialog
66

77
### From **Team Explorer**
88

@@ -17,7 +17,12 @@ Next to the account you want to clone from, click **Clone**.
1717

1818
### From the **Start Page**
1919

20-
Using Visual Studio 2017, click the `GitHub` button on the `Start Page` to open the clone dialog.
20+
Using Visual Studio 2017, click the `GitHub` button on the `Start Page` to open the clone dialog.
21+
22+
23+
### From the **Start Window**
24+
25+
Using Visual Studio 2019, on the `Start Window` select `Clone or check out code` and then click the `GitHub` button to open the clone dialog.
2126

2227

2328
### From the **File** menu
@@ -26,14 +31,19 @@ Go to `File > Open > Open From GitHub...`
2631

2732

2833
## Clone repositories
29-
1. In the list of repositories, scroll until you find the repository you'd like to clone. You can also filter the repository results by using the *Filter* text box.
34+
1. In the list of repositories, scroll until you find the repository you'd like to clone.
3035

31-
![List of GitHub repositories that can be cloned inside a dialog](images/clone-dialog.png)
36+
You can also filter the repository results by using the *Filter* text box.
3237

33-
In addition to using the list of personal, collaborator and organization repositories, you can use the URL tab to clone a public repository by its URL or using the repository owner and name.
38+
In addition to using the list of personal, collaborator and organization repositories, you can enter a repository URL to clone a public repository.
3439

35-
![List of GitHub repositories that can be cloned inside a dialog](images/clone-url-dialog.png)
40+
![Unified clone and open dialog](images/unified-clone-dialog.png)
3641

3742
2. If desired, change the local path that the repository will be cloned into, or leave the default as-is.
3843
3. Once a repository is selected and the path is set, Click **Clone**.
3944
4. In Team Explorer, under the list of solutions, double-click on a solution to open it in Visual Studio.
45+
46+
## Open repositories
47+
For any repository that you select from the list or provide a URL for that you already have cloned locally, the **Open** button becomes enabled and a message shows that you have already cloned the repository to that location.
48+
49+
![Open option enabled in clone dialog](images/open-cloned-repository.png)

docs/using/images/clone-dialog.png

-209 KB
Binary file not shown.
-125 KB
Binary file not shown.
182 KB
Loading
176 KB
Loading
957 KB
Loading

docs/using/reviewing-a-pull-request-in-visual-studio.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@ GitHub for Visual Studio provides facilities for reviewing a pull request direct
1515
The Pull Request Details view shows the current state of the pull request, including:
1616
- information about who created the pull request
1717
- the source and target branch
18-
- a description of the pull request
18+
- a description of the pull request (collapsed by default)
1919
- reviewers and the status of their review
2020
- checks (if checks have been enabled for the repository)
2121
- the files changed
2222

2323
![The details of a single pull request in the GitHub pane](images/pr-detail-view.png)
2424

25+
## Viewing conversation details
26+
27+
Click the comment count link in the GitHub pane to open up the conversation view. The conversation view shows the Pull Request description, a history of commits, and comments made.
28+
29+
![View the conversation for a pull request](images/view-conversation.png)
30+
2531
## Checking out a pull request
2632

2733
To check out the pull request branch, click the **Checkout [branch]** link where [branch] is the name of the branch that will be checked out.

global.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"msbuild-sdks": {
3-
"MSBuild.Sdk.Extras": "1.6.52"
4-
}
2+
"msbuild-sdks": {
3+
"MSBuild.Sdk.Extras": "1.6.61"
4+
}
55
}

scripts/modules/Vsix.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Set-StrictMode -Version Latest
22

33
New-Module -ScriptBlock {
4-
$gitHubDirectory = Join-Path $rootDirectory src\GitHub.VisualStudio
4+
$gitHubDirectory = Join-Path $rootDirectory src\GitHub.VisualStudio.Vsix
55

66
function Get-VsixManifestPath {
77
Join-Path $gitHubDirectory source.extension.vsixmanifest

src/GitHub.App/SampleData/Documents/PullRequestPageViewModelDesigner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ Depends on #1993
5959
new CommitListViewModel(
6060
new CommitSummaryViewModel(new CommitModel
6161
{
62-
Author = new ActorModel { Login = "grokys" },
62+
Author = new CommitActorModel { User = new ActorModel{ Login = "grokys" }},
6363
AbbreviatedOid = "c7c7d25",
6464
MessageHeadline = "Refactor comment view models."
6565
}),
6666
new CommitSummaryViewModel(new CommitModel
6767
{
68-
Author = new ActorModel { Login = "shana" },
68+
Author = new CommitActorModel { User = new ActorModel{ Login = "shana" }},
6969
AbbreviatedOid = "04e6a90",
7070
MessageHeadline = "Refactor comment view models.",
7171
})),

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public async Task CloneRepository(
224224
catch (Exception ex)
225225
{
226226
log.Error(ex, "Could not clone {CloneUrl} to {Path}", cloneUrl, repositoryPath);
227+
operatingSystem.Directory.DeleteDirectory(repositoryPath);
227228
throw;
228229
}
229230
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using GitHub.Models;
2+
3+
namespace GitHub.ViewModels
4+
{
5+
public class CommitActorViewModel: ActorViewModel, ICommitActorViewModel
6+
{
7+
public CommitActorViewModel(CommitActorModel model)
8+
:base(model.User)
9+
{
10+
Name = model.Name;
11+
Email = model.Email;
12+
HasLogin = model.User != null;
13+
}
14+
15+
public string Email { get; }
16+
public string Name { get; }
17+
public bool HasLogin { get; }
18+
}
19+
}

src/GitHub.App/ViewModels/Documents/CommitListViewModel.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public CommitListViewModel(params ICommitSummaryViewModel[] commits)
2525

2626
Commits = commits;
2727
Author = Commits[0].Author;
28+
AuthorName = GetAuthorDisplayName(Commits[0].Author);
2829
AuthorCaption = BuildAuthorCaption();
2930
}
3031

@@ -42,12 +43,16 @@ public CommitListViewModel(IEnumerable<ICommitSummaryViewModel> commits)
4243
}
4344

4445
Author = Commits[0].Author;
46+
AuthorName = GetAuthorDisplayName(Commits[0].Author);
4547
AuthorCaption = BuildAuthorCaption();
4648
}
4749

4850
/// <inheritdoc/>
49-
public IActorViewModel Author { get; }
51+
public ICommitActorViewModel Author { get; }
5052

53+
/// <inheritdoc/>
54+
public string AuthorName { get; }
55+
5156
/// <inheritdoc/>
5257
public string AuthorCaption { get; }
5358

@@ -58,7 +63,7 @@ string BuildAuthorCaption()
5863
{
5964
var result = new StringBuilder();
6065

61-
if (Commits.Any(x => x.Author.Login != Author.Login))
66+
if (Commits.Any(x => GetAuthorDisplayName(x.Author) != AuthorName))
6267
{
6368
result.Append(Resources.AndOthers);
6469
result.Append(' ');
@@ -67,5 +72,10 @@ string BuildAuthorCaption()
6772
result.Append(Resources.AddedSomeCommits);
6873
return result.ToString();
6974
}
75+
76+
string GetAuthorDisplayName(ICommitActorViewModel commitActorViewModel)
77+
{
78+
return commitActorViewModel.HasLogin ? commitActorViewModel.Login : commitActorViewModel.Name;
79+
}
7080
}
7181
}

src/GitHub.App/ViewModels/Documents/CommitSummaryViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class CommitSummaryViewModel : ViewModelBase, ICommitSummaryViewModel
1414
public CommitSummaryViewModel(CommitModel commit)
1515
{
1616
AbbreviatedOid = commit.AbbreviatedOid;
17-
Author = new ActorViewModel(commit.Author);
17+
Author = new CommitActorViewModel(commit.Author);
1818
Header = commit.MessageHeadline;
1919
Oid = commit.Oid;
2020
}
@@ -23,7 +23,7 @@ public CommitSummaryViewModel(CommitModel commit)
2323
public string AbbreviatedOid { get; private set; }
2424

2525
/// <inheritdoc/>
26-
public IActorViewModel Author { get; private set; }
26+
public ICommitActorViewModel Author { get; private set; }
2727

2828
/// <inheritdoc/>
2929
public string Header { get; private set; }

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
using System.Reactive;
44
using System.Threading.Tasks;
55
using GitHub.Extensions;
6+
using GitHub.Logging;
67
using GitHub.Models;
78
using GitHub.Services;
89
using ReactiveUI;
10+
using Serilog;
911

1012
namespace GitHub.ViewModels.GitHubPane
1113
{
@@ -14,6 +16,8 @@ namespace GitHub.ViewModels.GitHubPane
1416
/// </summary>
1517
public class PullRequestReviewCommentViewModel : IPullRequestReviewFileCommentViewModel
1618
{
19+
static readonly ILogger log = LogManager.ForContext<PullRequestReviewCommentViewModel>();
20+
1721
readonly IPullRequestEditorService editorService;
1822
readonly IPullRequestSession session;
1923
readonly PullRequestReviewCommentModel model;
@@ -52,18 +56,34 @@ async Task DoOpen()
5256
{
5357
if (thread == null)
5458
{
55-
var file = await session.GetFile(RelativePath, model.Thread.CommitSha);
56-
thread = file.InlineCommentThreads.FirstOrDefault(t => t.Comments.Any(c => c.Comment.Id == model.Id));
59+
if(model.Thread.IsOutdated)
60+
{
61+
var file = await session.GetFile(RelativePath, model.Thread.OriginalCommitSha);
62+
thread = file.InlineCommentThreads.FirstOrDefault(t => t.Comments.Any(c => c.Comment.Id == model.Id));
63+
}
64+
else
65+
{
66+
var file = await session.GetFile(RelativePath, model.Thread.CommitSha);
67+
thread = file.InlineCommentThreads.FirstOrDefault(t => t.Comments.Any(c => c.Comment.Id == model.Id));
68+
69+
if(thread?.LineNumber == -1)
70+
{
71+
log.Warning("Couldn't find line number for comment on {RelativePath} @ {CommitSha}", RelativePath, model.Thread.CommitSha);
72+
// Fall back to opening outdated file if we can't find a line number for the comment
73+
file = await session.GetFile(RelativePath, model.Thread.OriginalCommitSha);
74+
thread = file.InlineCommentThreads.FirstOrDefault(t => t.Comments.Any(c => c.Comment.Id == model.Id));
75+
}
76+
}
5777
}
5878

5979
if (thread != null && thread.LineNumber != -1)
6080
{
6181
await editorService.OpenDiff(session, RelativePath, thread);
6282
}
6383
}
64-
catch (Exception)
84+
catch (Exception e)
6585
{
66-
// TODO: Show error.
86+
log.Error(e, nameof(DoOpen));
6787
}
6888
}
6989
}

0 commit comments

Comments
 (0)