Fix RazorDirectiveCompletionProvider MEF dependency.
This commit is contained in:
parent
a6d03bd407
commit
f9ad346be8
|
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel.Composition;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
using Microsoft.CodeAnalysis.Text;
|
using Microsoft.CodeAnalysis.Text;
|
||||||
|
|
@ -10,10 +11,13 @@ using Microsoft.VisualStudio.Text.Projection;
|
||||||
|
|
||||||
namespace Microsoft.VisualStudio.Editor.Razor
|
namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
|
[System.Composition.Shared]
|
||||||
|
[Export(typeof(RazorTextBufferProvider))]
|
||||||
internal class DefaultTextBufferProvider : RazorTextBufferProvider
|
internal class DefaultTextBufferProvider : RazorTextBufferProvider
|
||||||
{
|
{
|
||||||
private readonly IBufferGraphFactoryService _bufferGraphService;
|
private readonly IBufferGraphFactoryService _bufferGraphService;
|
||||||
|
|
||||||
|
[ImportingConstructor]
|
||||||
public DefaultTextBufferProvider(IBufferGraphFactoryService bufferGraphService)
|
public DefaultTextBufferProvider(IBufferGraphFactoryService bufferGraphService)
|
||||||
{
|
{
|
||||||
if (bufferGraphService == null)
|
if (bufferGraphService == null)
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
// 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.Text.Projection;
|
|
||||||
|
|
||||||
namespace Microsoft.VisualStudio.Editor.Razor
|
|
||||||
{
|
|
||||||
[Shared]
|
|
||||||
[ExportLanguageServiceFactory(typeof(RazorTextBufferProvider), RazorLanguage.Name)]
|
|
||||||
internal class DefaultTextBufferProviderFactory : ILanguageServiceFactory
|
|
||||||
{
|
|
||||||
private readonly IBufferGraphFactoryService _bufferGraphService;
|
|
||||||
|
|
||||||
[ImportingConstructor]
|
|
||||||
public DefaultTextBufferProviderFactory(IBufferGraphFactoryService bufferGraphService)
|
|
||||||
{
|
|
||||||
if (bufferGraphService == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(bufferGraphService));
|
|
||||||
}
|
|
||||||
|
|
||||||
_bufferGraphService = bufferGraphService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ILanguageService CreateLanguageService(HostLanguageServices languageServices)
|
|
||||||
{
|
|
||||||
if (languageServices == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(languageServices));
|
|
||||||
}
|
|
||||||
|
|
||||||
return new DefaultTextBufferProvider(_bufferGraphService);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue