Example #1
0
        public override string VisitExtrasDefinition(IExtrasDefinition extrasDefinitionParam, FormattingStageContext context)
        {
            string parentIndent = GetParentIndent(context.Parent);

            if (context.RightChild is IExtraDefinition)
            {
                return(parentIndent + StandartIndent);
            }
            return(myIndentCache.GetNodeIndent(extrasDefinitionParam));
        }
        private ISymbolTable CreateRoleSymbolTable()
        {
            IList <IDeclaredElement> roleDeclaredElements = new List <IDeclaredElement>();
            IList <string>           roles = new List <string>();
            ITreeNode child = FirstChild;

            while (child != null)
            {
                var ruleDeclaration = child as IRuleDeclaration;
                if (ruleDeclaration != null)
                {
                    IExtrasDefinition extras = (ruleDeclaration).Extras;
                    if (extras != null)
                    {
                        ITreeNode extrasChild = extras.FirstChild;
                        while (extrasChild != null)
                        {
                            extrasChild = extrasChild.NextSibling;
                            var extraDefinition = extrasChild as IExtraDefinition;
                            if (extraDefinition != null)
                            {
                                IPathValue pathValue = (extraDefinition).PathValue;
                                if (pathValue != null)
                                {
                                    ITreeNode pathElement = pathValue.FirstChild;
                                    while (pathElement != null)
                                    {
                                        var element = pathElement as IPathElement;
                                        if (element != null)
                                        {
                                            IRoleName roleName = (element).RoleName;
                                            if ((roleName != null) && (!roles.Contains(roleName.GetText())))
                                            {
                                                roles.Add(roleName.GetText());
                                            }
                                        }
                                        pathElement = pathElement.NextSibling;
                                    }
                                }
                            }
                        }
                    }
                }
                child = child.NextSibling;
            }
            foreach (string role in roles)
            {
                IDeclaredElement element = new RoleDeclaredElement(this, role, GetPsiServices());
                roleDeclaredElements.Add(element);
            }
            myRoleSymbolTable = ResolveUtil.CreateSymbolTable(roleDeclaredElements, 0);
            return(myRoleSymbolTable);
        }
 public override IEnumerable <string> VisitExtrasDefinition(IExtrasDefinition extrasDefinitionParam, PsiFmtStageContext context)
 {
     return(new[] { "\r\n" });
 }