Lines Matching refs:Style
497 static void mapping(IO &IO, FormatStyle &Style) { in mapping()
499 IO.mapOptional("Language", Style.Language); in mapping()
508 if (getPredefinedStyle(StyleName, Style.Language, &PredefinedStyle) && in mapping()
509 Style == PredefinedStyle) { in mapping()
518 FormatStyle::LanguageKind OldLanguage = Style.Language; in mapping()
521 if (!getPredefinedStyle(BasedOnStyle, Language, &Style)) { in mapping()
525 Style.Language = OldLanguage; in mapping()
531 IO.mapOptional("AlignEscapedNewlinesLeft", Style.AlignEscapedNewlines); in mapping()
532 IO.mapOptional("DerivePointerBinding", Style.DerivePointerAlignment); in mapping()
534 Style.IndentWrappedFunctionNames); in mapping()
535 IO.mapOptional("PointerBindsToType", Style.PointerAlignment); in mapping()
537 Style.SpaceBeforeParens); in mapping()
540 IO.mapOptional("AccessModifierOffset", Style.AccessModifierOffset); in mapping()
541 IO.mapOptional("AlignAfterOpenBracket", Style.AlignAfterOpenBracket); in mapping()
542 IO.mapOptional("AlignArrayOfStructures", Style.AlignArrayOfStructures); in mapping()
543 IO.mapOptional("AlignConsecutiveMacros", Style.AlignConsecutiveMacros); in mapping()
545 Style.AlignConsecutiveAssignments); in mapping()
547 Style.AlignConsecutiveBitFields); in mapping()
549 Style.AlignConsecutiveDeclarations); in mapping()
550 IO.mapOptional("AlignEscapedNewlines", Style.AlignEscapedNewlines); in mapping()
551 IO.mapOptional("AlignOperands", Style.AlignOperands); in mapping()
552 IO.mapOptional("AlignTrailingComments", Style.AlignTrailingComments); in mapping()
554 Style.AllowAllArgumentsOnNextLine); in mapping()
556 Style.AllowAllConstructorInitializersOnNextLine); in mapping()
558 Style.AllowAllParametersOfDeclarationOnNextLine); in mapping()
560 Style.AllowShortEnumsOnASingleLine); in mapping()
562 Style.AllowShortBlocksOnASingleLine); in mapping()
564 Style.AllowShortCaseLabelsOnASingleLine); in mapping()
566 Style.AllowShortFunctionsOnASingleLine); in mapping()
568 Style.AllowShortLambdasOnASingleLine); in mapping()
570 Style.AllowShortIfStatementsOnASingleLine); in mapping()
572 Style.AllowShortLoopsOnASingleLine); in mapping()
574 Style.AlwaysBreakAfterDefinitionReturnType); in mapping()
576 Style.AlwaysBreakAfterReturnType); in mapping()
581 if (Style.AlwaysBreakAfterDefinitionReturnType != FormatStyle::DRTBS_None && in mapping()
582 Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) { in mapping()
583 if (Style.AlwaysBreakAfterDefinitionReturnType == FormatStyle::DRTBS_All) in mapping()
584 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in mapping()
585 else if (Style.AlwaysBreakAfterDefinitionReturnType == in mapping()
587 Style.AlwaysBreakAfterReturnType = in mapping()
592 Style.AlwaysBreakBeforeMultilineStrings); in mapping()
594 Style.AlwaysBreakTemplateDeclarations); in mapping()
595 IO.mapOptional("AttributeMacros", Style.AttributeMacros); in mapping()
596 IO.mapOptional("BinPackArguments", Style.BinPackArguments); in mapping()
597 IO.mapOptional("BinPackParameters", Style.BinPackParameters); in mapping()
598 IO.mapOptional("BraceWrapping", Style.BraceWrapping); in mapping()
600 Style.BreakBeforeBinaryOperators); in mapping()
602 Style.BreakBeforeConceptDeclarations); in mapping()
603 IO.mapOptional("BreakBeforeBraces", Style.BreakBeforeBraces); in mapping()
607 IO.mapOptional("BreakInheritanceList", Style.BreakInheritanceList); in mapping()
612 Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) in mapping()
613 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in mapping()
616 Style.BreakBeforeTernaryOperators); in mapping()
622 Style.BreakConstructorInitializers); in mapping()
627 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeColon) in mapping()
628 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in mapping()
631 Style.BreakAfterJavaFieldAnnotations); in mapping()
632 IO.mapOptional("BreakStringLiterals", Style.BreakStringLiterals); in mapping()
633 IO.mapOptional("ColumnLimit", Style.ColumnLimit); in mapping()
634 IO.mapOptional("CommentPragmas", Style.CommentPragmas); in mapping()
635 IO.mapOptional("CompactNamespaces", Style.CompactNamespaces); in mapping()
637 Style.ConstructorInitializerAllOnOneLineOrOnePerLine); in mapping()
639 Style.ConstructorInitializerIndentWidth); in mapping()
640 IO.mapOptional("ContinuationIndentWidth", Style.ContinuationIndentWidth); in mapping()
641 IO.mapOptional("Cpp11BracedListStyle", Style.Cpp11BracedListStyle); in mapping()
642 IO.mapOptional("DeriveLineEnding", Style.DeriveLineEnding); in mapping()
643 IO.mapOptional("DerivePointerAlignment", Style.DerivePointerAlignment); in mapping()
644 IO.mapOptional("DisableFormat", Style.DisableFormat); in mapping()
646 Style.EmptyLineAfterAccessModifier); in mapping()
648 Style.EmptyLineBeforeAccessModifier); in mapping()
650 Style.ExperimentalAutoDetectBinPacking); in mapping()
651 IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments); in mapping()
652 IO.mapOptional("ForEachMacros", Style.ForEachMacros); in mapping()
653 IO.mapOptional("IfMacros", Style.IfMacros); in mapping()
655 IO.mapOptional("IncludeBlocks", Style.IncludeStyle.IncludeBlocks); in mapping()
656 IO.mapOptional("IncludeCategories", Style.IncludeStyle.IncludeCategories); in mapping()
657 IO.mapOptional("IncludeIsMainRegex", Style.IncludeStyle.IncludeIsMainRegex); in mapping()
659 Style.IncludeStyle.IncludeIsMainSourceRegex); in mapping()
660 IO.mapOptional("IndentAccessModifiers", Style.IndentAccessModifiers); in mapping()
661 IO.mapOptional("IndentCaseLabels", Style.IndentCaseLabels); in mapping()
662 IO.mapOptional("IndentCaseBlocks", Style.IndentCaseBlocks); in mapping()
663 IO.mapOptional("IndentGotoLabels", Style.IndentGotoLabels); in mapping()
664 IO.mapOptional("IndentPPDirectives", Style.IndentPPDirectives); in mapping()
665 IO.mapOptional("IndentExternBlock", Style.IndentExternBlock); in mapping()
666 IO.mapOptional("IndentRequires", Style.IndentRequires); in mapping()
667 IO.mapOptional("IndentWidth", Style.IndentWidth); in mapping()
669 Style.IndentWrappedFunctionNames); in mapping()
670 IO.mapOptional("InsertTrailingCommas", Style.InsertTrailingCommas); in mapping()
671 IO.mapOptional("JavaImportGroups", Style.JavaImportGroups); in mapping()
672 IO.mapOptional("JavaScriptQuotes", Style.JavaScriptQuotes); in mapping()
673 IO.mapOptional("JavaScriptWrapImports", Style.JavaScriptWrapImports); in mapping()
675 Style.KeepEmptyLinesAtTheStartOfBlocks); in mapping()
676 IO.mapOptional("LambdaBodyIndentation", Style.LambdaBodyIndentation); in mapping()
677 IO.mapOptional("MacroBlockBegin", Style.MacroBlockBegin); in mapping()
678 IO.mapOptional("MacroBlockEnd", Style.MacroBlockEnd); in mapping()
679 IO.mapOptional("MaxEmptyLinesToKeep", Style.MaxEmptyLinesToKeep); in mapping()
680 IO.mapOptional("NamespaceIndentation", Style.NamespaceIndentation); in mapping()
681 IO.mapOptional("NamespaceMacros", Style.NamespaceMacros); in mapping()
682 IO.mapOptional("ObjCBinPackProtocolList", Style.ObjCBinPackProtocolList); in mapping()
683 IO.mapOptional("ObjCBlockIndentWidth", Style.ObjCBlockIndentWidth); in mapping()
685 Style.ObjCBreakBeforeNestedBlockParam); in mapping()
686 IO.mapOptional("ObjCSpaceAfterProperty", Style.ObjCSpaceAfterProperty); in mapping()
688 Style.ObjCSpaceBeforeProtocolList); in mapping()
689 IO.mapOptional("PenaltyBreakAssignment", Style.PenaltyBreakAssignment); in mapping()
691 Style.PenaltyBreakBeforeFirstCallParameter); in mapping()
692 IO.mapOptional("PenaltyBreakComment", Style.PenaltyBreakComment); in mapping()
694 Style.PenaltyBreakFirstLessLess); in mapping()
695 IO.mapOptional("PenaltyBreakString", Style.PenaltyBreakString); in mapping()
697 Style.PenaltyBreakTemplateDeclaration); in mapping()
698 IO.mapOptional("PenaltyExcessCharacter", Style.PenaltyExcessCharacter); in mapping()
700 Style.PenaltyReturnTypeOnItsOwnLine); in mapping()
702 Style.PenaltyIndentedWhitespace); in mapping()
703 IO.mapOptional("PointerAlignment", Style.PointerAlignment); in mapping()
704 IO.mapOptional("PPIndentWidth", Style.PPIndentWidth); in mapping()
705 IO.mapOptional("RawStringFormats", Style.RawStringFormats); in mapping()
706 IO.mapOptional("ReferenceAlignment", Style.ReferenceAlignment); in mapping()
707 IO.mapOptional("ReflowComments", Style.ReflowComments); in mapping()
708 IO.mapOptional("ShortNamespaceLines", Style.ShortNamespaceLines); in mapping()
709 IO.mapOptional("SortIncludes", Style.SortIncludes); in mapping()
710 IO.mapOptional("SortJavaStaticImport", Style.SortJavaStaticImport); in mapping()
711 IO.mapOptional("SortUsingDeclarations", Style.SortUsingDeclarations); in mapping()
712 IO.mapOptional("SpaceAfterCStyleCast", Style.SpaceAfterCStyleCast); in mapping()
713 IO.mapOptional("SpaceAfterLogicalNot", Style.SpaceAfterLogicalNot); in mapping()
715 Style.SpaceAfterTemplateKeyword); in mapping()
717 Style.SpaceBeforeAssignmentOperators); in mapping()
718 IO.mapOptional("SpaceBeforeCaseColon", Style.SpaceBeforeCaseColon); in mapping()
720 Style.SpaceBeforeCpp11BracedList); in mapping()
722 Style.SpaceBeforeCtorInitializerColon); in mapping()
724 Style.SpaceBeforeInheritanceColon); in mapping()
725 IO.mapOptional("SpaceBeforeParens", Style.SpaceBeforeParens); in mapping()
727 Style.SpaceAroundPointerQualifiers); in mapping()
729 Style.SpaceBeforeRangeBasedForLoopColon); in mapping()
730 IO.mapOptional("SpaceInEmptyBlock", Style.SpaceInEmptyBlock); in mapping()
731 IO.mapOptional("SpaceInEmptyParentheses", Style.SpaceInEmptyParentheses); in mapping()
733 Style.SpacesBeforeTrailingComments); in mapping()
734 IO.mapOptional("SpacesInAngles", Style.SpacesInAngles); in mapping()
736 Style.SpacesInConditionalStatement); in mapping()
738 Style.SpacesInContainerLiterals); in mapping()
740 Style.SpacesInCStyleCastParentheses); in mapping()
742 Style.SpacesInLineCommentPrefix); in mapping()
743 IO.mapOptional("SpacesInParentheses", Style.SpacesInParentheses); in mapping()
744 IO.mapOptional("SpacesInSquareBrackets", Style.SpacesInSquareBrackets); in mapping()
746 Style.SpaceBeforeSquareBrackets); in mapping()
747 IO.mapOptional("BitFieldColonSpacing", Style.BitFieldColonSpacing); in mapping()
748 IO.mapOptional("Standard", Style.Standard); in mapping()
750 Style.StatementAttributeLikeMacros); in mapping()
751 IO.mapOptional("StatementMacros", Style.StatementMacros); in mapping()
752 IO.mapOptional("TabWidth", Style.TabWidth); in mapping()
753 IO.mapOptional("TypenameMacros", Style.TypenameMacros); in mapping()
754 IO.mapOptional("UseCRLF", Style.UseCRLF); in mapping()
755 IO.mapOptional("UseTab", Style.UseTab); in mapping()
757 Style.WhitespaceSensitiveMacros); in mapping()
870 static FormatStyle expandPresets(const FormatStyle &Style) { in expandPresets() argument
871 if (Style.BreakBeforeBraces == FormatStyle::BS_Custom) in expandPresets()
872 return Style; in expandPresets()
873 FormatStyle Expanded = Style; in expandPresets()
892 switch (Style.BreakBeforeBraces) { in expandPresets()
1371 FormatStyle Style = getLLVMStyle(); in getWebKitStyle() local
1372 Style.AccessModifierOffset = -4; in getWebKitStyle()
1373 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getWebKitStyle()
1374 Style.AlignOperands = FormatStyle::OAS_DontAlign; in getWebKitStyle()
1375 Style.AlignTrailingComments = false; in getWebKitStyle()
1376 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty; in getWebKitStyle()
1377 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getWebKitStyle()
1378 Style.BreakBeforeBraces = FormatStyle::BS_WebKit; in getWebKitStyle()
1379 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getWebKitStyle()
1380 Style.Cpp11BracedListStyle = false; in getWebKitStyle()
1381 Style.ColumnLimit = 0; in getWebKitStyle()
1382 Style.FixNamespaceComments = false; in getWebKitStyle()
1383 Style.IndentWidth = 4; in getWebKitStyle()
1384 Style.NamespaceIndentation = FormatStyle::NI_Inner; in getWebKitStyle()
1385 Style.ObjCBlockIndentWidth = 4; in getWebKitStyle()
1386 Style.ObjCSpaceAfterProperty = true; in getWebKitStyle()
1387 Style.PointerAlignment = FormatStyle::PAS_Left; in getWebKitStyle()
1388 Style.SpaceBeforeCpp11BracedList = true; in getWebKitStyle()
1389 Style.SpaceInEmptyBlock = true; in getWebKitStyle()
1390 return Style; in getWebKitStyle()
1394 FormatStyle Style = getLLVMStyle(); in getGNUStyle() local
1395 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All; in getGNUStyle()
1396 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in getGNUStyle()
1397 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getGNUStyle()
1398 Style.BreakBeforeBraces = FormatStyle::BS_GNU; in getGNUStyle()
1399 Style.BreakBeforeTernaryOperators = true; in getGNUStyle()
1400 Style.Cpp11BracedListStyle = false; in getGNUStyle()
1401 Style.ColumnLimit = 79; in getGNUStyle()
1402 Style.FixNamespaceComments = false; in getGNUStyle()
1403 Style.SpaceBeforeParens = FormatStyle::SBPO_Always; in getGNUStyle()
1404 Style.Standard = FormatStyle::LS_Cpp03; in getGNUStyle()
1405 return Style; in getGNUStyle()
1409 FormatStyle Style = getLLVMStyle(Language); in getMicrosoftStyle() local
1410 Style.ColumnLimit = 120; in getMicrosoftStyle()
1411 Style.TabWidth = 4; in getMicrosoftStyle()
1412 Style.IndentWidth = 4; in getMicrosoftStyle()
1413 Style.UseTab = FormatStyle::UT_Never; in getMicrosoftStyle()
1414 Style.BreakBeforeBraces = FormatStyle::BS_Custom; in getMicrosoftStyle()
1415 Style.BraceWrapping.AfterClass = true; in getMicrosoftStyle()
1416 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in getMicrosoftStyle()
1417 Style.BraceWrapping.AfterEnum = true; in getMicrosoftStyle()
1418 Style.BraceWrapping.AfterFunction = true; in getMicrosoftStyle()
1419 Style.BraceWrapping.AfterNamespace = true; in getMicrosoftStyle()
1420 Style.BraceWrapping.AfterObjCDeclaration = true; in getMicrosoftStyle()
1421 Style.BraceWrapping.AfterStruct = true; in getMicrosoftStyle()
1422 Style.BraceWrapping.AfterExternBlock = true; in getMicrosoftStyle()
1423 Style.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in getMicrosoftStyle()
1424 Style.BraceWrapping.BeforeCatch = true; in getMicrosoftStyle()
1425 Style.BraceWrapping.BeforeElse = true; in getMicrosoftStyle()
1426 Style.BraceWrapping.BeforeWhile = false; in getMicrosoftStyle()
1427 Style.PenaltyReturnTypeOnItsOwnLine = 1000; in getMicrosoftStyle()
1428 Style.AllowShortEnumsOnASingleLine = false; in getMicrosoftStyle()
1429 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None; in getMicrosoftStyle()
1430 Style.AllowShortCaseLabelsOnASingleLine = false; in getMicrosoftStyle()
1431 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getMicrosoftStyle()
1432 Style.AllowShortLoopsOnASingleLine = false; in getMicrosoftStyle()
1433 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getMicrosoftStyle()
1434 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; in getMicrosoftStyle()
1435 return Style; in getMicrosoftStyle()
1447 FormatStyle *Style) { in getPredefinedStyle() argument
1449 *Style = getLLVMStyle(Language); in getPredefinedStyle()
1451 *Style = getChromiumStyle(Language); in getPredefinedStyle()
1453 *Style = getMozillaStyle(); in getPredefinedStyle()
1455 *Style = getGoogleStyle(Language); in getPredefinedStyle()
1457 *Style = getWebKitStyle(); in getPredefinedStyle()
1459 *Style = getGNUStyle(); in getPredefinedStyle()
1461 *Style = getMicrosoftStyle(Language); in getPredefinedStyle()
1463 *Style = getNoStyle(); in getPredefinedStyle()
1465 Style->InheritsParentConfig = true; in getPredefinedStyle()
1470 Style->Language = Language; in getPredefinedStyle()
1475 FormatStyle *Style, bool AllowUnknownOptions, in parseConfiguration() argument
1478 assert(Style); in parseConfiguration()
1479 FormatStyle::LanguageKind Language = Style->Language; in parseConfiguration()
1483 Style->StyleSet.Clear(); in parseConfiguration()
1491 Input.setContext(Style); in parseConfiguration()
1529 *Style = *StyleSet.Get(Language); in parseConfiguration()
1530 if (Style->InsertTrailingCommas != FormatStyle::TCS_None && in parseConfiguration()
1531 Style->BinPackArguments) { in parseConfiguration()
1538 std::string configurationAsText(const FormatStyle &Style) { in configurationAsText() argument
1544 FormatStyle NonConstStyle = expandPresets(Style); in configurationAsText()
1556 FormatStyle Style = It->second; in Get() local
1557 Style.StyleSet = *this; in Get()
1558 return Style; in Get()
1561 void FormatStyle::FormatStyleSet::Add(FormatStyle Style) { in Add() argument
1562 assert(Style.Language != LK_None && in Add()
1565 !Style.StyleSet.Styles && in Add()
1569 (*Styles)[Style.Language] = std::move(Style); in Add()
1583 JavaScriptRequoter(const Environment &Env, const FormatStyle &Style) in JavaScriptRequoter() argument
1584 : TokenAnalyzer(Env, Style) {} in JavaScriptRequoter()
1611 (Style.JavaScriptQuotes == FormatStyle::JSQS_Single && in requoteJSStringLiteral()
1613 (Style.JavaScriptQuotes == FormatStyle::JSQS_Double && in requoteJSStringLiteral()
1618 bool IsSingle = Style.JavaScriptQuotes == FormatStyle::JSQS_Single; in requoteJSStringLiteral()
1670 Formatter(const Environment &Env, const FormatStyle &Style, in Formatter() argument
1672 : TokenAnalyzer(Env, Style), Status(Status) {} in Formatter()
1687 Env.getSourceManager(), Style, in analyze()
1688 Style.DeriveLineEnding in analyze()
1691 Style.UseCRLF) in analyze()
1692 : Style.UseCRLF); in analyze()
1693 ContinuationIndenter Indenter(Style, Tokens.getKeywords(), in analyze()
1697 UnwrappedLineFormatter(&Indenter, &Whitespaces, Style, in analyze()
1774 if (Style.DerivePointerAlignment) { in deriveLocalStyle()
1775 Style.PointerAlignment = countVariableAlignments(AnnotatedLines) <= 0 in deriveLocalStyle()
1778 Style.ReferenceAlignment = FormatStyle::RAS_Pointer; in deriveLocalStyle()
1780 if (Style.Standard == FormatStyle::LS_Auto) in deriveLocalStyle()
1781 Style.Standard = hasCpp03IncompatibleFormat(AnnotatedLines) in deriveLocalStyle()
1805 TrailingCommaInserter(const Environment &Env, const FormatStyle &Style) in TrailingCommaInserter() argument
1806 : TokenAnalyzer(Env, Style) {} in TrailingCommaInserter()
1850 if (ColumnNumber > Style.ColumnLimit) in insertTrailingCommas()
1865 Cleaner(const Environment &Env, const FormatStyle &Style) in Cleaner() argument
1866 : TokenAnalyzer(Env, Style), in Cleaner()
1943 if (Style.BraceWrapping.AfterNamespace) { in checkEmptyNamespace()
2090 ObjCHeaderStyleGuesser(const Environment &Env, const FormatStyle &Style) in ObjCHeaderStyleGuesser() argument
2091 : TokenAnalyzer(Env, Style), IsObjC(false) {} in ObjCHeaderStyleGuesser()
2097 assert(Style.Language == FormatStyle::LK_Cpp); in analyze()
2310 static void sortCppIncludes(const FormatStyle &Style, in sortCppIncludes() argument
2315 tooling::IncludeCategoryManager Categories(Style.IncludeStyle, FileName); in sortCppIncludes()
2327 if (Style.SortIncludes == FormatStyle::SI_CaseInsensitive) { in sortCppIncludes()
2369 Style.IncludeStyle.IncludeBlocks == tooling::IncludeStyle::IBS_Preserve) in sortCppIncludes()
2376 if (Style.IncludeStyle.IncludeBlocks == in sortCppIncludes()
2410 tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code, in sortCppIncludes() argument
2430 tooling::IncludeCategoryManager Categories(Style.IncludeStyle, FileName); in sortCppIncludes()
2449 (Style.IncludeStyle.IncludeBlocks == tooling::IncludeStyle::IBS_Merge || in sortCppIncludes()
2450 Style.IncludeStyle.IncludeBlocks == in sortCppIncludes()
2467 sortCppIncludes(Style, IncludesInBlock, Ranges, FileName, Code, in sortCppIncludes()
2484 sortCppIncludes(Style, IncludesInBlock, Ranges, FileName, Code, Replaces, in sortCppIncludes()
2492 static unsigned findJavaImportGroup(const FormatStyle &Style, in findJavaImportGroup() argument
2496 for (unsigned I = 0; I < Style.JavaImportGroups.size(); I++) { in findJavaImportGroup()
2497 std::string GroupPrefix = Style.JavaImportGroups[I]; in findJavaImportGroup()
2512 static void sortJavaImports(const FormatStyle &Style, in sortJavaImports() argument
2527 findJavaImportGroup(Style, Imports[i].Identifier)); in sortJavaImports()
2530 Style.SortJavaStaticImport == FormatStyle::SJSIO_After; in sortJavaImports()
2591 tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code, in sortJavaImports() argument
2640 sortJavaImports(Style, ImportsInBlock, Ranges, FileName, Code, Replaces); in sortJavaImports()
2653 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, in sortIncludes() argument
2657 if (!Style.SortIncludes || Style.DisableFormat) in sortIncludes()
2661 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && in sortIncludes()
2664 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript) in sortIncludes()
2665 return sortJavaScriptImports(Style, Code, Ranges, FileName); in sortIncludes()
2666 if (Style.Language == FormatStyle::LanguageKind::LK_Java) in sortIncludes()
2667 return sortJavaImports(Style, Code, Ranges, FileName, Replaces); in sortIncludes()
2668 sortCppIncludes(Style, Code, Ranges, FileName, Replaces, Cursor); in sortIncludes()
2676 const FormatStyle &Style) { in processReplacements() argument
2687 ProcessFunc(Style, *NewCode, ChangedRanges, FileName); in processReplacements()
2694 const FormatStyle &Style) { in formatReplacements() argument
2697 auto SortIncludes = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
2700 return sortIncludes(Style, Code, Ranges, FileName); in formatReplacements()
2703 processReplacements(SortIncludes, Code, Replaces, Style); in formatReplacements()
2709 auto Reformat = [](const FormatStyle &Style, StringRef Code, in formatReplacements() argument
2712 return reformat(Style, Code, Ranges, FileName); in formatReplacements()
2714 return processReplacements(Reformat, Code, *SortedReplaces, Style); in formatReplacements()
2732 const FormatStyle &Style) { in fixCppIncludeInsertions() argument
2733 if (!Style.isCpp()) in fixCppIncludeInsertions()
2758 tooling::HeaderIncludes Includes(FileName, Code, Style.IncludeStyle); in fixCppIncludeInsertions()
2804 const FormatStyle &Style) { in cleanupAroundReplacements() argument
2807 auto Cleanup = [](const FormatStyle &Style, StringRef Code, in cleanupAroundReplacements()
2810 return cleanup(Style, Code, Ranges, FileName); in cleanupAroundReplacements()
2814 fixCppIncludeInsertions(Code, Replaces, Style); in cleanupAroundReplacements()
2815 return processReplacements(Cleanup, Code, NewReplaces, Style); in cleanupAroundReplacements()
2820 reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
2824 FormatStyle Expanded = expandPresets(Style); in reformat()
2833 if (Style.isJson()) { in reformat()
2840 Formatter(*Env, Style, Status).process().first; in reformat()
2856 if (Style.Language == FormatStyle::LK_Cpp) { in reformat()
2857 if (Style.FixNamespaceComments) in reformat()
2862 if (Style.SortUsingDeclarations) in reformat()
2868 if (Style.Language == FormatStyle::LK_JavaScript && in reformat()
2869 Style.JavaScriptQuotes != FormatStyle::JSQS_Leave) in reformat()
2878 if (Style.Language == FormatStyle::LK_JavaScript && in reformat()
2879 Style.InsertTrailingCommas == FormatStyle::TCS_Wrapped) in reformat()
2911 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
2915 return internal::reformat(Style, Code, Ranges, in reformat()
2922 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code, in cleanup() argument
2926 if (Style.Language != FormatStyle::LK_Cpp) in cleanup()
2928 return Cleaner(Environment(Code, FileName, Ranges), Style).process().first; in cleanup()
2931 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
2935 auto Result = reformat(Style, Code, Ranges, FileName, &Status); in reformat()
2941 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style, in fixNamespaceEndComments() argument
2945 return NamespaceEndCommentsFixer(Environment(Code, FileName, Ranges), Style) in fixNamespaceEndComments()
2950 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, in sortUsingDeclarations() argument
2954 return UsingDeclarationsSorter(Environment(Code, FileName, Ranges), Style) in sortUsingDeclarations()
2959 LangOptions getFormattingLangOpts(const FormatStyle &Style) { in getFormattingLangOpts() argument
2962 FormatStyle::LanguageStandard LexingStd = Style.Standard; in getFormattingLangOpts()
2975 bool AlternativeOperators = Style.isCpp(); in getFormattingLangOpts()
3051 FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code)); in getStyle() local
3054 if (!getPredefinedStyle(FallbackStyleName, Style.Language, &FallbackStyle)) in getStyle()
3064 parseConfiguration(llvm::MemoryBufferRef(StyleName, Source), &Style, in getStyle()
3067 if (Style.InheritsParentConfig) in getStyle()
3071 return Style; in getStyle()
3077 if (!Style.InheritsParentConfig && !StyleName.equals_insensitive("file")) { in getStyle()
3078 if (!getPredefinedStyle(StyleName, Style.Language, &Style)) in getStyle()
3080 if (!Style.InheritsParentConfig) in getStyle()
3081 return Style; in getStyle()
3085 Style.InheritsParentConfig = false; in getStyle()
3123 parseConfiguration(*Text.get(), &Style, AllowUnknownOptions)) { in getStyle()
3136 if (!Style.InheritsParentConfig) { in getStyle()
3138 return Style; in getStyle()
3143 auto Ec = parseConfiguration(*MemBuf, &Style, AllowUnknownOptions, in getStyle()
3150 return Style; in getStyle()
3156 Style.InheritsParentConfig = false; in getStyle()
3170 getLanguageName(Style.Language) + ": " + in getStyle()