Use windows VS error reporter instead of the no-op default

This commit is contained in:
Ajay Bhargav Baaskaran 2017-12-05 12:54:16 -08:00
parent 7ec0e9fb23
commit 6be80e7bed
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Composition;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.VisualStudio.Shell;
namespace Microsoft.VisualStudio.LanguageServices.Razor
{
[Shared]
[ExportWorkspaceServiceFactory(typeof(ErrorReporter), ServiceLayer.Host)]
internal class VisualStudioErrorReporterFactory : IWorkspaceServiceFactory
{
private readonly IServiceProvider _serviceProvider;
[ImportingConstructor]
public VisualStudioErrorReporterFactory(SVsServiceProvider serviceProvider)
{
if (serviceProvider == null)
{
throw new ArgumentNullException(nameof(serviceProvider));
}
_serviceProvider = serviceProvider;
}
public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
{
return new VisualStudioErrorReporter(_serviceProvider);
}
}
}