Esempio n. 1
0
        private string CalcIndent(FormattingStageContext context)
        {
            CompositeElement parent = context.Parent;

            if (context.LeftChild != context.RightChild)
            {
                ITreeNode rChild = context.RightChild;
                if ((!context.LeftChild.HasLineFeedsTo(rChild)))
                {
                    return(null);
                }

                var psiTreeNode = context.Parent as IPsiTreeNode;

                return(psiTreeNode != null
          ? psiTreeNode.Accept(_indentVisitor, context)
          : _indentVisitor.VisitNode(parent, context));
            }
            else
            {
                var psiTreeNode = context.Parent as IPsiTreeNode;

                return(psiTreeNode != null
          ? psiTreeNode.Accept(_indentVisitor, context)
          : _indentVisitor.VisitNode(parent, context));
            }
        }
Esempio n. 2
0
        private string CalcIndent(FormattingStageContext context)
        {
            CompositeElement parent = context.Parent;

            ITreeNode rChild = context.RightChild;

            if ((!context.LeftChild.HasLineFeedsTo(rChild)) && (!myInTypingAssist))
            {
                //if ((!context.LeftChild.HasLineFeedsTo(rChild)))
                return(null);
            }

            var psiTreeNode = context.Parent as IPsiTreeNode;

            return(psiTreeNode != null
        ? psiTreeNode.Accept(myIndentVisitor, context)
        : myIndentVisitor.VisitNode(parent, context));
        }