提交 ae06372a 编写于 作者: B Balaji Soundrarajan

Serialize left out Shared Formatting Options

Fix #2218 : The Formatting Options UseTab, TabSize, IndentSize and
IndentStyle were not getting persisted. This change fixes it. The
integration tests will be added.
上级 ae819709
......@@ -10,7 +10,7 @@
namespace Microsoft.VisualStudio.LanguageServices.CSharp.Options
{
[ExportLanguageSpecificOptionSerializer(LanguageNames.CSharp, FormattingOptions.TabFeatureName, BraceCompletionOptions.FeatureName, CompletionOptions.FeatureName, SignatureHelpOptions.FeatureName, NavigationBarOptions.FeatureName), Shared]
[ExportLanguageSpecificOptionSerializer(LanguageNames.CSharp, FormattingOptions.FormattingFeatureName, FormattingOptions.TabFeatureName, BraceCompletionOptions.FeatureName, CompletionOptions.FeatureName, SignatureHelpOptions.FeatureName, NavigationBarOptions.FeatureName), Shared]
internal class CSharpLanguageSettingsSerializer : AbstractLanguageSettingsSerializer
{
[ImportingConstructor]
......
......@@ -10,7 +10,7 @@ Imports Microsoft.CodeAnalysis.Options
Imports System.Composition
Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options
<ExportLanguageSpecificOptionSerializer(LanguageNames.VisualBasic, FormattingOptions.TabFeatureName, BraceCompletionOptions.FeatureName, CompletionOptions.FeatureName, SignatureHelpOptions.FeatureName, NavigationBarOptions.FeatureName), [Shared]>
<ExportLanguageSpecificOptionSerializer(LanguageNames.VisualBasic, FormattingOptions.FormattingFeatureName, FormattingOptions.TabFeatureName, BraceCompletionOptions.FeatureName, CompletionOptions.FeatureName, SignatureHelpOptions.FeatureName, NavigationBarOptions.FeatureName), [Shared]>
Friend NotInheritable Class VisualBasicLanguageSettingsSerializer
Inherits AbstractLanguageSettingsSerializer
......
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Options.Providers;
namespace Microsoft.CodeAnalysis.Formatting
{
[ExportOptionProvider, Shared]
internal class FormattingOptionsProvider : IOptionProvider
{
private IEnumerable<IOption> _options = new List<IOption>
{
FormattingOptions.UseTabs,
FormattingOptions.TabSize,
FormattingOptions.IndentationSize,
FormattingOptions.SmartIndent
}.ToImmutableArray();
public IEnumerable<IOption> GetOptions()
{
return _options;
}
}
}
......@@ -377,6 +377,7 @@
<Compile Include="FindSymbols\DeclaredSymbolInfo.cs" />
<Compile Include="FindSymbols\SyntaxTree\AbstractSyntaxTreeInfo.cs" />
<Compile Include="FindSymbols\SyntaxTree\SyntaxTreeDeclarationInfo.cs" />
<Compile Include="Formatting\FormattingOptionsProvider.cs" />
<Compile Include="LinkedFileDiffMerging\LinkedFileMergeSessionResult.cs" />
<Compile Include="LinkedFileDiffMerging\DefaultDocumentTextDifferencingService.cs" />
<Compile Include="Log\AggregateLogger.cs" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册