-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from chabiss/dev/chabiss/vdiag-lsp-refactoring
Moving All handling of broker service from EA.D into the implementation IVisualDiagnosticsLanguageService
- Loading branch information
Showing
9 changed files
with
121 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 0 additions & 104 deletions
104
src/Tools/ExternalAccess/VisualDiagnostics/Internal/BrokeredDebuggerServices.cs
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
src/Tools/ExternalAccess/VisualDiagnostics/Internal/VisualDiagnosticsServiceBroker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis.ExternalAccess.VisualDiagnostics.Contracts; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.ServiceHub.Framework; | ||
using Microsoft.VisualStudio.Composition; | ||
using Microsoft.VisualStudio.Shell.ServiceBroker; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VisualDiagnostics.Internal | ||
{ | ||
/// <summary> | ||
/// This is a simple wrapper to succeed at getting the broker service using System.ComponentModel.Composition inside an LSP service OnInitialized factory | ||
/// </summary> | ||
[Export(typeof(IVisualDiagnosticsServiceBroker))] | ||
internal sealed class VisualDiagnosticsServiceBroker : IVisualDiagnosticsServiceBroker | ||
{ | ||
private readonly Lazy<Task<IBrokeredServiceContainer>> _container; | ||
|
||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
public VisualDiagnosticsServiceBroker( | ||
[Import(typeof(SVsBrokeredServiceContainer))] | ||
Lazy<Task<IBrokeredServiceContainer>> serviceBroker) | ||
{ | ||
_container = serviceBroker; | ||
} | ||
|
||
public async Task<IServiceBroker> GetServiceBrokerAsync() | ||
{ | ||
// Waiting on the container to be created | ||
await _container.Value.ConfigureAwait(false); | ||
return _container.Value.Result.GetFullAccessServiceBroker(); | ||
} | ||
} | ||
} |
Oops, something went wrong.