Exemple #1
0
        private void AddEnabledRulesOrInverses(OptionalRuleMap optionalRuleMap)
        {
            if (optionalRuleMap == null)
            {
                optionalRuleMap = new OptionalRuleMap(Enumerable.Empty<DisableableRules>());
            }

            this.Map = new Dictionary<SyntaxKind, Dictionary<SyntaxKind, RuleBucket>>();
            foreach (Rule rule in Rules.AllRules)
            {
                if (optionalRuleMap.DisabledRules.Contains(rule))
                {
                    if (rule as SimpleRule != null &&
                        (rule.RuleOperationContext.Action == RuleAction.Space ||
                        rule.RuleOperationContext.Action == RuleAction.Delete))
                    {
                        this.Add(rule.Inverse);
                    }
                }
                else
                {
                    this.Add(rule);
                }
            }
        }
Exemple #2
0
        internal static RuleMap Create(OptionalRuleMap optionalRuleMap)
        {
            RuleMap ruleMap = new RuleMap();
            ruleMap.AddEnabledRulesOrInverses(optionalRuleMap);

            return ruleMap;
        }
Exemple #3
0
 internal GlobalOptions()
 {
     IndentSize = 4;
     OptionalRuleMap = new OptionalRuleMap(ImmutableArray.Create<OptionalRuleGroup>());
 }
Exemple #4
0
 internal GlobalOptions()
 {
     IndentSize      = 4;
     OptionalRuleMap = new OptionalRuleMap(ImmutableArray.Create <OptionalRuleGroup>());
 }