Lines Matching refs:Style

595   static void mapping(IO &IO, FormatStyle &Style) {  in mapping()
597 IO.mapOptional("Language", Style.Language); in mapping()
604 if (getPredefinedStyle(StyleName, Style.Language, &PredefinedStyle) && in mapping()
605 Style == PredefinedStyle) { in mapping()
614 FormatStyle::LanguageKind OldLanguage = Style.Language; in mapping()
617 if (!getPredefinedStyle(BasedOnStyle, Language, &Style)) { in mapping()
621 Style.Language = OldLanguage; in mapping()
627 IO.mapOptional("AlignEscapedNewlinesLeft", Style.AlignEscapedNewlines); in mapping()
628 IO.mapOptional("DerivePointerBinding", Style.DerivePointerAlignment); in mapping()
630 Style.IndentWrappedFunctionNames); in mapping()
631 IO.mapOptional("IndentRequires", Style.IndentRequiresClause); in mapping()
632 IO.mapOptional("PointerBindsToType", Style.PointerAlignment); in mapping()
634 Style.SpaceBeforeParens); in mapping()
637 IO.mapOptional("AccessModifierOffset", Style.AccessModifierOffset); in mapping()
638 IO.mapOptional("AlignAfterOpenBracket", Style.AlignAfterOpenBracket); in mapping()
639 IO.mapOptional("AlignArrayOfStructures", Style.AlignArrayOfStructures); in mapping()
641 Style.AlignConsecutiveAssignments); in mapping()
643 Style.AlignConsecutiveBitFields); in mapping()
645 Style.AlignConsecutiveDeclarations); in mapping()
646 IO.mapOptional("AlignConsecutiveMacros", Style.AlignConsecutiveMacros); in mapping()
647 IO.mapOptional("AlignEscapedNewlines", Style.AlignEscapedNewlines); in mapping()
648 IO.mapOptional("AlignOperands", Style.AlignOperands); in mapping()
649 IO.mapOptional("AlignTrailingComments", Style.AlignTrailingComments); in mapping()
651 Style.AllowAllArgumentsOnNextLine); in mapping()
653 Style.AllowAllParametersOfDeclarationOnNextLine); in mapping()
655 Style.AllowShortEnumsOnASingleLine); in mapping()
657 Style.AllowShortBlocksOnASingleLine); in mapping()
659 Style.AllowShortCaseLabelsOnASingleLine); in mapping()
661 Style.AllowShortFunctionsOnASingleLine); in mapping()
663 Style.AllowShortLambdasOnASingleLine); in mapping()
665 Style.AllowShortIfStatementsOnASingleLine); in mapping()
667 Style.AllowShortLoopsOnASingleLine); in mapping()
669 Style.AlwaysBreakAfterDefinitionReturnType); in mapping()
671 Style.AlwaysBreakAfterReturnType); in mapping()
676 if (Style.AlwaysBreakAfterDefinitionReturnType != FormatStyle::DRTBS_None && in mapping()
677 Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) { in mapping()
678 if (Style.AlwaysBreakAfterDefinitionReturnType == in mapping()
680 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in mapping()
681 } else if (Style.AlwaysBreakAfterDefinitionReturnType == in mapping()
683 Style.AlwaysBreakAfterReturnType = in mapping()
689 Style.AlwaysBreakBeforeMultilineStrings); in mapping()
691 Style.AlwaysBreakTemplateDeclarations); in mapping()
692 IO.mapOptional("AttributeMacros", Style.AttributeMacros); in mapping()
693 IO.mapOptional("BinPackArguments", Style.BinPackArguments); in mapping()
694 IO.mapOptional("BinPackParameters", Style.BinPackParameters); in mapping()
695 IO.mapOptional("BraceWrapping", Style.BraceWrapping); in mapping()
697 Style.BreakBeforeBinaryOperators); in mapping()
699 Style.BreakBeforeConceptDeclarations); in mapping()
700 IO.mapOptional("BreakBeforeBraces", Style.BreakBeforeBraces); in mapping()
704 IO.mapOptional("BreakInheritanceList", Style.BreakInheritanceList); in mapping()
709 Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) { in mapping()
710 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in mapping()
714 Style.BreakBeforeTernaryOperators); in mapping()
720 Style.BreakConstructorInitializers); in mapping()
725 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeColon) { in mapping()
726 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in mapping()
730 Style.BreakAfterJavaFieldAnnotations); in mapping()
731 IO.mapOptional("BreakStringLiterals", Style.BreakStringLiterals); in mapping()
732 IO.mapOptional("ColumnLimit", Style.ColumnLimit); in mapping()
733 IO.mapOptional("CommentPragmas", Style.CommentPragmas); in mapping()
734 IO.mapOptional("QualifierAlignment", Style.QualifierAlignment); in mapping()
737 if (Style.QualifierAlignment == FormatStyle::QAS_Right) in mapping()
738 Style.QualifierOrder = {"type", "const", "volatile"}; in mapping()
739 else if (Style.QualifierAlignment == FormatStyle::QAS_Left) in mapping()
740 Style.QualifierOrder = {"const", "volatile", "type"}; in mapping()
741 else if (Style.QualifierAlignment == FormatStyle::QAS_Custom) in mapping()
742 IO.mapOptional("QualifierOrder", Style.QualifierOrder); in mapping()
744 IO.mapOptional("CompactNamespaces", Style.CompactNamespaces); in mapping()
746 Style.ConstructorInitializerIndentWidth); in mapping()
747 IO.mapOptional("ContinuationIndentWidth", Style.ContinuationIndentWidth); in mapping()
748 IO.mapOptional("Cpp11BracedListStyle", Style.Cpp11BracedListStyle); in mapping()
749 IO.mapOptional("DeriveLineEnding", Style.DeriveLineEnding); in mapping()
750 IO.mapOptional("DerivePointerAlignment", Style.DerivePointerAlignment); in mapping()
751 IO.mapOptional("DisableFormat", Style.DisableFormat); in mapping()
753 Style.EmptyLineAfterAccessModifier); in mapping()
755 Style.EmptyLineBeforeAccessModifier); in mapping()
757 Style.ExperimentalAutoDetectBinPacking); in mapping()
760 Style.PackConstructorInitializers); in mapping()
779 if (Style.PackConstructorInitializers == FormatStyle::PCIS_BinPack && in mapping()
781 Style.PackConstructorInitializers = OnNextLine in mapping()
785 } else if (Style.PackConstructorInitializers == in mapping()
788 Style.PackConstructorInitializers = FormatStyle::PCIS_BinPack; in mapping()
790 Style.PackConstructorInitializers = FormatStyle::PCIS_CurrentLine; in mapping()
793 IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments); in mapping()
794 IO.mapOptional("ForEachMacros", Style.ForEachMacros); in mapping()
795 IO.mapOptional("IfMacros", Style.IfMacros); in mapping()
797 IO.mapOptional("IncludeBlocks", Style.IncludeStyle.IncludeBlocks); in mapping()
798 IO.mapOptional("IncludeCategories", Style.IncludeStyle.IncludeCategories); in mapping()
799 IO.mapOptional("IncludeIsMainRegex", Style.IncludeStyle.IncludeIsMainRegex); in mapping()
801 Style.IncludeStyle.IncludeIsMainSourceRegex); in mapping()
802 IO.mapOptional("IndentAccessModifiers", Style.IndentAccessModifiers); in mapping()
803 IO.mapOptional("IndentCaseLabels", Style.IndentCaseLabels); in mapping()
804 IO.mapOptional("IndentCaseBlocks", Style.IndentCaseBlocks); in mapping()
805 IO.mapOptional("IndentGotoLabels", Style.IndentGotoLabels); in mapping()
806 IO.mapOptional("IndentPPDirectives", Style.IndentPPDirectives); in mapping()
807 IO.mapOptional("IndentExternBlock", Style.IndentExternBlock); in mapping()
808 IO.mapOptional("IndentRequiresClause", Style.IndentRequiresClause); in mapping()
809 IO.mapOptional("IndentWidth", Style.IndentWidth); in mapping()
811 Style.IndentWrappedFunctionNames); in mapping()
812 IO.mapOptional("InsertBraces", Style.InsertBraces); in mapping()
813 IO.mapOptional("InsertTrailingCommas", Style.InsertTrailingCommas); in mapping()
814 IO.mapOptional("JavaImportGroups", Style.JavaImportGroups); in mapping()
815 IO.mapOptional("JavaScriptQuotes", Style.JavaScriptQuotes); in mapping()
816 IO.mapOptional("JavaScriptWrapImports", Style.JavaScriptWrapImports); in mapping()
818 Style.KeepEmptyLinesAtTheStartOfBlocks); in mapping()
819 IO.mapOptional("LambdaBodyIndentation", Style.LambdaBodyIndentation); in mapping()
820 IO.mapOptional("MacroBlockBegin", Style.MacroBlockBegin); in mapping()
821 IO.mapOptional("MacroBlockEnd", Style.MacroBlockEnd); in mapping()
822 IO.mapOptional("MaxEmptyLinesToKeep", Style.MaxEmptyLinesToKeep); in mapping()
823 IO.mapOptional("NamespaceIndentation", Style.NamespaceIndentation); in mapping()
824 IO.mapOptional("NamespaceMacros", Style.NamespaceMacros); in mapping()
825 IO.mapOptional("ObjCBinPackProtocolList", Style.ObjCBinPackProtocolList); in mapping()
826 IO.mapOptional("ObjCBlockIndentWidth", Style.ObjCBlockIndentWidth); in mapping()
828 Style.ObjCBreakBeforeNestedBlockParam); in mapping()
829 IO.mapOptional("ObjCSpaceAfterProperty", Style.ObjCSpaceAfterProperty); in mapping()
831 Style.ObjCSpaceBeforeProtocolList); in mapping()
832 IO.mapOptional("PenaltyBreakAssignment", Style.PenaltyBreakAssignment); in mapping()
834 Style.PenaltyBreakBeforeFirstCallParameter); in mapping()
835 IO.mapOptional("PenaltyBreakComment", Style.PenaltyBreakComment); in mapping()
837 Style.PenaltyBreakFirstLessLess); in mapping()
839 Style.PenaltyBreakOpenParenthesis); in mapping()
840 IO.mapOptional("PenaltyBreakString", Style.PenaltyBreakString); in mapping()
842 Style.PenaltyBreakTemplateDeclaration); in mapping()
843 IO.mapOptional("PenaltyExcessCharacter", Style.PenaltyExcessCharacter); in mapping()
845 Style.PenaltyReturnTypeOnItsOwnLine); in mapping()
847 Style.PenaltyIndentedWhitespace); in mapping()
848 IO.mapOptional("PointerAlignment", Style.PointerAlignment); in mapping()
849 IO.mapOptional("PPIndentWidth", Style.PPIndentWidth); in mapping()
850 IO.mapOptional("RawStringFormats", Style.RawStringFormats); in mapping()
851 IO.mapOptional("ReferenceAlignment", Style.ReferenceAlignment); in mapping()
852 IO.mapOptional("ReflowComments", Style.ReflowComments); in mapping()
853 IO.mapOptional("RemoveBracesLLVM", Style.RemoveBracesLLVM); in mapping()
854 IO.mapOptional("RequiresClausePosition", Style.RequiresClausePosition); in mapping()
855 IO.mapOptional("SeparateDefinitionBlocks", Style.SeparateDefinitionBlocks); in mapping()
856 IO.mapOptional("ShortNamespaceLines", Style.ShortNamespaceLines); in mapping()
857 IO.mapOptional("SortIncludes", Style.SortIncludes); in mapping()
858 IO.mapOptional("SortJavaStaticImport", Style.SortJavaStaticImport); in mapping()
859 IO.mapOptional("SortUsingDeclarations", Style.SortUsingDeclarations); in mapping()
860 IO.mapOptional("SpaceAfterCStyleCast", Style.SpaceAfterCStyleCast); in mapping()
861 IO.mapOptional("SpaceAfterLogicalNot", Style.SpaceAfterLogicalNot); in mapping()
863 Style.SpaceAfterTemplateKeyword); in mapping()
865 Style.SpaceBeforeAssignmentOperators); in mapping()
866 IO.mapOptional("SpaceBeforeCaseColon", Style.SpaceBeforeCaseColon); in mapping()
868 Style.SpaceBeforeCpp11BracedList); in mapping()
870 Style.SpaceBeforeCtorInitializerColon); in mapping()
872 Style.SpaceBeforeInheritanceColon); in mapping()
873 IO.mapOptional("SpaceBeforeParens", Style.SpaceBeforeParens); in mapping()
874 IO.mapOptional("SpaceBeforeParensOptions", Style.SpaceBeforeParensOptions); in mapping()
876 Style.SpaceAroundPointerQualifiers); in mapping()
878 Style.SpaceBeforeRangeBasedForLoopColon); in mapping()
879 IO.mapOptional("SpaceInEmptyBlock", Style.SpaceInEmptyBlock); in mapping()
880 IO.mapOptional("SpaceInEmptyParentheses", Style.SpaceInEmptyParentheses); in mapping()
882 Style.SpacesBeforeTrailingComments); in mapping()
883 IO.mapOptional("SpacesInAngles", Style.SpacesInAngles); in mapping()
885 Style.SpacesInConditionalStatement); in mapping()
887 Style.SpacesInContainerLiterals); in mapping()
889 Style.SpacesInCStyleCastParentheses); in mapping()
891 Style.SpacesInLineCommentPrefix); in mapping()
892 IO.mapOptional("SpacesInParentheses", Style.SpacesInParentheses); in mapping()
893 IO.mapOptional("SpacesInSquareBrackets", Style.SpacesInSquareBrackets); in mapping()
895 Style.SpaceBeforeSquareBrackets); in mapping()
896 IO.mapOptional("BitFieldColonSpacing", Style.BitFieldColonSpacing); in mapping()
897 IO.mapOptional("Standard", Style.Standard); in mapping()
899 Style.StatementAttributeLikeMacros); in mapping()
900 IO.mapOptional("StatementMacros", Style.StatementMacros); in mapping()
901 IO.mapOptional("TabWidth", Style.TabWidth); in mapping()
902 IO.mapOptional("TypenameMacros", Style.TypenameMacros); in mapping()
903 IO.mapOptional("UseCRLF", Style.UseCRLF); in mapping()
904 IO.mapOptional("UseTab", Style.UseTab); in mapping()
906 Style.WhitespaceSensitiveMacros); in mapping()
1585 FormatStyle Style = getLLVMStyle(); in getWebKitStyle() local
1586 Style.AccessModifierOffset = -4; in getWebKitStyle()
1587 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getWebKitStyle()
1588 Style.AlignOperands = FormatStyle::OAS_DontAlign; in getWebKitStyle()
1589 Style.AlignTrailingComments = false; in getWebKitStyle()
1590 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty; in getWebKitStyle()
1591 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getWebKitStyle()
1592 Style.BreakBeforeBraces = FormatStyle::BS_WebKit; in getWebKitStyle()
1593 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getWebKitStyle()
1594 Style.Cpp11BracedListStyle = false; in getWebKitStyle()
1595 Style.ColumnLimit = 0; in getWebKitStyle()
1596 Style.FixNamespaceComments = false; in getWebKitStyle()
1597 Style.IndentWidth = 4; in getWebKitStyle()
1598 Style.NamespaceIndentation = FormatStyle::NI_Inner; in getWebKitStyle()
1599 Style.ObjCBlockIndentWidth = 4; in getWebKitStyle()
1600 Style.ObjCSpaceAfterProperty = true; in getWebKitStyle()
1601 Style.PointerAlignment = FormatStyle::PAS_Left; in getWebKitStyle()
1602 Style.SpaceBeforeCpp11BracedList = true; in getWebKitStyle()
1603 Style.SpaceInEmptyBlock = true; in getWebKitStyle()
1604 return Style; in getWebKitStyle()
1608 FormatStyle Style = getLLVMStyle(); in getGNUStyle() local
1609 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All; in getGNUStyle()
1610 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in getGNUStyle()
1611 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getGNUStyle()
1612 Style.BreakBeforeBraces = FormatStyle::BS_GNU; in getGNUStyle()
1613 Style.BreakBeforeTernaryOperators = true; in getGNUStyle()
1614 Style.Cpp11BracedListStyle = false; in getGNUStyle()
1615 Style.ColumnLimit = 79; in getGNUStyle()
1616 Style.FixNamespaceComments = false; in getGNUStyle()
1617 Style.SpaceBeforeParens = FormatStyle::SBPO_Always; in getGNUStyle()
1618 Style.Standard = FormatStyle::LS_Cpp03; in getGNUStyle()
1619 return Style; in getGNUStyle()
1623 FormatStyle Style = getLLVMStyle(Language); in getMicrosoftStyle() local
1624 Style.ColumnLimit = 120; in getMicrosoftStyle()
1625 Style.TabWidth = 4; in getMicrosoftStyle()
1626 Style.IndentWidth = 4; in getMicrosoftStyle()
1627 Style.UseTab = FormatStyle::UT_Never; in getMicrosoftStyle()
1628 Style.BreakBeforeBraces = FormatStyle::BS_Custom; in getMicrosoftStyle()
1629 Style.BraceWrapping.AfterClass = true; in getMicrosoftStyle()
1630 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in getMicrosoftStyle()
1631 Style.BraceWrapping.AfterEnum = true; in getMicrosoftStyle()
1632 Style.BraceWrapping.AfterFunction = true; in getMicrosoftStyle()
1633 Style.BraceWrapping.AfterNamespace = true; in getMicrosoftStyle()
1634 Style.BraceWrapping.AfterObjCDeclaration = true; in getMicrosoftStyle()
1635 Style.BraceWrapping.AfterStruct = true; in getMicrosoftStyle()
1636 Style.BraceWrapping.AfterExternBlock = true; in getMicrosoftStyle()
1637 Style.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in getMicrosoftStyle()
1638 Style.BraceWrapping.BeforeCatch = true; in getMicrosoftStyle()
1639 Style.BraceWrapping.BeforeElse = true; in getMicrosoftStyle()
1640 Style.BraceWrapping.BeforeWhile = false; in getMicrosoftStyle()
1641 Style.PenaltyReturnTypeOnItsOwnLine = 1000; in getMicrosoftStyle()
1642 Style.AllowShortEnumsOnASingleLine = false; in getMicrosoftStyle()
1643 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None; in getMicrosoftStyle()
1644 Style.AllowShortCaseLabelsOnASingleLine = false; in getMicrosoftStyle()
1645 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getMicrosoftStyle()
1646 Style.AllowShortLoopsOnASingleLine = false; in getMicrosoftStyle()
1647 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getMicrosoftStyle()
1648 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; in getMicrosoftStyle()
1649 return Style; in getMicrosoftStyle()
1661 FormatStyle *Style) { in getPredefinedStyle() argument
1663 *Style = getLLVMStyle(Language); in getPredefinedStyle()
1665 *Style = getChromiumStyle(Language); in getPredefinedStyle()
1667 *Style = getMozillaStyle(); in getPredefinedStyle()
1669 *Style = getGoogleStyle(Language); in getPredefinedStyle()
1671 *Style = getWebKitStyle(); in getPredefinedStyle()
1673 *Style = getGNUStyle(); in getPredefinedStyle()
1675 *Style = getMicrosoftStyle(Language); in getPredefinedStyle()
1677 *Style = getNoStyle(); in getPredefinedStyle()
1679 Style->InheritsParentConfig = true; in getPredefinedStyle()
1683 Style->Language = Language; in getPredefinedStyle()
1687 ParseError validateQualifierOrder(FormatStyle *Style) { in validateQualifierOrder() argument
1689 if (Style->QualifierOrder.empty()) in validateQualifierOrder()
1693 for (const auto &Qualifier : Style->QualifierOrder) { in validateQualifierOrder()
1703 std::set<std::string> UniqueQualifiers(Style->QualifierOrder.begin(), in validateQualifierOrder()
1704 Style->QualifierOrder.end()); in validateQualifierOrder()
1705 if (Style->QualifierOrder.size() != UniqueQualifiers.size()) { in validateQualifierOrder()
1707 << "Duplicate Qualifiers " << Style->QualifierOrder.size() in validateQualifierOrder()
1713 auto type = std::find(Style->QualifierOrder.begin(), in validateQualifierOrder()
1714 Style->QualifierOrder.end(), "type"); in validateQualifierOrder()
1715 if (type == Style->QualifierOrder.end()) in validateQualifierOrder()
1722 FormatStyle *Style, bool AllowUnknownOptions, in parseConfiguration() argument
1725 assert(Style); in parseConfiguration()
1726 FormatStyle::LanguageKind Language = Style->Language; in parseConfiguration()
1730 Style->StyleSet.Clear(); in parseConfiguration()
1738 Input.setContext(Style); in parseConfiguration()
1763 for (const FormatStyle &Style : llvm::reverse(Styles)) { in parseConfiguration() local
1764 if (Style.Language != FormatStyle::LK_None) in parseConfiguration()
1765 StyleSet.Add(Style); in parseConfiguration()
1766 if (Style.Language == Language) in parseConfiguration()
1776 *Style = *StyleSet.Get(Language); in parseConfiguration()
1777 if (Style->InsertTrailingCommas != FormatStyle::TCS_None && in parseConfiguration()
1778 Style->BinPackArguments) { in parseConfiguration()
1782 if (Style->QualifierAlignment != FormatStyle::QAS_Leave) in parseConfiguration()
1783 return make_error_code(validateQualifierOrder(Style)); in parseConfiguration()
1787 std::string configurationAsText(const FormatStyle &Style) { in configurationAsText() argument
1793 FormatStyle NonConstStyle = Style; in configurationAsText()
1808 FormatStyle Style = It->second; in Get() local
1809 Style.StyleSet = *this; in Get()
1810 return Style; in Get()
1813 void FormatStyle::FormatStyleSet::Add(FormatStyle Style) { in Add() argument
1814 assert(Style.Language != LK_None && in Add()
1817 !Style.StyleSet.Styles && in Add()
1821 (*Styles)[Style.Language] = std::move(Style); in Add()
1835 BracesInserter(const Environment &Env, const FormatStyle &Style) in BracesInserter() argument
1836 : TokenAnalyzer(Env, Style) { in BracesInserter()
1837 this->Style.RemoveBracesLLVM = false; in BracesInserter()
1879 BracesRemover(const Environment &Env, const FormatStyle &Style) in BracesRemover() argument
1880 : TokenAnalyzer(Env, Style) { in BracesRemover()
1881 this->Style.InsertBraces = false; in BracesRemover()
1929 JavaScriptRequoter(const Environment &Env, const FormatStyle &Style) in JavaScriptRequoter() argument
1930 : TokenAnalyzer(Env, Style) {} in JavaScriptRequoter()
1957 (Style.JavaScriptQuotes == FormatStyle::JSQS_Single && in requoteJSStringLiteral()
1959 (Style.JavaScriptQuotes == FormatStyle::JSQS_Double && in requoteJSStringLiteral()
1965 bool IsSingle = Style.JavaScriptQuotes == FormatStyle::JSQS_Single; in requoteJSStringLiteral()
2017 Formatter(const Environment &Env, const FormatStyle &Style, in Formatter() argument
2019 : TokenAnalyzer(Env, Style), Status(Status) {} in Formatter()
2033 Env.getSourceManager(), Style, in analyze()
2034 Style.DeriveLineEnding in analyze()
2037 Style.UseCRLF) in analyze()
2038 : Style.UseCRLF); in analyze()
2039 ContinuationIndenter Indenter(Style, Tokens.getKeywords(), in analyze()
2043 UnwrappedLineFormatter(&Indenter, &Whitespaces, Style, in analyze()
2125 if (Style.DerivePointerAlignment) { in deriveLocalStyle()
2126 Style.PointerAlignment = countVariableAlignments(AnnotatedLines) <= 0 in deriveLocalStyle()
2129 Style.ReferenceAlignment = FormatStyle::RAS_Pointer; in deriveLocalStyle()
2131 if (Style.Standard == FormatStyle::LS_Auto) { in deriveLocalStyle()
2132 Style.Standard = hasCpp03IncompatibleFormat(AnnotatedLines) in deriveLocalStyle()
2157 TrailingCommaInserter(const Environment &Env, const FormatStyle &Style) in TrailingCommaInserter() argument
2158 : TokenAnalyzer(Env, Style) {} in TrailingCommaInserter()
2203 if (ColumnNumber > Style.ColumnLimit) in insertTrailingCommas()
2218 Cleaner(const Environment &Env, const FormatStyle &Style) in Cleaner() argument
2219 : TokenAnalyzer(Env, Style), in Cleaner()
2293 if (Style.BraceWrapping.AfterNamespace) { in checkEmptyNamespace()
2441 ObjCHeaderStyleGuesser(const Environment &Env, const FormatStyle &Style) in ObjCHeaderStyleGuesser() argument
2442 : TokenAnalyzer(Env, Style), IsObjC(false) {} in ObjCHeaderStyleGuesser()
2448 assert(Style.Language == FormatStyle::LK_Cpp); in analyze()
2663 static void sortCppIncludes(const FormatStyle &Style, in sortCppIncludes() argument
2668 tooling::IncludeCategoryManager Categories(Style.IncludeStyle, FileName); in sortCppIncludes()
2678 if (Style.SortIncludes == FormatStyle::SI_CaseInsensitive) { in sortCppIncludes()
2721 Style.IncludeStyle.IncludeBlocks == tooling::IncludeStyle::IBS_Preserve) { in sortCppIncludes()
2729 if (Style.IncludeStyle.IncludeBlocks == in sortCppIncludes()
2768 tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code, in sortCppIncludes() argument
2788 tooling::IncludeCategoryManager Categories(Style.IncludeStyle, FileName); in sortCppIncludes()
2828 (Style.IncludeStyle.IncludeBlocks == tooling::IncludeStyle::IBS_Merge || in sortCppIncludes()
2829 Style.IncludeStyle.IncludeBlocks == in sortCppIncludes()
2855 sortCppIncludes(Style, IncludesInBlock, Ranges, FileName, Code, in sortCppIncludes()
2872 sortCppIncludes(Style, IncludesInBlock, Ranges, FileName, Code, Replaces, in sortCppIncludes()
2880 static unsigned findJavaImportGroup(const FormatStyle &Style, in findJavaImportGroup() argument
2884 for (unsigned I = 0; I < Style.JavaImportGroups.size(); I++) { in findJavaImportGroup()
2885 const std::string &GroupPrefix = Style.JavaImportGroups[I]; in findJavaImportGroup()
2900 static void sortJavaImports(const FormatStyle &Style, in sortJavaImports() argument
2916 JavaImportGroups.push_back(findJavaImportGroup(Style, Import.Identifier)); in sortJavaImports()
2919 Style.SortJavaStaticImport == FormatStyle::SJSIO_After; in sortJavaImports()
2982 tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code, in sortJavaImports() argument
3030 sortJavaImports(Style, ImportsInBlock, Ranges, FileName, Code, Replaces); in sortJavaImports()
3043 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, in sortIncludes() argument
3047 if (!Style.SortIncludes || Style.DisableFormat) in sortIncludes()
3051 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && in sortIncludes()
3055 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript) in sortIncludes()
3056 return sortJavaScriptImports(Style, Code, Ranges, FileName); in sortIncludes()
3057 if (Style.Language == FormatStyle::LanguageKind::LK_Java) in sortIncludes()
3058 return sortJavaImports(Style, Code, Ranges, FileName, Replaces); in sortIncludes()
3059 sortCppIncludes(Style, Code, Ranges, FileName, Replaces, Cursor); in sortIncludes()
3067 const FormatStyle &Style) { in processReplacements() argument
3078 ProcessFunc(Style, *NewCode, ChangedRanges, FileName); in processReplacements()
3085 const FormatStyle &Style) { in formatReplacements() argument
3088 auto SortIncludes = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
3091 return sortIncludes(Style, Code, Ranges, FileName); in formatReplacements()
3094 processReplacements(SortIncludes, Code, Replaces, Style); in formatReplacements()
3100 auto Reformat = [](const FormatStyle &Style, StringRef Code, in formatReplacements() argument
3103 return reformat(Style, Code, Ranges, FileName); in formatReplacements()
3105 return processReplacements(Reformat, Code, *SortedReplaces, Style); in formatReplacements()
3123 const FormatStyle &Style) { in fixCppIncludeInsertions() argument
3124 if (!Style.isCpp()) in fixCppIncludeInsertions()
3149 tooling::HeaderIncludes Includes(FileName, Code, Style.IncludeStyle); in fixCppIncludeInsertions()
3195 const FormatStyle &Style) { in cleanupAroundReplacements() argument
3198 auto Cleanup = [](const FormatStyle &Style, StringRef Code, in cleanupAroundReplacements()
3201 return cleanup(Style, Code, Ranges, FileName); in cleanupAroundReplacements()
3205 fixCppIncludeInsertions(Code, Replaces, Style); in cleanupAroundReplacements()
3206 return processReplacements(Cleanup, Code, NewReplaces, Style); in cleanupAroundReplacements()
3211 reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
3215 FormatStyle Expanded = Style; in reformat()
3235 if (Style.isJson()) { in reformat()
3243 Formatter(*Env, Style, Status).process().first; in reformat()
3258 if (Style.isCpp()) { in reformat()
3259 if (Style.QualifierAlignment != FormatStyle::QAS_Leave) { in reformat()
3268 if (Style.InsertBraces) { in reformat()
3274 if (Style.RemoveBracesLLVM) { in reformat()
3280 if (Style.FixNamespaceComments) { in reformat()
3286 if (Style.SortUsingDeclarations) { in reformat()
3293 if (Style.SeparateDefinitionBlocks != FormatStyle::SDS_Leave) { in reformat()
3299 if (Style.isJavaScript() && in reformat()
3300 Style.JavaScriptQuotes != FormatStyle::JSQS_Leave) { in reformat()
3310 if (Style.isJavaScript() && in reformat()
3311 Style.InsertTrailingCommas == FormatStyle::TCS_Wrapped) { in reformat()
3347 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
3351 return internal::reformat(Style, Code, Ranges, in reformat()
3358 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code, in cleanup() argument
3362 if (Style.Language != FormatStyle::LK_Cpp) in cleanup()
3367 return Cleaner(*Env, Style).process().first; in cleanup()
3370 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
3374 auto Result = reformat(Style, Code, Ranges, FileName, &Status); in reformat()
3380 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style, in fixNamespaceEndComments() argument
3387 return NamespaceEndCommentsFixer(*Env, Style).process().first; in fixNamespaceEndComments()
3390 tooling::Replacements separateDefinitionBlocks(const FormatStyle &Style, in separateDefinitionBlocks() argument
3397 return DefinitionBlockSeparator(*Env, Style).process().first; in separateDefinitionBlocks()
3400 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, in sortUsingDeclarations() argument
3407 return UsingDeclarationsSorter(*Env, Style).process().first; in sortUsingDeclarations()
3410 LangOptions getFormattingLangOpts(const FormatStyle &Style) { in getFormattingLangOpts() argument
3413 FormatStyle::LanguageStandard LexingStd = Style.Standard; in getFormattingLangOpts()
3430 bool AlternativeOperators = Style.isCpp(); in getFormattingLangOpts()
3515 FormatStyle *Style, bool AllowUnknownOptions) { in loadAndParseConfigFile() argument
3520 if (auto EC = parseConfiguration(*Text.get(), Style, AllowUnknownOptions)) in loadAndParseConfigFile()
3531 FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code)); in getStyle() local
3534 if (!getPredefinedStyle(FallbackStyleName, Style.Language, &FallbackStyle)) in getStyle()
3544 parseConfiguration(llvm::MemoryBufferRef(StyleName, Source), &Style, in getStyle()
3548 if (Style.InheritsParentConfig) { in getStyle()
3552 return Style; in getStyle()
3557 if (!Style.InheritsParentConfig && in getStyle()
3561 loadAndParseConfigFile(ConfigFile, FS, &Style, AllowUnknownOptions); in getStyle()
3570 if (!Style.InheritsParentConfig) in getStyle()
3571 return Style; in getStyle()
3582 if (!Style.InheritsParentConfig && !StyleName.equals_insensitive("file")) { in getStyle()
3583 if (!getPredefinedStyle(StyleName, Style.Language, &Style)) in getStyle()
3585 if (!Style.InheritsParentConfig) in getStyle()
3586 return Style; in getStyle()
3590 Style.InheritsParentConfig = false; in getStyle()
3604 auto applyChildFormatTexts = [&](FormatStyle *Style) { in getStyle() argument
3606 auto EC = parseConfiguration(*MemBuf, Style, AllowUnknownOptions, in getStyle()
3634 loadAndParseConfigFile(ConfigFile, FS, &Style, AllowUnknownOptions); in getStyle()
3648 if (!Style.InheritsParentConfig) { in getStyle()
3650 return Style; in getStyle()
3653 applyChildFormatTexts(&Style); in getStyle()
3655 return Style; in getStyle()
3661 Style.InheritsParentConfig = false; in getStyle()
3675 getLanguageName(Style.Language) + ": " + in getStyle()