提交 f8cbdc6f 编写于 作者: J Jason Malinowski

Add metadata to our options to explain where they are persisted

Now that we have an API for associating persistence information,
we can put that information on all our options we persist today.
We'll consume this in a future commit.
上级 7d27ae38
......@@ -11,7 +11,8 @@ internal class SplitStringLiteralOptions
public const string FeatureName = "SplitStringLiteral";
public static PerLanguageOption<bool> Enabled =
new PerLanguageOption<bool>(FeatureName, nameof(Enabled), defaultValue: true);
new PerLanguageOption<bool>(FeatureName, nameof(Enabled), defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.SplitStringLiterals"));
}
[ExportOptionProvider, Shared]
......
......@@ -8,6 +8,7 @@ internal static class BraceCompletionOptions
{
public const string FeatureName = "BraceCompletion";
// This is serialized by the Visual Studio-specific LanguageSettingsSerializer
[ExportOption]
public static readonly PerLanguageOption<bool> EnableBraceCompletion = new PerLanguageOption<bool>(FeatureName, "EnableBraceCompletion", defaultValue: true);
}
......
......@@ -8,6 +8,7 @@ internal static class SignatureHelpOptions
{
public const string FeatureName = "Signature Help";
// This is serialized by the Visual Studio-specific LanguageSettingsSerializer
[ExportOption]
public static readonly PerLanguageOption<bool> ShowSignatureHelp = new PerLanguageOption<bool>(FeatureName, "Show Signature Help", defaultValue: true);
}
......
......@@ -10,14 +10,18 @@ namespace Microsoft.CodeAnalysis.Editor.Shared.Options
internal static class EditorComponentOnOffOptions
{
public const string OptionName = "FeatureManager/Components";
private const string LocalRegistryPath = @"Roslyn\Internal\OnOff\Components\";
[ExportOption]
public static readonly Option<bool> Adornment = new Option<bool>(OptionName, "Adornment", defaultValue: true);
public static readonly Option<bool> Adornment = new Option<bool>(OptionName, "Adornment", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Adornment"));
[ExportOption]
public static readonly Option<bool> Tagger = new Option<bool>(OptionName, "Tagger", defaultValue: true);
public static readonly Option<bool> Tagger = new Option<bool>(OptionName, "Tagger", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Tagger"));
[ExportOption]
public static readonly Option<bool> CodeRefactorings = new Option<bool>(OptionName, "Code Refactorings", defaultValue: true);
public static readonly Option<bool> CodeRefactorings = new Option<bool>(OptionName, "Code Refactorings", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Code Refactorings"));
}
}
......@@ -8,44 +8,59 @@ internal static class FeatureOnOffOptions
{
public const string OptionName = "EditorFeaturesOnOff";
// This value is only used by Visual Basic, and so is using the old serialization name that was used by VB.
[ExportOption]
public static readonly PerLanguageOption<bool> EndConstruct = new PerLanguageOption<bool>(OptionName, "End Construct", defaultValue: true);
public static readonly PerLanguageOption<bool> EndConstruct = new PerLanguageOption<bool>(OptionName, "End Construct", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.AutoEndInsert"));
// This value is only used by Visual Basic, and so is using the old serialization name that was used by VB.
[ExportOption]
public static readonly PerLanguageOption<bool> AutomaticInsertionOfAbstractOrInterfaceMembers = new PerLanguageOption<bool>(OptionName, "Automatic Insertion of Abstract or Interface Members", defaultValue: true);
public static readonly PerLanguageOption<bool> AutomaticInsertionOfAbstractOrInterfaceMembers = new PerLanguageOption<bool>(OptionName, "Automatic Insertion of Abstract or Interface Members", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.AutoRequiredMemberInsert"));
[ExportOption]
public static readonly PerLanguageOption<bool> LineSeparator = new PerLanguageOption<bool>(OptionName, "Line Separator", defaultValue: false);
public static readonly PerLanguageOption<bool> LineSeparator = new PerLanguageOption<bool>(OptionName, "Line Separator", defaultValue: false,
persistences: new RoamingProfilePersistence(language => language == LanguageNames.VisualBasic ? "TextEditor.%LANGUAGE%.Specific.DisplayLineSeparators" : "TextEditor.%LANGUAGE%.Specific.Line Separator"));
[ExportOption]
public static readonly PerLanguageOption<bool> Outlining = new PerLanguageOption<bool>(OptionName, "Outlining", defaultValue: true);
public static readonly PerLanguageOption<bool> Outlining = new PerLanguageOption<bool>(OptionName, "Outlining", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.Outlining"));
[ExportOption]
public static readonly PerLanguageOption<bool> KeywordHighlighting = new PerLanguageOption<bool>(OptionName, "Keyword Highlighting", defaultValue: true);
public static readonly PerLanguageOption<bool> KeywordHighlighting = new PerLanguageOption<bool>(OptionName, "Keyword Highlighting", defaultValue: true,
persistences: new RoamingProfilePersistence(language => language == LanguageNames.VisualBasic ? "TextEditor.%LANGUAGE%.Specific.EnableHighlightRelatedKeywords" : "TextEditor.%LANGUAGE%.Specific.Keyword Highlighting"));
[ExportOption]
public static readonly PerLanguageOption<bool> ReferenceHighlighting = new PerLanguageOption<bool>(OptionName, "Reference Highlighting", defaultValue: true);
public static readonly PerLanguageOption<bool> ReferenceHighlighting = new PerLanguageOption<bool>(OptionName, "Reference Highlighting", defaultValue: true,
persistences: new RoamingProfilePersistence(language => language == LanguageNames.VisualBasic ? "TextEditor.%LANGUAGE%.Specific.EnableHighlightReferences" : "TextEditor.%LANGUAGE%.Specific.Reference Highlighting"));
[ExportOption]
public static readonly PerLanguageOption<bool> FormatOnPaste = new PerLanguageOption<bool>(OptionName, "FormatOnPaste", defaultValue: true);
public static readonly PerLanguageOption<bool> FormatOnPaste = new PerLanguageOption<bool>(OptionName, "FormatOnPaste", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.FormatOnPaste"));
[ExportOption]
public static readonly PerLanguageOption<bool> AutoXmlDocCommentGeneration = new PerLanguageOption<bool>(OptionName, "Automatic XML Doc Comment Generation", defaultValue: true);
public static readonly PerLanguageOption<bool> AutoXmlDocCommentGeneration = new PerLanguageOption<bool>(OptionName, "Automatic XML Doc Comment Generation", defaultValue: true,
persistences: new RoamingProfilePersistence(language => language == LanguageNames.VisualBasic ? "TextEditor.%LANGUAGE%.Specific.AutoComment" : "TextEditor.%LANGUAGE%.Specific.Automatic XML Doc Comment Generation"));
[ExportOption]
public static readonly PerLanguageOption<bool> AutoInsertBlockCommentStartString = new PerLanguageOption<bool>(OptionName, "Auto Insert Block Comment Start String", defaultValue: true);
public static readonly PerLanguageOption<bool> AutoInsertBlockCommentStartString = new PerLanguageOption<bool>(OptionName, "Auto Insert Block Comment Start String", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.Auto Insert Block Comment Start String"));
[ExportOption]
public static readonly PerLanguageOption<bool> PrettyListing = new PerLanguageOption<bool>(OptionName, "Pretty List On Line Commit", defaultValue: true);
public static readonly PerLanguageOption<bool> PrettyListing = new PerLanguageOption<bool>(OptionName, "Pretty List On Line Commit", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PrettyListing"));
[ExportOption]
public static readonly PerLanguageOption<bool> AutoFormattingOnCloseBrace = new PerLanguageOption<bool>(OptionName, "Auto Formatting On Close Brace", defaultValue: true);
public static readonly PerLanguageOption<bool> AutoFormattingOnCloseBrace = new PerLanguageOption<bool>(OptionName, "Auto Formatting On Close Brace", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.Auto Formatting On Close Brace"));
[ExportOption]
public static readonly PerLanguageOption<bool> AutoFormattingOnSemicolon = new PerLanguageOption<bool>(OptionName, "Auto Formatting On Semicolon", defaultValue: true);
public static readonly PerLanguageOption<bool> AutoFormattingOnSemicolon = new PerLanguageOption<bool>(OptionName, "Auto Formatting On Semicolon", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.Auto Formatting On Semicolon"));
[ExportOption]
public static readonly PerLanguageOption<bool> RenameTrackingPreview = new PerLanguageOption<bool>(OptionName, "Rename Tracking Preview", defaultValue: true);
public static readonly PerLanguageOption<bool> RenameTrackingPreview = new PerLanguageOption<bool>(OptionName, "Rename Tracking Preview", defaultValue: true,
persistences: new RoamingProfilePersistence(language => language == LanguageNames.VisualBasic ? "TextEditor.%LANGUAGE%.Specific.RenameTrackingPreview" : "TextEditor.%LANGUAGE%.Specific.Rename Tracking Preview"));
/// <summary>
/// This option is currently used by Roslyn, but we might want to implement it in the
......
......@@ -7,66 +7,84 @@ namespace Microsoft.CodeAnalysis.Editor.Shared.Options
internal static class InternalFeatureOnOffOptions
{
public const string OptionName = "FeatureManager/Features";
private const string LocalRegistryPath = @"Roslyn\Internal\OnOff\Features\";
[ExportOption]
public static readonly Option<bool> BraceMatching = new Option<bool>(OptionName, "Brace Matching", defaultValue: true);
public static readonly Option<bool> BraceMatching = new Option<bool>(OptionName, "Brace Matching", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Brace Matching"));
[ExportOption]
public static readonly Option<bool> Classification = new Option<bool>(OptionName, "Classification", defaultValue: true);
public static readonly Option<bool> Classification = new Option<bool>(OptionName, "Classification", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Classification"));
[ExportOption]
public static readonly Option<bool> SemanticColorizer = new Option<bool>(OptionName, "Semantic Colorizer", defaultValue: true);
public static readonly Option<bool> SemanticColorizer = new Option<bool>(OptionName, "Semantic Colorizer", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Semantic Colorizer"));
[ExportOption]
public static readonly Option<bool> SyntacticColorizer = new Option<bool>(OptionName, "Syntactic Colorizer", defaultValue: true);
public static readonly Option<bool> SyntacticColorizer = new Option<bool>(OptionName, "Syntactic Colorizer", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Syntactic Colorizer"));
[ExportOption]
public static readonly Option<bool> AutomaticPairCompletion = new Option<bool>(OptionName, "Automatic Pair Completion", defaultValue: true);
public static readonly Option<bool> AutomaticPairCompletion = new Option<bool>(OptionName, "Automatic Pair Completion", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Automatic Pair Completion"));
[ExportOption]
public static readonly Option<bool> AutomaticLineEnder = new Option<bool>(OptionName, "Automatic Line Ender", defaultValue: true);
public static readonly Option<bool> AutomaticLineEnder = new Option<bool>(OptionName, "Automatic Line Ender", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Automatic Line Ender"));
[ExportOption]
public static readonly Option<bool> SmartIndenter = new Option<bool>(OptionName, "Smart Indenter", defaultValue: true);
public static readonly Option<bool> SmartIndenter = new Option<bool>(OptionName, "Smart Indenter", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Smart Indenter"));
[ExportOption]
public static readonly Option<bool> CompletionSet = new Option<bool>(OptionName, "Completion Set", defaultValue: true);
public static readonly Option<bool> CompletionSet = new Option<bool>(OptionName, "Completion Set", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Completion Set"));
[ExportOption]
public static readonly Option<bool> KeywordHighlight = new Option<bool>(OptionName, "Keyword Highlight", defaultValue: true);
public static readonly Option<bool> KeywordHighlight = new Option<bool>(OptionName, "Keyword Highlight", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Keyword Highlight"));
[ExportOption]
public static readonly Option<bool> QuickInfo = new Option<bool>(OptionName, "Quick Info", defaultValue: true);
public static readonly Option<bool> QuickInfo = new Option<bool>(OptionName, "Quick Info", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Quick Info"));
[ExportOption]
public static readonly Option<bool> Squiggles = new Option<bool>(OptionName, "Squiggles", defaultValue: true);
public static readonly Option<bool> Squiggles = new Option<bool>(OptionName, "Squiggles", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Squiggles"));
[ExportOption]
public static readonly Option<bool> FormatOnSave = new Option<bool>(OptionName, "FormatOnSave", defaultValue: true);
public static readonly Option<bool> FormatOnSave = new Option<bool>(OptionName, "FormatOnSave", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "FormatOnSave"));
[ExportOption]
public static readonly Option<bool> RenameTracking = new Option<bool>(OptionName, "Rename Tracking", defaultValue: true);
public static readonly Option<bool> RenameTracking = new Option<bool>(OptionName, "Rename Tracking", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Rename Tracking"));
[ExportOption]
public static readonly Option<bool> EventHookup = new Option<bool>(OptionName, "Event Hookup", defaultValue: true);
public static readonly Option<bool> EventHookup = new Option<bool>(OptionName, "Event Hookup", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Event Hookup"));
/// <remarks>
/// Due to https://github.com/dotnet/roslyn/issues/5393, the name "Snippets" is unusable.
/// Due to https://github.com/dotnet/roslyn/issues/5393, the name "Snippets" is unusable for serialization.
/// (Summary: Some builds incorrectly set it without providing a way to clear it so it exists in many registries.)
/// </remarks>
[ExportOption]
public static readonly Option<bool> Snippets = new Option<bool>(OptionName, "Snippets2", defaultValue: true);
public static readonly Option<bool> Snippets = new Option<bool>(OptionName, "Snippets2", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Snippets2"));
[ExportOption]
public static readonly Option<bool> TodoComments = new Option<bool>(OptionName, "Todo Comments", defaultValue: true);
public static readonly Option<bool> TodoComments = new Option<bool>(OptionName, "Todo Comments", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Todo Comments"));
[ExportOption]
public static readonly Option<bool> DesignerAttributes = new Option<bool>(OptionName, "Designer Attribute", defaultValue: true);
public static readonly Option<bool> DesignerAttributes = new Option<bool>(OptionName, "Designer Attribute", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Designer Attribute"));
[ExportOption]
public static readonly Option<bool> FullSolutionAnalysisMemoryMonitor = new Option<bool>(OptionName, "Full Solution Analysis Memory Monitor", defaultValue: true);
public static readonly Option<bool> FullSolutionAnalysisMemoryMonitor = new Option<bool>(OptionName, "Full Solution Analysis Memory Monitor", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Full Solution Analysis Memory Monitor"));
[ExportOption]
public static readonly Option<bool> ProjectReferenceConversion = new Option<bool>(OptionName, "Project Reference Conversion", defaultValue: true);
public static readonly Option<bool> ProjectReferenceConversion = new Option<bool>(OptionName, "Project Reference Conversion", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Project Reference Conversion"));
}
}
\ No newline at end of file
}
......@@ -9,20 +9,31 @@ internal static class CompletionOptions
{
internal const string FeatureName = "Completion";
// This is serialized by the Visual Studio-specific LanguageSettingsSerializer
public static readonly PerLanguageOption<bool> HideAdvancedMembers = new PerLanguageOption<bool>(FeatureName, "HideAdvancedMembers", defaultValue: false);
// This is serialized by the Visual Studio-specific LanguageSettingsSerializer
public static readonly PerLanguageOption<bool> TriggerOnTyping = new PerLanguageOption<bool>(FeatureName, "TriggerOnTyping", defaultValue: true);
public static readonly PerLanguageOption<bool> TriggerOnTypingLetters = new PerLanguageOption<bool>(FeatureName, nameof(TriggerOnTypingLetters), defaultValue: true);
public static readonly PerLanguageOption<bool?> TriggerOnDeletion = new PerLanguageOption<bool?>(FeatureName, nameof(TriggerOnDeletion), defaultValue: null);
public static readonly PerLanguageOption<bool> TriggerOnTypingLetters = new PerLanguageOption<bool>(FeatureName, nameof(TriggerOnTypingLetters), defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.TriggerOnTypingLetters"));
public static readonly PerLanguageOption<bool?> TriggerOnDeletion = new PerLanguageOption<bool?>(FeatureName, nameof(TriggerOnDeletion), defaultValue: null,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.TriggerOnDeletion"));
public static readonly PerLanguageOption<EnterKeyRule> EnterKeyBehavior =
new PerLanguageOption<EnterKeyRule>(FeatureName, nameof(EnterKeyBehavior), defaultValue: EnterKeyRule.Default);
new PerLanguageOption<EnterKeyRule>(FeatureName, nameof(EnterKeyBehavior), defaultValue: EnterKeyRule.Default,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.EnterKeyBehavior"));
public static readonly PerLanguageOption<SnippetsRule> SnippetsBehavior =
new PerLanguageOption<SnippetsRule>(FeatureName, nameof(SnippetsBehavior), defaultValue: SnippetsRule.Default);
new PerLanguageOption<SnippetsRule>(FeatureName, nameof(SnippetsBehavior), defaultValue: SnippetsRule.Default,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.SnippetsBehavior"));
// Dev15 options
public static readonly PerLanguageOption<bool> ShowCompletionItemFilters = new PerLanguageOption<bool>(FeatureName, nameof(ShowCompletionItemFilters), defaultValue: true);
public static readonly PerLanguageOption<bool> HighlightMatchingPortionsOfCompletionListItems = new PerLanguageOption<bool>(FeatureName, nameof(HighlightMatchingPortionsOfCompletionListItems), defaultValue: true);
public static readonly PerLanguageOption<bool> ShowCompletionItemFilters = new PerLanguageOption<bool>(FeatureName, nameof(ShowCompletionItemFilters), defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.ShowCompletionItemFilters"));
public static readonly PerLanguageOption<bool> HighlightMatchingPortionsOfCompletionListItems = new PerLanguageOption<bool>(FeatureName, nameof(HighlightMatchingPortionsOfCompletionListItems), defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.HighlightMatchingPortionsOfCompletionListItems"));
public static IEnumerable<PerLanguageOption<bool>> GetDev15CompletionOptions()
{
......@@ -39,4 +50,4 @@ internal static class CompletionControllerOptions
public static readonly Option<bool> FilterOutOfScopeLocals = new Option<bool>(ControllerFeatureName, "FilterOutOfScopeLocals", defaultValue: true);
public static readonly Option<bool> ShowXmlDocCommentCompletion = new Option<bool>(ControllerFeatureName, "ShowXmlDocCommentCompletion", defaultValue: true);
}
}
\ No newline at end of file
}
......@@ -8,8 +8,13 @@ internal static class ExtractMethodOptions
{
public const string FeatureName = "ExtractMethod";
public static readonly PerLanguageOption<bool> AllowBestEffort = new PerLanguageOption<bool>(FeatureName, "Allow Best Effort", defaultValue: false);
public static readonly PerLanguageOption<bool> DontPutOutOrRefOnStruct = new PerLanguageOption<bool>(FeatureName, "Don't Put Out Or Ref On Strcut", defaultValue: true);
public static readonly PerLanguageOption<bool> AllowMovingDeclaration = new PerLanguageOption<bool>(FeatureName, "Allow Moving Declaration", defaultValue: false);
public static readonly PerLanguageOption<bool> AllowBestEffort = new PerLanguageOption<bool>(FeatureName, "Allow Best Effort", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.Allow Best Effort"));
public static readonly PerLanguageOption<bool> DontPutOutOrRefOnStruct = new PerLanguageOption<bool>(FeatureName, "Don't Put Out Or Ref On Strcut", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.Don't Put Out Or Ref On Strcut")); // NOTE: the spelling error is what we've shipped and thus should not change
public static readonly PerLanguageOption<bool> AllowMovingDeclaration = new PerLanguageOption<bool>(FeatureName, "Allow Moving Declaration", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.Allow Moving Declaration"));
}
}
......@@ -7,9 +7,11 @@ internal class AddImportOptions
public const string FeatureName = "AddImport";
public static PerLanguageOption<bool> SuggestForTypesInReferenceAssemblies =
new PerLanguageOption<bool>(FeatureName, nameof(SuggestForTypesInReferenceAssemblies), defaultValue: false);
new PerLanguageOption<bool>(FeatureName, nameof(SuggestForTypesInReferenceAssemblies), defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.SuggestForTypesInReferenceAssemblies"));
public static PerLanguageOption<bool> SuggestForTypesInNuGetPackages =
new PerLanguageOption<bool>(FeatureName, nameof(SuggestForTypesInNuGetPackages), defaultValue: false);
new PerLanguageOption<bool>(FeatureName, nameof(SuggestForTypesInNuGetPackages), defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.SuggestForTypesInNuGetPackages"));
}
}
......@@ -7,15 +7,30 @@ namespace Microsoft.CodeAnalysis.SolutionCrawler
internal static class InternalSolutionCrawlerOptions
{
public const string OptionName = "SolutionCrawler";
private const string LocalRegistryPath = @"Roslyn\Internal\SolutionCrawler\";
public static readonly Option<bool> SolutionCrawler = new Option<bool>("FeatureManager/Components", "Solution Crawler", defaultValue: true);
public static readonly Option<bool> DirectDependencyPropagationOnly = new Option<bool>(OptionName, "Project propagation only on direct dependency", defaultValue: true);
public static readonly Option<bool> SolutionCrawler = new Option<bool>(OptionName, "Solution Crawler", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Solution Crawler"));
public static readonly Option<int> ActiveFileWorkerBackOffTimeSpanInMS = new Option<int>(OptionName, "Active file worker backoff timespan in ms", defaultValue: 400);
public static readonly Option<int> AllFilesWorkerBackOffTimeSpanInMS = new Option<int>(OptionName, "All files worker backoff timespan in ms", defaultValue: 1500);
public static readonly Option<int> EntireProjectWorkerBackOffTimeSpanInMS = new Option<int>(OptionName, "Entire project analysis worker backoff timespan in ms", defaultValue: 5000);
public static readonly Option<int> SemanticChangeBackOffTimeSpanInMS = new Option<int>(OptionName, "Semantic change backoff timespan in ms", defaultValue: 100);
public static readonly Option<int> ProjectPropagationBackOffTimeSpanInMS = new Option<int>(OptionName, "Project propagation backoff timespan in ms", defaultValue: 500);
public static readonly Option<int> PreviewBackOffTimeSpanInMS = new Option<int>(OptionName, "Preview backoff timespan in ms", defaultValue: 500);
public static readonly Option<bool> DirectDependencyPropagationOnly = new Option<bool>(OptionName, "Project propagation only on direct dependency", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Project propagation only on direct dependency"));
public static readonly Option<int> ActiveFileWorkerBackOffTimeSpanInMS = new Option<int>(OptionName, "Active file worker backoff timespan in ms", defaultValue: 400,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Active file worker backoff timespan in ms"));
public static readonly Option<int> AllFilesWorkerBackOffTimeSpanInMS = new Option<int>(OptionName, "All files worker backoff timespan in ms", defaultValue: 1500,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "All files worker backoff timespan in ms"));
public static readonly Option<int> EntireProjectWorkerBackOffTimeSpanInMS = new Option<int>(OptionName, "Entire project analysis worker backoff timespan in ms", defaultValue: 5000,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Entire project analysis worker backoff timespan in ms"));
public static readonly Option<int> SemanticChangeBackOffTimeSpanInMS = new Option<int>(OptionName, "Semantic change backoff timespan in ms", defaultValue: 100,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Semantic change backoff timespan in ms"));
public static readonly Option<int> ProjectPropagationBackOffTimeSpanInMS = new Option<int>(OptionName, "Project propagation backoff timespan in ms", defaultValue: 500,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Project propagation backoff timespan in ms"));
public static readonly Option<int> PreviewBackOffTimeSpanInMS = new Option<int>(OptionName, "Preview backoff timespan in ms", defaultValue: 500,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Preview backoff timespan in ms"));
}
}
......@@ -7,11 +7,14 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation
internal static class LoggerOptions
{
public const string FeatureName = "Performance/Loggers";
private const string LocalRegistryPath = @"Roslyn\Internal\Performance\Logger\";
[ExportOption]
public static readonly Option<bool> EtwLoggerKey = new Option<bool>(FeatureName, "EtwLogger", defaultValue: true);
public static readonly Option<bool> EtwLoggerKey = new Option<bool>(FeatureName, "EtwLogger", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "EtwLogger"));
[ExportOption]
public static readonly Option<bool> TraceLoggerKey = new Option<bool>(FeatureName, "TraceLogger");
public static readonly Option<bool> TraceLoggerKey = new Option<bool>(FeatureName, "TraceLogger", defaultValue: false,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "TraceLoggerKey"));
}
}
......@@ -8,6 +8,7 @@ internal static class VisualStudioNavigationOptions
{
public const string FeatureName = "VisualStudioNavigation";
public static readonly PerLanguageOption<bool> NavigateToObjectBrowser = new PerLanguageOption<bool>(FeatureName, "NavigateToObjectBrowser", defaultValue: false);
public static readonly PerLanguageOption<bool> NavigateToObjectBrowser = new PerLanguageOption<bool>(FeatureName, "NavigateToObjectBrowser", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.NavigateToObjectBrowser"));
}
}
......@@ -24,7 +24,7 @@ public ForceLowMemoryMode(IOptionService optionService)
private void Options_OptionChanged(object sender, OptionChangedEventArgs e)
{
if (e.Option.Feature == ForceLowMemoryMode.OptionName)
if (e.Option.Feature == nameof(ForceLowMemoryMode))
{
RefreshFromSettings();
}
......
......@@ -10,22 +10,10 @@ namespace Roslyn.VisualStudio.DiagnosticsWindow.OptionsPages
{
internal sealed partial class ForceLowMemoryMode
{
public const string OptionName = nameof(ForceLowMemoryMode);
public static readonly Option<bool> Enabled = new Option<bool>(OptionName, nameof(Enabled), defaultValue: false);
public static readonly Option<int> SizeInMegabytes = new Option<int>(OptionName, nameof(SizeInMegabytes), defaultValue: 500);
}
[ExportOptionSerializer(ForceLowMemoryMode.OptionName), Shared]
internal sealed class ForceLowMemoryModeSerializer : AbstractLocalUserRegistryOptionSerializer
{
[ImportingConstructor]
public ForceLowMemoryModeSerializer(SVsServiceProvider serviceProvider) : base(serviceProvider)
{
}
public static readonly Option<bool> Enabled = new Option<bool>(nameof(ForceLowMemoryMode), nameof(Enabled), defaultValue: false,
persistences: new LocalUserProfilePersistence(@"Roslyn\ForceLowMemoryMode\Enabled"));
protected override string GetCollectionPathForOption(OptionKey key)
{
return @"Roslyn\ForceLowMemoryMode";
}
public static readonly Option<int> SizeInMegabytes = new Option<int>(nameof(ForceLowMemoryMode), nameof(SizeInMegabytes), defaultValue: 500,
persistences: new LocalUserProfilePersistence(@"Roslyn\ForceLowMemoryMode\SizeInMegabytes"));
}
}
......@@ -10,10 +10,16 @@ internal static class CSharpCodeStyleOptions
internal const string FeatureName = "CSharpCodeStyle";
// TODO: get sign off on public api changes.
public static readonly Option<bool> UseVarWhenDeclaringLocals = new Option<bool>(FeatureName, "UseVarWhenDeclaringLocals", defaultValue: true);
public static readonly Option<bool> UseVarWhenDeclaringLocals = new Option<bool>(FeatureName, "UseVarWhenDeclaringLocals", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.CSharp.Specific.UseVarWhenDeclaringLocals"));
public static readonly Option<CodeStyleOption<bool>> UseImplicitTypeForIntrinsicTypes = new Option<CodeStyleOption<bool>>(FeatureName, nameof(UseImplicitTypeForIntrinsicTypes), defaultValue: CodeStyleOption<bool>.Default);
public static readonly Option<CodeStyleOption<bool>> UseImplicitTypeWhereApparent = new Option<CodeStyleOption<bool>>(FeatureName, nameof(UseImplicitTypeWhereApparent), defaultValue: CodeStyleOption<bool>.Default);
public static readonly Option<CodeStyleOption<bool>> UseImplicitTypeWherePossible = new Option<CodeStyleOption<bool>>(FeatureName, nameof(UseImplicitTypeWherePossible), defaultValue: CodeStyleOption<bool>.Default);
public static readonly Option<CodeStyleOption<bool>> UseImplicitTypeForIntrinsicTypes = new Option<CodeStyleOption<bool>>(FeatureName, nameof(UseImplicitTypeForIntrinsicTypes), defaultValue: CodeStyleOption<bool>.Default,
persistences: new RoamingProfilePersistence("TextEditor.CSharp.Specific.UseImplicitTypeForIntrinsicTypes"));
public static readonly Option<CodeStyleOption<bool>> UseImplicitTypeWhereApparent = new Option<CodeStyleOption<bool>>(FeatureName, nameof(UseImplicitTypeWhereApparent), defaultValue: CodeStyleOption<bool>.Default,
persistences: new RoamingProfilePersistence("TextEditor.CSharp.Specific.UseImplicitTypeWhereApparent"));
public static readonly Option<CodeStyleOption<bool>> UseImplicitTypeWherePossible = new Option<CodeStyleOption<bool>>(FeatureName, nameof(UseImplicitTypeWherePossible), defaultValue: CodeStyleOption<bool>.Default,
persistences: new RoamingProfilePersistence("TextEditor.CSharp.Specific.UseImplicitTypeWherePossible"));
}
}
......@@ -18,31 +18,37 @@ public class CodeStyleOptions
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in field access expressions.
/// </summary>
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyFieldAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyFieldAccess), defaultValue: CodeStyleOption<bool>.Default);
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyFieldAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyFieldAccess), defaultValue: CodeStyleOption<bool>.Default,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyFieldAccess"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in property access expressions.
/// </summary>
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyPropertyAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyPropertyAccess), defaultValue: CodeStyleOption<bool>.Default);
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyPropertyAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyPropertyAccess), defaultValue: CodeStyleOption<bool>.Default,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyPropertyAccess"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in method access expressions.
/// </summary>
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyMethodAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyMethodAccess), defaultValue: CodeStyleOption<bool>.Default);
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyMethodAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyMethodAccess), defaultValue: CodeStyleOption<bool>.Default,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyMethodAccess"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in event access expressions.
/// </summary>
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyEventAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyEventAccess), defaultValue: CodeStyleOption<bool>.Default);
public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyEventAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(QualifyEventAccess), defaultValue: CodeStyleOption<bool>.Default,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyEventAccess"));
/// <summary>
/// This option says if we should prefer keyword for Intrinsic Predefined Types in Declarations
/// </summary>
public static readonly PerLanguageOption<CodeStyleOption<bool>> PreferIntrinsicPredefinedTypeKeywordInDeclaration = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(PreferIntrinsicPredefinedTypeKeywordInDeclaration), defaultValue: trueWithNoneEnforcement);
public static readonly PerLanguageOption<CodeStyleOption<bool>> PreferIntrinsicPredefinedTypeKeywordInDeclaration = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(PreferIntrinsicPredefinedTypeKeywordInDeclaration), defaultValue: trueWithNoneEnforcement,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PreferIntrinsicPredefinedTypeKeywordInDeclaration"));
/// <summary>
/// This option says if we should prefer keyword for Intrinsic Predefined Types in Member Access Expression
/// </summary>
public static readonly PerLanguageOption<CodeStyleOption<bool>> PreferIntrinsicPredefinedTypeKeywordInMemberAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(PreferIntrinsicPredefinedTypeKeywordInMemberAccess), defaultValue: trueWithNoneEnforcement);
public static readonly PerLanguageOption<CodeStyleOption<bool>> PreferIntrinsicPredefinedTypeKeywordInMemberAccess = new PerLanguageOption<CodeStyleOption<bool>>(PerLanguageCodeStyleOption, nameof(PreferIntrinsicPredefinedTypeKeywordInMemberAccess), defaultValue: trueWithNoneEnforcement,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PreferIntrinsicPredefinedTypeKeywordInMemberAccess"));
}
}
......@@ -7,17 +7,39 @@ namespace Microsoft.CodeAnalysis.Diagnostics
internal static class InternalDiagnosticsOptions
{
public const string OptionName = "InternalDiagnosticsOptions";
private const string LocalRegistryPath = @"Roslyn\Internal\Diagnostics\";
public static readonly Option<bool> BlueSquiggleForBuildDiagnostic = new Option<bool>(OptionName, "Blue Squiggle For Build Diagnostic", defaultValue: false);
public static readonly Option<bool> UseDiagnosticEngineV2 = new Option<bool>(OptionName, "Use Diagnostic Engine V2", defaultValue: true);
public static readonly Option<bool> CompilationEndCodeFix = new Option<bool>(OptionName, "Enable Compilation End Code Fix", defaultValue: true);
public static readonly Option<bool> UseCompilationEndCodeFixHeuristic = new Option<bool>(OptionName, "Enable Compilation End Code Fix With Heuristic", defaultValue: true);
public static readonly Option<bool> BuildErrorIsTheGod = new Option<bool>(OptionName, "Make build errors to take over everything", defaultValue: false);
public static readonly Option<bool> ClearLiveErrorsForProjectBuilt = new Option<bool>(OptionName, "Clear all live errors of projects that got built", defaultValue: false);
public static readonly Option<bool> PreferLiveErrorsOnOpenedFiles = new Option<bool>(OptionName, "Live errors will be preferred over errors from build on opened files from same analyzer", defaultValue: true);
public static readonly Option<bool> PreferBuildErrorsOverLiveErrors = new Option<bool>(OptionName, "Errors from build will be preferred over live errors from same analyzer", defaultValue: true);
public static readonly Option<bool> PutCustomTypeInBingSearch = new Option<bool>(OptionName, "PutCustomTypeInBingSearch", defaultValue: true);
public static readonly Option<bool> CrashOnAnalyzerException = new Option<bool>(OptionName, "CrashOnAnalyzerException", defaultValue: false);
public static readonly Option<bool> ProcessHiddenDiagnostics = new Option<bool>(OptionName, "Process Hidden Diagnostics", defaultValue: false);
public static readonly Option<bool> BlueSquiggleForBuildDiagnostic = new Option<bool>(OptionName, "Blue Squiggle For Build Diagnostic", defaultValue: false,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Blue Squiggle For Build Diagnostic"));
public static readonly Option<bool> UseDiagnosticEngineV2 = new Option<bool>(OptionName, "Use Diagnostic Engine V2", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Use Diagnostic Engine V2"));
public static readonly Option<bool> CompilationEndCodeFix = new Option<bool>(OptionName, "Enable Compilation End Code Fix", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Enable Compilation End Code Fix"));
public static readonly Option<bool> UseCompilationEndCodeFixHeuristic = new Option<bool>(OptionName, "Enable Compilation End Code Fix With Heuristic", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Enable Compilation End Code Fix With Heuristic"));
public static readonly Option<bool> BuildErrorIsTheGod = new Option<bool>(OptionName, "Make build errors to take over everything", defaultValue: false,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Make build errors to take over everything"));
public static readonly Option<bool> ClearLiveErrorsForProjectBuilt = new Option<bool>(OptionName, "Clear all live errors of projects that got built", defaultValue: false,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Clear all live errors of projects that got built"));
public static readonly Option<bool> PreferLiveErrorsOnOpenedFiles = new Option<bool>(OptionName, "Live errors will be preferred over errors from build on opened files from same analyzer", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Live errors will be preferred over errors from build on opened files from same analyzer"));
public static readonly Option<bool> PreferBuildErrorsOverLiveErrors = new Option<bool>(OptionName, "Errors from build will be preferred over live errors from same analyzer", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Errors from build will be preferred over live errors from same analyzer"));
public static readonly Option<bool> PutCustomTypeInBingSearch = new Option<bool>(OptionName, "PutCustomTypeInBingSearch", defaultValue: true,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "PutCustomTypeInBingSearch"));
public static readonly Option<bool> CrashOnAnalyzerException = new Option<bool>(OptionName, "CrashOnAnalyzerException", defaultValue: false,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "CrashOnAnalyzerException"));
public static readonly Option<bool> ProcessHiddenDiagnostics = new Option<bool>(OptionName, "Process Hidden Diagnostics", defaultValue: false,
persistences: new LocalUserProfilePersistence(LocalRegistryPath + "Process Hidden Diagnostics"));
}
}
......@@ -8,6 +8,7 @@ internal class GenerationOptions
{
public const string FeatureName = "Organizer";
public static readonly PerLanguageOption<bool> PlaceSystemNamespaceFirst = new PerLanguageOption<bool>(FeatureName, "PlaceSystemNamespaceFirst", defaultValue: true);
public static readonly PerLanguageOption<bool> PlaceSystemNamespaceFirst = new PerLanguageOption<bool>(FeatureName, "PlaceSystemNamespaceFirst", defaultValue: true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PlaceSystemNamespaceFirst"));
}
}
......@@ -9,13 +9,17 @@ public static class FormattingOptions
internal const string TabFeatureName = "Tab";
internal const string InternalTabFeatureName = "InternalTab";
internal const string FormattingFeatureName = "Formatting";
//
// This is also serialized by the Visual Studio-specific LanguageSettingsSerializer
public static PerLanguageOption<bool> UseTabs { get; } = new PerLanguageOption<bool>(TabFeatureName, "UseTab", defaultValue: false);
// This is also serialized by the Visual Studio-specific LanguageSettingsSerializer
public static PerLanguageOption<int> TabSize { get; } = new PerLanguageOption<int>(TabFeatureName, "TabSize", defaultValue: 4);
// This is also serialized by the Visual Studio-specific LanguageSettingsSerializer
public static PerLanguageOption<int> IndentationSize { get; } = new PerLanguageOption<int>(TabFeatureName, "IndentationSize", defaultValue: 4);
// This is also serialized by the Visual Studio-specific LanguageSettingsSerializer
public static PerLanguageOption<IndentStyle> SmartIndent { get; } = new PerLanguageOption<IndentStyle>(TabFeatureName, "SmartIndent", defaultValue: IndentStyle.Smart);
public static PerLanguageOption<string> NewLine { get; } = new PerLanguageOption<string>(FormattingFeatureName, "NewLine", defaultValue: "\r\n");
......
......@@ -13,24 +13,19 @@ internal static class FunctionIdOptions
private static readonly ConcurrentDictionary<FunctionId, Option<bool>> s_options =
new ConcurrentDictionary<FunctionId, Option<bool>>();
private static readonly Func<FunctionId, Option<bool>> s_optionGetter =
id => new Option<bool>(FeatureName, Enum.GetName(typeof(FunctionId), id), defaultValue: GetDefaultValue(id));
private static readonly Func<FunctionId, Option<bool>> s_optionCreator = CreateOption;
public static Option<bool> GetOption(FunctionId id)
private static Option<bool> CreateOption(FunctionId id)
{
return s_options.GetOrAdd(id, s_optionGetter);
var name = Enum.GetName(typeof(FunctionId), id);
return new Option<bool>(nameof(FunctionIdOptions), name, defaultValue: false,
persistences: new LocalUserProfilePersistence(@"Roslyn\Internal\Performance\FunctionId\" + name));
}
private static bool GetDefaultValue(FunctionId id)
public static Option<bool> GetOption(FunctionId id)
{
switch (id)
{
// change not to enable any etw events by default.
// we used to couple this to other logger such as code marker but now it is only specific to etw.
// each events should be enabled specifically when needed.
default:
return false;
}
return s_options.GetOrAdd(id, s_optionCreator);
}
}
}
......@@ -6,7 +6,7 @@
namespace Microsoft.CodeAnalysis.Simplification
{
/// <summary>
/// This Object contains the options that needs to be drilled down to the Simplification Engine
/// Contains the options that needs to be drilled down to the Simplification Engine
/// </summary>
public static class SimplificationOptions
{
......@@ -17,63 +17,74 @@ public static class SimplificationOptions
/// This option tells the simplification engine if the Qualified Name should be replaced by Alias
/// if the user had initially not used the Alias
/// </summary>
public static Option<bool> PreferAliasToQualification { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferAliasToQualification", true);
public static Option<bool> PreferAliasToQualification { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferAliasToQualification", true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PreferAliasToQualification"));
/// <summary>
/// This option influences the name reduction of members of a module in VB. If set to true, the
/// name reducer will e.g. reduce Namespace.Module.Member to Namespace.Member.
/// </summary>
public static Option<bool> PreferOmittingModuleNamesInQualification { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferOmittingModuleNamesInQualification", true);
public static Option<bool> PreferOmittingModuleNamesInQualification { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferOmittingModuleNamesInQualification", true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PreferOmittingModuleNamesInQualification"));
/// <summary>
/// This option says that if we should simplify the Generic Name which has the type argument inferred
/// </summary>
public static Option<bool> PreferImplicitTypeInference { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferImplicitTypeInference", true);
public static Option<bool> PreferImplicitTypeInference { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferImplicitTypeInference", true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PreferImplicitTypeInference"));
/// <summary>
/// This option says if we should simplify the Explicit Type in Local Declarations
/// </summary>
public static Option<bool> PreferImplicitTypeInLocalDeclaration { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferImplicitTypeInLocalDeclaration", false);
public static Option<bool> PreferImplicitTypeInLocalDeclaration { get; } = new Option<bool>(NonPerLanguageFeatureName, "PreferImplicitTypeInLocalDeclaration", false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.PreferImplicitTypeInLocalDeclaration"));
/// <summary>
/// This option says if we should simplify to NonGeneric Name rather than GenericName
/// </summary>
public static Option<bool> AllowSimplificationToGenericType { get; } = new Option<bool>(NonPerLanguageFeatureName, "AllowSimplificationToGenericType", false);
public static Option<bool> AllowSimplificationToGenericType { get; } = new Option<bool>(NonPerLanguageFeatureName, "AllowSimplificationToGenericType", false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.AllowSimplificationToGenericType"));
/// <summary>
/// This option says if we should simplify from Derived types to Base types in Static Member Accesses
/// </summary>
public static Option<bool> AllowSimplificationToBaseType { get; } = new Option<bool>(NonPerLanguageFeatureName, "AllowSimplificationToBaseType", true);
public static Option<bool> AllowSimplificationToBaseType { get; } = new Option<bool>(NonPerLanguageFeatureName, "AllowSimplificationToBaseType", true,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.AllowSimplificationToBaseType"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/> or <see langword="Me"/> in member access expressions.
/// </summary>
[Obsolete]
public static PerLanguageOption<bool> QualifyMemberAccessWithThisOrMe { get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyMemberAccessWithThisOrMe", defaultValue: false);
public static PerLanguageOption<bool> QualifyMemberAccessWithThisOrMe { get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyMemberAccessWithThisOrMe", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyMemberAccessWithThisOrMe"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in field access expressions.
/// </summary>
[Obsolete]
public static PerLanguageOption<bool> QualifyFieldAccess { get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyFieldAccess", defaultValue: false);
public static PerLanguageOption<bool> QualifyFieldAccess { get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyFieldAccess", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyFieldAccess"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in property access expressions.
/// </summary>
[Obsolete]
public static PerLanguageOption<bool> QualifyPropertyAccess{ get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyPropertyAccess", defaultValue: false);
public static PerLanguageOption<bool> QualifyPropertyAccess{ get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyPropertyAccess", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyPropertyAccess"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in method access expressions.
/// </summary>
[Obsolete]
public static PerLanguageOption<bool> QualifyMethodAccess{ get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyMethodAccess", defaultValue: false);
public static PerLanguageOption<bool> QualifyMethodAccess{ get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyMethodAccess", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyMethodAccess"));
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in event access expressions.
/// </summary>
[Obsolete]
public static PerLanguageOption<bool> QualifyEventAccess{ get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyEventAccess", defaultValue: false);
public static PerLanguageOption<bool> QualifyEventAccess{ get; } = new PerLanguageOption<bool>(PerLanguageFeatureName, "QualifyEventAccess", defaultValue: false,
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.QualifyEventAccess"));
/// <summary>
/// This option says if we should prefer keyword for Intrinsic Predefined Types in Declarations
......@@ -91,6 +102,7 @@ public static class SimplificationOptions
/// This option describes the naming rules that should be applied to specified categories of symbols,
/// and the level to which those rules should be enforced.
/// </summary>
public static PerLanguageOption<string> NamingPreferences { get; } = new PerLanguageOption<string>(PerLanguageFeatureName, "NamingPreferences", defaultValue: "");
public static PerLanguageOption<string> NamingPreferences { get; } = new PerLanguageOption<string>(PerLanguageFeatureName, "NamingPreferences", defaultValue: "",
persistences: new RoamingProfilePersistence("TextEditor.%LANGUAGE%.Specific.NamingPreferences"));
}
}
......@@ -8,6 +8,7 @@ internal static class CacheOptions
{
internal const string FeatureName = "Cache Options";
internal static readonly Option<int> RecoverableTreeLengthThreshold = new Option<int>(FeatureName, "RecoverableTreeLengthThreshold", defaultValue: 4096);
internal static readonly Option<int> RecoverableTreeLengthThreshold = new Option<int>(FeatureName, "RecoverableTreeLengthThreshold", defaultValue: 4096,
persistences: new LocalUserProfilePersistence(@"Roslyn\Internal\Performance\Cache\RecoverableTreeLengthThreshold"));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册