Add IDE extensibility for project engine
This commit is contained in:
parent
b644ecfeaa
commit
fcf6ea03a9
|
|
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue