Skip to content

Commit

Permalink
Move VS layer and some of the options it depends on to the new intern…
Browse files Browse the repository at this point in the history
…al API
  • Loading branch information
mavasani committed Mar 10, 2020
1 parent 00b3593 commit 6e1e5dd
Show file tree
Hide file tree
Showing 22 changed files with 273 additions and 256 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.SplitStringLiteral
{
internal class SplitStringLiteralOptions
{
public static PerLanguageOption<bool> Enabled =
new PerLanguageOption<bool>(nameof(SplitStringLiteralOptions), nameof(Enabled), defaultValue: true,
public static PerLanguageOption2<bool> Enabled =
new PerLanguageOption2<bool>(nameof(SplitStringLiteralOptions), nameof(Enabled), defaultValue: true,
storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.SplitStringLiterals"));
}

Expand Down
4 changes: 2 additions & 2 deletions src/EditorFeatures/Core/Options/ColorSchemeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ internal static class ColorSchemeOptions
{
internal const string ColorSchemeSettingKey = "TextEditor.Roslyn.ColorScheme";

public static readonly Option<SchemeName> ColorScheme = new Option<SchemeName>(nameof(ColorSchemeOptions),
public static readonly Option2<SchemeName> ColorScheme = new Option2<SchemeName>(nameof(ColorSchemeOptions),
nameof(ColorScheme),
defaultValue: SchemeName.VisualStudio2019,
storageLocations: new RoamingProfileStorageLocation(ColorSchemeSettingKey));

public static readonly Option<UseEnhancedColors> LegacyUseEnhancedColors = new Option<UseEnhancedColors>(nameof(ColorSchemeOptions),
public static readonly Option2<UseEnhancedColors> LegacyUseEnhancedColors = new Option2<UseEnhancedColors>(nameof(ColorSchemeOptions),
nameof(LegacyUseEnhancedColors),
defaultValue: UseEnhancedColors.Default,
storageLocations: new RoamingProfileStorageLocation("WindowManagement.Options.UseEnhancedColorsForManagedLanguages"));
Expand Down
6 changes: 3 additions & 3 deletions src/EditorFeatures/Core/Shared/Options/FeatureOnOffOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ internal static class FeatureOnOffOptions
public static readonly PerLanguageOption2<bool> StreamingGoToImplementation = new PerLanguageOption2<bool>(
nameof(FeatureOnOffOptions), nameof(StreamingGoToImplementation), defaultValue: true);

public static readonly Option<bool> NavigateToDecompiledSources = new Option<bool>(
public static readonly Option2<bool> NavigateToDecompiledSources = new Option2<bool>(
nameof(FeatureOnOffOptions), nameof(NavigateToDecompiledSources), defaultValue: false,
storageLocations: new RoamingProfileStorageLocation($"TextEditor.{nameof(NavigateToDecompiledSources)}"));

public static readonly Option<int> UseEnhancedColors = new Option<int>(
public static readonly Option2<int> UseEnhancedColors = new Option2<int>(
nameof(FeatureOnOffOptions), nameof(UseEnhancedColors), defaultValue: 1,
storageLocations: new RoamingProfileStorageLocation("WindowManagement.Options.UseEnhancedColorsForManagedLanguages"));

// Note: no storage location since this is intentionally a session variable
public static readonly Option<bool> AcceptedDecompilerDisclaimer = new Option<bool>(
public static readonly Option2<bool> AcceptedDecompilerDisclaimer = new Option2<bool>(
nameof(FeatureOnOffOptions), nameof(AcceptedDecompilerDisclaimer), defaultValue: false);
}

Expand Down
280 changes: 140 additions & 140 deletions src/VisualStudio/CSharp/Impl/Options/AutomationObject.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ protected override AbstractOptionPageControl CreateOptionPage(IServiceProvider s
{
var builder = ArrayBuilder<(string, ImmutableArray<IOption>)>.GetInstance();
builder.AddRange(GridOptionPreviewControl.GetLanguageAgnosticEditorConfigOptions());
builder.Add((CSharpVSResources.CSharp_Coding_Conventions, CSharpCodeStyleOptions.AllOptions));
builder.Add((CSharpVSResources.CSharp_Formatting_Rules, CSharpFormattingOptions.AllOptions));
builder.Add((CSharpVSResources.CSharp_Coding_Conventions, CSharpCodeStyleOptions.AllOptions.As<IOption>()));
builder.Add((CSharpVSResources.CSharp_Formatting_Rules, CSharpFormattingOptions2.AllOptions.As<IOption>()));
return builder.ToImmutableAndFree();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public FormattingOptionPageControl(OptionStore optionStore) : base(optionStore)
BindToOption(FormatWhenTypingCheckBox, FeatureOnOffOptions.AutoFormattingOnTyping, LanguageNames.CSharp);
BindToOption(FormatOnCloseBraceCheckBox, FeatureOnOffOptions.AutoFormattingOnCloseBrace, LanguageNames.CSharp);
BindToOption(FormatOnSemicolonCheckBox, FeatureOnOffOptions.AutoFormattingOnSemicolon, LanguageNames.CSharp);
BindToOption(FormatOnReturnCheckBox, FormattingOptions.AutoFormattingOnReturn, LanguageNames.CSharp);
BindToOption(FormatOnReturnCheckBox, FormattingOptions2.AutoFormattingOnReturn, LanguageNames.CSharp);
BindToOption(FormatOnPasteCheckBox, FeatureOnOffOptions.FormatOnPaste, LanguageNames.CSharp);
}
}
Expand Down
Loading

0 comments on commit 6e1e5dd

Please sign in to comment.