public override int GetDesiredIndentation(int offset, ABnfElement select)
        {
            ABnfElement parent = m_element.GetParent();

            if (parent is AProtobufMessageElement || parent is AProtobufOneofElement)
            {
                if (select is ABnfStringElement && select.GetElementText() == "}")
                {
                    return(parent.GetReference().GetDesiredIndentation(offset, null));
                }

                return(parent.GetReference().GetDesiredIndentation(offset, null) + ALanguageSmartIndentProvider.s_indent_size);
            }
            return(0);
        }
Beispiel #2
0
        public override int GetFormateIndentation(int offset, ABnfElement select)
        {
            ABnfElement parent = m_element.GetParent();

            if (parent is AProtobufServiceElement)
            {
                if (select is ABnfStringElement && (select.GetElementText() == "{" || select.GetElementText() == "}"))
                {
                    return(parent.GetReference().GetFormateIndentation(offset, null));
                }

                return(parent.GetReference().GetFormateIndentation(offset, null) + ALanguageSmartIndentProvider.s_indent_size);
            }
            return(0);
        }
Beispiel #3
0
        public override int GetDesiredIndentation(int offset, ABnfElement select)
        {
            ABnfElement parent = m_element.GetParent();

            if (parent is AProtobufServiceElement)
            {
                var childs = m_element.GetChilds();
                if (select is ABnfStringElement && (select.GetElementText() == "{" || (select.GetElementText() == "}" && childs.Count > 0 && childs[0].GetStartLine() != select.GetStartLine())))
                {
                    return(parent.GetReference().GetDesiredIndentation(offset, null));
                }

                return(parent.GetReference().GetDesiredIndentation(offset, null) + ALanguageSmartIndentProvider.s_indent_size);
            }
            return(0);
        }
 public override int GetDesiredIndentation(int offset, ABnfElement select)
 {
     ABnfElement parent = m_element.GetParent();
     if (parent is AProtobufMessageBodyElement)
         return parent.GetReference().GetDesiredIndentation(offset, null);
     return 0;
 }
Beispiel #5
0
        public override int GetFormateIndentation(int offset, ABnfElement select)
        {
            ABnfElement parent = m_element.GetParent();

            if (parent is AProtobufMessageBodyElement)
            {
                return(parent.GetReference().GetFormateIndentation(offset, null));
            }
            return(0);
        }
        public override int GetDesiredIndentation(int offset, ABnfElement select)
        {
            ABnfElement parent = m_element.GetParent();

            if (parent is AProtobufServiceBodyElement)
            {
                return(parent.GetReference().GetDesiredIndentation(offset, null));
            }
            return(0);
        }