internal static bool DetermineIfSpaceOptionIsSet( string value, SpacingWithinParenthesesOption parenthesesSpacingOption ) => ( from v in value.Split(',').Select(v => v.Trim()) let option = ConvertToSpacingOption(v) where option.HasValue && option.Value == parenthesesSpacingOption select option ).Any();
private static Option <bool> CreateSpaceWithinParenthesesOption(SpacingWithinParenthesesOption parenthesesOption, string name) { var option = CreateOption( CSharpFormattingOptionGroups.Spacing, name, defaultValue: false, storageLocations: new OptionStorageLocation[] { new EditorConfigStorageLocation <bool>( "csharp_space_between_parentheses", s => DetermineIfSpaceOptionIsSet(s, parenthesesOption), GetSpacingWithParenthesesEditorConfigString), new RoamingProfileStorageLocation($"TextEditor.CSharp.Specific.{name}") }); Debug.Assert(s_spacingWithinParenthesisOptionsEditorConfigMap.ContainsValue(parenthesesOption)); s_spacingWithinParenthesisOptionsMapBuilder.Add(option, parenthesesOption); return(option); }
static void TestParseParenthesesSpaceOptionsFalse(string value, SpacingWithinParenthesesOption parenthesesSpacingOption) { Assert.False(DetermineIfSpaceOptionIsSet(value, parenthesesSpacingOption), $"Expected option {value} to be parsed as un-set."); }
static void TestParseParenthesesSpaceOptionsFalse(string value, SpacingWithinParenthesesOption parenthesesSpacingOption) { Assert.False(DetermineIfSpaceOptionIsSet(value, parenthesesSpacingOption), $"Expected option {value} to be parsed as un-set."); }