コード例 #1
0
 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();
コード例 #2
0
        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);
        }
コード例 #3
0
 static void TestParseParenthesesSpaceOptionsFalse(string value, SpacingWithinParenthesesOption parenthesesSpacingOption)
 {
     Assert.False(DetermineIfSpaceOptionIsSet(value, parenthesesSpacingOption),
                  $"Expected option {value} to be parsed as un-set.");
 }
コード例 #4
0
 static void TestParseParenthesesSpaceOptionsFalse(string value, SpacingWithinParenthesesOption parenthesesSpacingOption)
 {
     Assert.False(DetermineIfSpaceOptionIsSet(value, parenthesesSpacingOption),
                 $"Expected option {value} to be parsed as un-set.");
 }