Add IDE extensibility for project engine

This commit is contained in:
Ryan Nowak 2018-02-19 14:03:41 -08:00
parent b644ecfeaa
commit fcf6ea03a9
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,28 @@
// 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;
namespace Microsoft.CodeAnalysis.Razor
{
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class ExportCustomProjectEngineFactoryAttribute : ExportAttribute, ICustomProjectEngineFactoryMetadata
{
public ExportCustomProjectEngineFactoryAttribute(string configurationName)
: base(typeof(IProjectEngineFactory))
{
if (configurationName == null)
{
throw new ArgumentNullException(nameof(configurationName));
}
ConfigurationName = configurationName;
}
public string ConfigurationName { get; }
public bool SupportsSerialization { get; set; }
}
}

View File

@ -0,0 +1,12 @@
// 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.
namespace Microsoft.CodeAnalysis.Razor
{
public interface ICustomProjectEngineFactoryMetadata
{
string ConfigurationName { get; }
bool SupportsSerialization { get; }
}
}

View File

@ -0,0 +1,13 @@
// 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 Microsoft.AspNetCore.Razor.Language;
namespace Microsoft.CodeAnalysis.Razor
{
public interface IProjectEngineFactory
{
RazorProjectEngine Create(RazorConfiguration configuration, RazorProjectFileSystem fileSystem, Action<RazorProjectEngineBuilder> configure);
}
}