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

Commit 949fc04

Browse files
committed
Lookup GitHubServiceProvider via Services class
This allows the global service to be specified for unit testing and the essentials extension.
1 parent 93ffbd9 commit 949fc04

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/GitHub.VisualStudio.UI/Views/Documents/IssueishCommentView.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using GitHub.ViewModels;
1010
using GitHub.ViewModels.Documents;
1111
using GitHub.VisualStudio.UI.Helpers;
12-
using Microsoft.VisualStudio.Shell;
1312

1413
namespace GitHub.VisualStudio.Views.Documents
1514
{
@@ -28,8 +27,7 @@ public IssueishCommentView()
2827

2928
static IVisualStudioBrowser GetBrowser()
3029
{
31-
var serviceProvider = (IGitHubServiceProvider)Package.GetGlobalService(typeof(IGitHubServiceProvider));
32-
return serviceProvider.GetService<IVisualStudioBrowser>();
30+
return Services.GitHubServiceProvider.GetService<IVisualStudioBrowser>();
3331
}
3432

3533
void DoOpenOnGitHub()

src/GitHub.VisualStudio.UI/Views/PullRequestReviewCommentView.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using GitHub.UI;
77
using GitHub.ViewModels;
88
using GitHub.VisualStudio.UI.Helpers;
9-
using Microsoft.VisualStudio.Shell;
109
using ReactiveUI;
1110

1211
namespace GitHub.VisualStudio.Views
@@ -31,8 +30,7 @@ public PullRequestReviewCommentView()
3130

3231
static IVisualStudioBrowser GetBrowser()
3332
{
34-
var serviceProvider = (IGitHubServiceProvider)Package.GetGlobalService(typeof(IGitHubServiceProvider));
35-
return serviceProvider.GetService<IVisualStudioBrowser>();
33+
return Services.GitHubServiceProvider.GetService<IVisualStudioBrowser>();
3634
}
3735

3836
void DoOpenOnGitHub()

0 commit comments

Comments
 (0)