コード例 #1
0
        private void AddNextIndentBlockOperations(List <IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction <IndentBlockOperation> nextOperation)
        {
            if (_vbHelperFormattingRule == null)
            {
                base.AddIndentBlockOperations(list, node, optionSet, nextOperation);
                return;
            }

            _vbHelperFormattingRule.AddIndentBlockOperations(list, node, optionSet, nextOperation);
        }
コード例 #2
0
        public override void AddIndentBlockOperations(List <IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction <IndentBlockOperation> nextOperation)
        {
            // for the common node itself, return absolute indentation
            if (_commonNode == node)
            {
                // TODO: If the first line of the span includes a node, we want to align with the position of that node
                // in the primary buffer.  That's what Dev12 does for C#, but it doesn't match Roslyn's current model
                // of each statement being formatted independently with respect to it's parent.
                list.Add(new IndentBlockOperation(_token1, _token2, _span, _baseIndentation, IndentBlockOption.AbsolutePosition));
            }
            else if (node.Span.Contains(_span))
            {
                // any node bigger than our span is ignored.
                return;
            }

            // Add everything to the list.
            AddNextIndentBlockOperations(list, node, optionSet, nextOperation);

            // Filter out everything that encompasses our span.
            AdjustIndentBlockOperation(list);
        }