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

Commit a30eaae

Browse files
committed
Pass JoinableTaskContext to VSGitExtFactory
1 parent 5893086 commit a30eaae

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/GitHub.TeamFoundation.14/Services/VSGitExt.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public class VSGitExt : IVSGitExt
3333
IGitExt gitExt;
3434
IReadOnlyList<LocalRepositoryModel> activeRepositories;
3535

36+
/// NOTE: Used by VSGitExtFactory.
37+
public VSGitExt(IServiceProvider serviceProvider, IGitService gitService, JoinableTaskContext joinableTaskContext)
38+
: this(serviceProvider, new VSUIContextFactory(), gitService, joinableTaskContext)
39+
{
40+
}
41+
3642
public VSGitExt(IServiceProvider serviceProvider, IVSUIContextFactory factory, IGitService gitService,
3743
JoinableTaskContext joinableTaskContext)
3844
{

src/GitHub.VisualStudio/GitHubPackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ async Task<object> CreateService(IAsyncServiceContainer container, CancellationT
398398
else if (serviceType == typeof(IVSGitExt))
399399
{
400400
var vsVersion = ApplicationInfo.GetHostVersionInfo().FileMajorPart;
401-
return new VSGitExtFactory(vsVersion, this, GitService.GitServiceHelper).Create();
401+
return new VSGitExtFactory(vsVersion, this, GitService.GitServiceHelper, ThreadHelper.JoinableTaskContext).Create();
402402
}
403403
else if (serviceType == typeof(IGitHubToolWindowManager))
404404
{

src/GitHub.VisualStudio/Services/VSGitExtFactory.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
2-
using System.Reflection;
32
using GitHub.Logging;
4-
using GitHub.VisualStudio.Base;
3+
using Microsoft.VisualStudio.Threading;
54
using Serilog;
65

76
namespace GitHub.Services
@@ -13,12 +12,14 @@ public class VSGitExtFactory
1312
readonly int vsVersion;
1413
readonly IServiceProvider serviceProvider;
1514
readonly IGitService gitService;
15+
readonly JoinableTaskContext joinableTaskContect;
1616

17-
public VSGitExtFactory(int vsVersion, IServiceProvider serviceProvider, IGitService gitService)
17+
public VSGitExtFactory(int vsVersion, IServiceProvider serviceProvider, IGitService gitService, JoinableTaskContext joinableTaskContect)
1818
{
1919
this.vsVersion = vsVersion;
2020
this.serviceProvider = serviceProvider;
2121
this.gitService = gitService;
22+
this.joinableTaskContect = joinableTaskContect;
2223
}
2324

2425
// The GitHub.TeamFoundation.* assemblies target different .NET and Visual Studio versions.
@@ -28,7 +29,7 @@ public IVSGitExt Create()
2829
{
2930
if(Type.GetType($"GitHub.VisualStudio.Base.VSGitExt, GitHub.TeamFoundation.{vsVersion}", false) is Type type)
3031
{
31-
return (IVSGitExt)Activator.CreateInstance(type, serviceProvider, gitService);
32+
return (IVSGitExt)Activator.CreateInstance(type, serviceProvider, gitService, joinableTaskContect);
3233
}
3334

3435
log.Error("There is no IVSGitExt implementation for DTE version {Version}", vsVersion);

0 commit comments

Comments
 (0)