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

Commit 07bff2d

Browse files
committed
Use Lazy rather than IGitHubServiceProvider
Since IPullRequestSessionManager is a MEF component we can import Lazy<IPullRequestSessionManager> directly rather than going through IGitHubServiceProvider.GetService<IPullRequestSessionManager>().
1 parent 024a552 commit 07bff2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitHub.InlineReviews/Margins/InlineCommentMarginProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ internal sealed class InlineCommentMarginProvider : IWpfTextViewMarginProvider
2727

2828
[ImportingConstructor]
2929
public InlineCommentMarginProvider(
30-
Lazy<IGitHubServiceProvider> serviceProvider,
30+
Lazy<IPullRequestSessionManager> sessionManager,
3131
Lazy<IEditorFormatMapService> editorFormatMapService,
3232
Lazy<IViewTagAggregatorFactoryService> tagAggregatorFactory,
3333
Lazy<IInlineCommentPeekService> peekService)
3434
{
35+
this.sessionManager = sessionManager;
3536
this.editorFormatMapService = editorFormatMapService;
3637
this.tagAggregatorFactory = tagAggregatorFactory;
3738
this.peekService = peekService;
38-
sessionManager = new Lazy<IPullRequestSessionManager>(() => serviceProvider.Value.GetService<IPullRequestSessionManager>());
3939

4040
uiContext = UIContext.FromUIContextGuid(new Guid(Guids.UIContext_Git));
4141
}

0 commit comments

Comments
 (0)