提交 c1c7c0de 编写于 作者: M Matt Warren

Add GenerationOptionsProvider

上级 00da5424
// Copyright (c) Microsoft. 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 System.ComponentModel.Composition;
namespace Microsoft.CodeAnalysis.Options
{
......
......@@ -85,6 +85,7 @@
<Compile Include="..\..\..\Compilers\Helpers\GlobalAssemblyCacheHelpers\GacFileResolver.cs">
<Link>InternalUtilities\GacFileResolver.cs</Link>
</Compile>
<Compile Include="Options\ExportOptionAttribute.cs" />
<Compile Include="InternalUtilities\FilePathUtilities.cs" />
<Compile Include="Log\EtwLogger.cs" />
<Compile Include="Log\RoslynEventSource.cs" />
......
......@@ -4,11 +4,10 @@
namespace Microsoft.CodeAnalysis.Editing
{
internal partial class GenerationOptions
internal class GenerationOptions
{
public const string FeatureName = "Organizer";
[ExportOption]
public static readonly PerLanguageOption<bool> PlaceSystemNamespaceFirst = new PerLanguageOption<bool>(FeatureName, "PlaceSystemNamespaceFirst", defaultValue: true);
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Options.Providers;
namespace Microsoft.CodeAnalysis.Editing
{
[ExportOptionProvider, Shared]
internal class GenerationOptionsProvider : IOptionProvider
{
private IEnumerable<IOption> _options = ImmutableArray.Create<IOption>(
GenerationOptions.PlaceSystemNamespaceFirst
);
public IEnumerable<IOption> GetOptions()
{
return _options;
}
}
}
\ No newline at end of file
......@@ -326,6 +326,7 @@
<Compile Include="CodeGeneration\INamedTypeSymbolExtensions.cs" />
<Compile Include="CodeGeneration\LiteralSpecialValues.cs" />
<Compile Include="Editing\GenerationOptions.cs" />
<Compile Include="Editing\GenerationOptionsProvider.cs" />
<Compile Include="Editing\ImportAdder.cs" />
<Compile Include="Editing\SolutionEditor.cs" />
<Compile Include="Editing\SymbolEditor.cs" />
......@@ -379,7 +380,6 @@
<Compile Include="Log\LogAggregator.cs" />
<Compile Include="Log\Logger.LogBlock.cs" />
<Compile Include="Log\LogMessage.cs" />
<Compile Include="Options\ExportOptionAttribute.cs" />
<Compile Include="Serialization\AssemblySerializationInfoService.cs" />
<Compile Include="Serialization\IAssemblySerializationInfoService.cs" />
<Compile Include="Shared\Extensions\TextDocumentExtensions.cs" />
......@@ -928,4 +928,4 @@
<Import Project="..\..\..\..\build\VSL.Imports.Closed.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册