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

Commit 285572b

Browse files
authored
Merge branch 'master' into fixes/2110-ExtrasEnableDefaultResourceItems-false
2 parents 11338da + 8374b58 commit 285572b

File tree

127 files changed

+605
-260
lines changed

Some content is hidden

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

127 files changed

+605
-260
lines changed

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
url = https://github.com/editor-tools/Akavache
1313
[submodule "script"]
1414
path = script
15-
url = [email protected]:github/VisualStudioBuildScripts
15+
url = [email protected]:github/VisualStudioBuildScripts
16+
[submodule "submodules/octokit.graphql.net"]
17+
path = submodules/octokit.graphql.net
18+
url = https://github.com/octokit/octokit.graphql.net

Directory.Build.Props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22
<PropertyGroup>
33
<Product>GitHub Extension for Visual Studio</Product>
4-
<Version>2.6.0.0</Version>
4+
<Version>2.7.0.0</Version>
55
<Copyright>Copyright © GitHub, Inc. 2014-2018</Copyright>
66
<LangVersion>7.3</LangVersion>
77
</PropertyGroup>
8-
</Project>
8+
</Project>

GitHubVS.sln

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InstallAndStart", "test\Lau
135135
EndProject
136136
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.TeamFoundation.16", "src\GitHub.TeamFoundation.16\GitHub.TeamFoundation.16.csproj", "{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}"
137137
EndProject
138-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Services.Vssdk.UnitTests", "test\GitHub.Services.Vssdk.UnitTests\GitHub.Services.Vssdk.UnitTests.csproj", "{65542DEE-D3BE-4810-B85A-08E970413A21}"
138+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.Services.Vssdk.UnitTests", "test\GitHub.Services.Vssdk.UnitTests\GitHub.Services.Vssdk.UnitTests.csproj", "{65542DEE-D3BE-4810-B85A-08E970413A21}"
139+
EndProject
140+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Octokit.GraphQL.Core", "submodules\octokit.graphql.net\Octokit.GraphQL.Core\Octokit.GraphQL.Core.csproj", "{3321CE72-26ED-4D1E-A8F5-6901FB783007}"
141+
EndProject
142+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Octokit.GraphQL", "submodules\octokit.graphql.net\Octokit.GraphQL\Octokit.GraphQL.csproj", "{791B408C-0ABC-465B-9EB1-A2422D67F418}"
139143
EndProject
140144
Global
141145
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -241,14 +245,6 @@ Global
241245
{41A47C5B-C606-45B4-B83C-22B9239E4DA0}.Release|Any CPU.Build.0 = Release|Any CPU
242246
{41A47C5B-C606-45B4-B83C-22B9239E4DA0}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
243247
{41A47C5B-C606-45B4-B83C-22B9239E4DA0}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
244-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
245-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
246-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.DebugWithoutVsix|Any CPU.ActiveCfg = Debug|Any CPU
247-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.DebugWithoutVsix|Any CPU.Build.0 = Debug|Any CPU
248-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
249-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.Release|Any CPU.Build.0 = Release|Any CPU
250-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
251-
{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
252248
{161DBF01-1DBF-4B00-8551-C5C00F26720D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
253249
{161DBF01-1DBF-4B00-8551-C5C00F26720D}.Debug|Any CPU.Build.0 = Debug|Any CPU
254250
{161DBF01-1DBF-4B00-8551-C5C00F26720D}.DebugWithoutVsix|Any CPU.ActiveCfg = Debug|Any CPU
@@ -475,14 +471,28 @@ Global
475471
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
476472
{65542DEE-D3BE-4810-B85A-08E970413A21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
477473
{65542DEE-D3BE-4810-B85A-08E970413A21}.Debug|Any CPU.Build.0 = Debug|Any CPU
478-
{65542DEE-D3BE-4810-B85A-08E970413A21}.DebugCodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU
479-
{65542DEE-D3BE-4810-B85A-08E970413A21}.DebugCodeAnalysis|Any CPU.Build.0 = Debug|Any CPU
480474
{65542DEE-D3BE-4810-B85A-08E970413A21}.DebugWithoutVsix|Any CPU.ActiveCfg = Debug|Any CPU
481475
{65542DEE-D3BE-4810-B85A-08E970413A21}.DebugWithoutVsix|Any CPU.Build.0 = Debug|Any CPU
482476
{65542DEE-D3BE-4810-B85A-08E970413A21}.Release|Any CPU.ActiveCfg = Release|Any CPU
483477
{65542DEE-D3BE-4810-B85A-08E970413A21}.Release|Any CPU.Build.0 = Release|Any CPU
484478
{65542DEE-D3BE-4810-B85A-08E970413A21}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
485479
{65542DEE-D3BE-4810-B85A-08E970413A21}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
480+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
481+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.Debug|Any CPU.Build.0 = Debug|Any CPU
482+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.DebugWithoutVsix|Any CPU.ActiveCfg = Debug|Any CPU
483+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.DebugWithoutVsix|Any CPU.Build.0 = Debug|Any CPU
484+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.Release|Any CPU.ActiveCfg = Release|Any CPU
485+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.Release|Any CPU.Build.0 = Release|Any CPU
486+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
487+
{3321CE72-26ED-4D1E-A8F5-6901FB783007}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
488+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
489+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.Debug|Any CPU.Build.0 = Debug|Any CPU
490+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.DebugWithoutVsix|Any CPU.ActiveCfg = Debug|Any CPU
491+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.DebugWithoutVsix|Any CPU.Build.0 = Debug|Any CPU
492+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.Release|Any CPU.ActiveCfg = Release|Any CPU
493+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.Release|Any CPU.Build.0 = Release|Any CPU
494+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
495+
{791B408C-0ABC-465B-9EB1-A2422D67F418}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
486496
EndGlobalSection
487497
GlobalSection(SolutionProperties) = preSolution
488498
HideSolutionNode = FALSE
@@ -515,6 +525,8 @@ Global
515525
{C6E8D1E1-FAAC-4E02-B6A1-6164EC5E704E} = {1E7F7253-A6AF-43C4-A955-37BEDDA01AB9}
516526
{E899B03C-6E8E-4375-AB65-FC925D721D8B} = {1E7F7253-A6AF-43C4-A955-37BEDDA01AB9}
517527
{65542DEE-D3BE-4810-B85A-08E970413A21} = {8A7DA2E7-262B-4581-807A-1C45CE79CDFD}
528+
{3321CE72-26ED-4D1E-A8F5-6901FB783007} = {1E7F7253-A6AF-43C4-A955-37BEDDA01AC0}
529+
{791B408C-0ABC-465B-9EB1-A2422D67F418} = {1E7F7253-A6AF-43C4-A955-37BEDDA01AC0}
518530
EndGlobalSection
519531
GlobalSection(ExtensibilityGlobals) = postSolution
520532
SolutionGuid = {556014CF-5B35-4CE5-B3EF-6AB0007001AC}

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you have an existing clone, make sure to run `git submodule sync` to update y
1212

1313
## About
1414

15-
The GitHub Extension for Visual Studio provides GitHub integration in Visual Studio 2015.
15+
The GitHub Extension for Visual Studio provides GitHub integration in Visual Studio 2015 and newer.
1616
Most of the extension UI lives in the Team Explorer pane, which is available from the View menu.
1717

1818
Official builds of this extension are available at [the official website](https://visualstudio.github.com).
@@ -92,6 +92,22 @@ Logs can be viewed at the following location:
9292

9393
`%LOCALAPPDATA%\GitHubVisualStudio\extension.log`
9494

95+
## Troubleshooting
96+
97+
If you have issues building with failures similar to:
98+
99+
> "The type or namespace name does not exist..."
100+
101+
or
102+
103+
> "Unable to find project... Check that the project reference is valid and that the project file exists."*
104+
105+
Close Visual Studio and run the following command to update submodules and clean your environment.
106+
107+
```txt
108+
clean.cmd
109+
```
110+
95111
## More information
96112
- Andreia Gaita's [presentation](https://www.youtube.com/watch?v=hz2hCO8e_8w) at Codemania 2016 about this extension.
97113

@@ -104,4 +120,3 @@ Visit the [Contributor Guidelines](CONTRIBUTING.md) for details on how to contri
104120
Copyright 2015 - 2018 GitHub, Inc.
105121

106122
Licensed under the [MIT License](LICENSE.md)
107-

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.6.0.{build}'
2+
version: '2.7.0.{build}'
33
skip_tags: true
44
install:
55
- ps: |

clean.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git submodule update --init
2+
git clean -xdff
3+
git submodule foreach git clean -xdff

src/CredentialManagement/NativeMethods.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
using System.Text;
55
using Microsoft.Win32.SafeHandles;
66

7+
#pragma warning disable CA1034 // Nested types should not be visible
8+
#pragma warning disable CA1051 // Do not declare visible instance fields
9+
#pragma warning disable CA1707 // Identifiers should not contain underscores
10+
711
namespace GitHub.Authentication.CredentialManagement
812
{
913
public static class NativeMethods

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23+
<ProjectReference Include="..\..\submodules\octokit.graphql.net\Octokit.GraphQL.Core\Octokit.GraphQL.Core.csproj" />
24+
<ProjectReference Include="..\..\submodules\octokit.graphql.net\Octokit.GraphQL\Octokit.GraphQL.csproj" />
2325
<ProjectReference Include="..\..\submodules\octokit.net\Octokit\Octokit.csproj" />
2426
<ProjectReference Include="..\CredentialManagement\CredentialManagement.csproj" />
2527
<ProjectReference Include="..\GitHub.Exports\GitHub.Exports.csproj" />
@@ -30,6 +32,5 @@
3032
<ItemGroup>
3133
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.1" />
3234
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
33-
<PackageReference Include="Octokit.GraphQL" Version="0.1.2-beta" />
3435
</ItemGroup>
3536
</Project>

src/GitHub.Api/GlobalSuppressions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("Reliability", "CA2007:Do not directly await a Task", Justification = "Discouraged for VSSDK projects.")]
9+

src/GitHub.Api/LoginManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ async Task<ApplicationAuthorization> HandleTwoFactorAuthorization(
289289
}
290290
}
291291

292-
ApplicationAuthorization EnsureNonNullAuthorization(ApplicationAuthorization auth)
292+
static ApplicationAuthorization EnsureNonNullAuthorization(ApplicationAuthorization auth)
293293
{
294294
// If a mock IGitHubClient is not set up correctly, it can return null from
295295
// IGutHubClient.Authorization.Create - this will cause an infinite loop in Login()

src/GitHub.App/Api/ApiClient.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace GitHub.Api
1818
{
1919
public partial class ApiClient : IApiClient
2020
{
21-
const string ScopesHeader = "X-OAuth-Scopes";
2221
const string ProductName = Info.ApplicationInfo.ApplicationDescription;
2322
static readonly ILogger log = LogManager.ForContext<ApiClient>();
2423

src/GitHub.App/Collections/VirtualizingList.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
using GitHub.Logging;
1313
using Serilog;
1414

15+
#pragma warning disable CA1010 // Collections should implement generic interface
16+
#pragma warning disable CA1033 // Interface methods should be callable by child types
17+
#pragma warning disable CA1710 // Identifiers should have correct suffix
18+
1519
namespace GitHub.Collections
1620
{
1721
/// <summary>

src/GitHub.App/Collections/VirtualizingListCollectionView.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
using System.Collections.Specialized;
55
using System.Windows.Data;
66

7+
#pragma warning disable CA1010 // Collections should implement generic interface
8+
#pragma warning disable CA1033 // Interface methods should be callable by child types
9+
#pragma warning disable CA1710 // Identifiers should have correct suffix
10+
711
namespace GitHub.Collections
812
{
913
/// <summary>

src/GitHub.App/GitHub.App.csproj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
<ItemGroup>
2626
<ProjectReference Include="..\..\submodules\akavache\src\Akavache.Sqlite3\Akavache.Sqlite3.csproj" />
2727
<ProjectReference Include="..\..\submodules\akavache\src\Akavache.Core\Akavache.Core.csproj" />
28+
<ProjectReference Include="..\..\submodules\octokit.graphql.net\Octokit.GraphQL.Core\Octokit.GraphQL.Core.csproj" />
29+
<ProjectReference Include="..\..\submodules\octokit.graphql.net\Octokit.GraphQL\Octokit.GraphQL.csproj" />
2830
<ProjectReference Include="..\..\submodules\octokit.net\Octokit.Reactive\Octokit.Reactive.csproj" />
2931
<ProjectReference Include="..\..\submodules\octokit.net\Octokit\Octokit.csproj" />
3032
<ProjectReference Include="..\CredentialManagement\CredentialManagement.csproj" />
@@ -44,11 +46,18 @@
4446
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="1.0.164" />
4547
<PackageReference Include="Madskristensen.VisualStudio.SDK" Version="14.3.75-pre" />
4648
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.1" />
49+
<PackageReference Include="Microsoft.VisualStudio.StaticReviews.Embeddable" Version="0.1.14-alpha" />
4750
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
48-
<PackageReference Include="Octokit.GraphQL" Version="0.1.2-beta" />
4951
<PackageReference Include="Rothko" Version="0.0.3-ghfvs" />
5052
<PackageReference Include="Serilog" Version="2.5.0" />
5153
<PackageReference Include="SerilogAnalyzer" Version="0.12.0.0" />
5254
<PackageReference Include="Stateless" Version="2.5.56.0" targetFramework="net45" />
5355
</ItemGroup>
54-
</Project>
56+
<Target Name="LinkStaticReviewsEmbeddableAssemblies" AfterTargets="ResolveReferences" BeforeTargets="FindReferenceAssembliesForReferences">
57+
<ItemGroup>
58+
<ReferencePath Condition="'%(FileName)' == 'Microsoft.VisualStudio.StaticReviews.Embeddable'">
59+
<EmbedInteropTypes>true</EmbedInteropTypes>
60+
</ReferencePath>
61+
</ItemGroup>
62+
</Target>
63+
</Project>

src/GitHub.App/GlobalSuppressions.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
using System.Diagnostics.CodeAnalysis;
2-
3-
[assembly: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "GitHub.ViewModels.CreateRepoViewModel.#ResetState()")]
4-
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.Resources.resources")]
5-
[assembly: SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "GitHub.Caches.CredentialCache.#InsertObject`1(System.String,!!0,System.Nullable`1<System.DateTimeOffset>)")]
6-
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.App.Resources.resources")]
7-
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String)")]
8-
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String,System.Text.Encoding)")]
9-
101
// This file is used by Code Analysis to maintain SuppressMessage
112
// attributes that are applied to this project.
123
// Project-level suppressions either have no target or are given
@@ -16,3 +7,15 @@
167
// Code Analysis results, point to "Suppress Message", and click
178
// "In Suppression File".
189
// You do not need to add suppressions to this file manually.
10+
11+
using System.Diagnostics.CodeAnalysis;
12+
13+
[assembly: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "GitHub.ViewModels.CreateRepoViewModel.#ResetState()")]
14+
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.Resources.resources")]
15+
[assembly: SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "GitHub.Caches.CredentialCache.#InsertObject`1(System.String,!!0,System.Nullable`1<System.DateTimeOffset>)")]
16+
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.App.Resources.resources")]
17+
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String)")]
18+
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String,System.Text.Encoding)")]
19+
[assembly: SuppressMessage("Design", "CA1056:Uri properties should not be strings")]
20+
[assembly: SuppressMessage("Design", "CA1054:Uri parameters should not be strings")]
21+
[assembly: SuppressMessage("Reliability", "CA2007:Do not directly await a Task", Justification = "Discouraged for VSSDK projects.")]

src/GitHub.App/Services/EnterpriseCapabilitiesService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task<EnterpriseLoginMethods> ProbeLoginMethods(Uri enterpriseBaseUr
5555
}
5656
}
5757

58-
private async Task<EnterpriseMeta> GetMetadata(IConnection connection)
58+
private static async Task<EnterpriseMeta> GetMetadata(IConnection connection)
5959
{
6060
var endpoint = new Uri("meta", UriKind.Relative);
6161
var response = await connection.Get<EnterpriseMeta>(endpoint, null, null).ConfigureAwait(false);

src/GitHub.App/Services/ErrorMessageTranslator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using ReactiveUI.Legacy;
88

99
#pragma warning disable CS0618 // Type or member is obsolete
10+
#pragma warning disable CA1034 // Nested types should not be visible
1011

1112
namespace GitHub.Services
1213
{

src/GitHub.App/Services/ModelService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
using Serilog;
2323
using static Octokit.GraphQL.Variable;
2424

25+
#pragma warning disable CA1034 // Nested types should not be visible
26+
2527
namespace GitHub.Services
2628
{
2729
[Export(typeof(IModelService))]
@@ -365,7 +367,7 @@ RemoteRepositoryModel Create(RepositoryCacheItem item)
365367
};
366368
}
367369

368-
GitReferenceModel Create(GitReferenceCacheItem item)
370+
static GitReferenceModel Create(GitReferenceCacheItem item)
369371
{
370372
return new GitReferenceModel(item.Ref, item.Label, item.Sha, item.RepositoryCloneUrl);
371373
}

src/GitHub.App/Services/PullRequestEditorService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,12 @@ await pullRequestService.ExtractToTempFile(
232232

233233
var leftText = diffViewer.LeftView.TextBuffer.CurrentSnapshot.GetText();
234234
var rightText = diffViewer.RightView.TextBuffer.CurrentSnapshot.GetText();
235-
if (leftText == string.Empty)
235+
if (leftText.Length == 0)
236236
{
237237
// Don't show LeftView when empty.
238238
diffViewer.ViewMode = DifferenceViewMode.RightViewOnly;
239239
}
240-
else if (rightText == string.Empty)
240+
else if (rightText.Length == 0)
241241
{
242242
// Don't show RightView when empty.
243243
diffViewer.ViewMode = DifferenceViewMode.LeftViewOnly;
@@ -436,7 +436,7 @@ public int FindMatchingLine(IList<string> fromLines, IList<string> toLines, int
436436
/// <param name="line">The 0-based line we're navigating from.</param>
437437
/// <param name="matchedLines">The number of similar matched lines in <see cref="toLines"/></param>
438438
/// <returns>Find the nearest matching line in <see cref="toLines"/>.</returns>
439-
public int FindNearestMatchingLine(IList<string> fromLines, IList<string> toLines, int line, out int matchedLines)
439+
public static int FindNearestMatchingLine(IList<string> fromLines, IList<string> toLines, int line, out int matchedLines)
440440
{
441441
line = line < fromLines.Count ? line : fromLines.Count - 1; // VS shows one extra line at end
442442
var fromLine = fromLines[line];

0 commit comments

Comments
 (0)