Lines Matching refs:FormatStyle
50 using clang::format::FormatStyle;
52 LLVM_YAML_IS_SEQUENCE_VECTOR(clang::format::FormatStyle::RawStringFormat)
56 template <> struct ScalarEnumerationTraits<FormatStyle::LanguageKind> {
57 static void enumeration(IO &IO, FormatStyle::LanguageKind &Value) { in enumeration()
58 IO.enumCase(Value, "Cpp", FormatStyle::LK_Cpp); in enumeration()
59 IO.enumCase(Value, "Java", FormatStyle::LK_Java); in enumeration()
60 IO.enumCase(Value, "JavaScript", FormatStyle::LK_JavaScript); in enumeration()
61 IO.enumCase(Value, "ObjC", FormatStyle::LK_ObjC); in enumeration()
62 IO.enumCase(Value, "Proto", FormatStyle::LK_Proto); in enumeration()
63 IO.enumCase(Value, "TableGen", FormatStyle::LK_TableGen); in enumeration()
64 IO.enumCase(Value, "TextProto", FormatStyle::LK_TextProto); in enumeration()
68 template <> struct ScalarEnumerationTraits<FormatStyle::LanguageStandard> {
69 static void enumeration(IO &IO, FormatStyle::LanguageStandard &Value) { in enumeration()
70 IO.enumCase(Value, "Cpp03", FormatStyle::LS_Cpp03); in enumeration()
71 IO.enumCase(Value, "C++03", FormatStyle::LS_Cpp03); in enumeration()
72 IO.enumCase(Value, "Cpp11", FormatStyle::LS_Cpp11); in enumeration()
73 IO.enumCase(Value, "C++11", FormatStyle::LS_Cpp11); in enumeration()
74 IO.enumCase(Value, "Auto", FormatStyle::LS_Auto); in enumeration()
78 template <> struct ScalarEnumerationTraits<FormatStyle::UseTabStyle> {
79 static void enumeration(IO &IO, FormatStyle::UseTabStyle &Value) { in enumeration()
80 IO.enumCase(Value, "Never", FormatStyle::UT_Never); in enumeration()
81 IO.enumCase(Value, "false", FormatStyle::UT_Never); in enumeration()
82 IO.enumCase(Value, "Always", FormatStyle::UT_Always); in enumeration()
83 IO.enumCase(Value, "true", FormatStyle::UT_Always); in enumeration()
84 IO.enumCase(Value, "ForIndentation", FormatStyle::UT_ForIndentation); in enumeration()
86 FormatStyle::UT_ForContinuationAndIndentation); in enumeration()
90 template <> struct ScalarEnumerationTraits<FormatStyle::JavaScriptQuoteStyle> {
91 static void enumeration(IO &IO, FormatStyle::JavaScriptQuoteStyle &Value) { in enumeration()
92 IO.enumCase(Value, "Leave", FormatStyle::JSQS_Leave); in enumeration()
93 IO.enumCase(Value, "Single", FormatStyle::JSQS_Single); in enumeration()
94 IO.enumCase(Value, "Double", FormatStyle::JSQS_Double); in enumeration()
98 template <> struct ScalarEnumerationTraits<FormatStyle::ShortFunctionStyle> {
99 static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) { in enumeration()
100 IO.enumCase(Value, "None", FormatStyle::SFS_None); in enumeration()
101 IO.enumCase(Value, "false", FormatStyle::SFS_None); in enumeration()
102 IO.enumCase(Value, "All", FormatStyle::SFS_All); in enumeration()
103 IO.enumCase(Value, "true", FormatStyle::SFS_All); in enumeration()
104 IO.enumCase(Value, "Inline", FormatStyle::SFS_Inline); in enumeration()
105 IO.enumCase(Value, "InlineOnly", FormatStyle::SFS_InlineOnly); in enumeration()
106 IO.enumCase(Value, "Empty", FormatStyle::SFS_Empty); in enumeration()
110 template <> struct ScalarEnumerationTraits<FormatStyle::BinPackStyle> {
111 static void enumeration(IO &IO, FormatStyle::BinPackStyle &Value) { in enumeration()
112 IO.enumCase(Value, "Auto", FormatStyle::BPS_Auto); in enumeration()
113 IO.enumCase(Value, "Always", FormatStyle::BPS_Always); in enumeration()
114 IO.enumCase(Value, "Never", FormatStyle::BPS_Never); in enumeration()
118 template <> struct ScalarEnumerationTraits<FormatStyle::BinaryOperatorStyle> {
119 static void enumeration(IO &IO, FormatStyle::BinaryOperatorStyle &Value) { in enumeration()
120 IO.enumCase(Value, "All", FormatStyle::BOS_All); in enumeration()
121 IO.enumCase(Value, "true", FormatStyle::BOS_All); in enumeration()
122 IO.enumCase(Value, "None", FormatStyle::BOS_None); in enumeration()
123 IO.enumCase(Value, "false", FormatStyle::BOS_None); in enumeration()
124 IO.enumCase(Value, "NonAssignment", FormatStyle::BOS_NonAssignment); in enumeration()
128 template <> struct ScalarEnumerationTraits<FormatStyle::BraceBreakingStyle> {
129 static void enumeration(IO &IO, FormatStyle::BraceBreakingStyle &Value) { in enumeration()
130 IO.enumCase(Value, "Attach", FormatStyle::BS_Attach); in enumeration()
131 IO.enumCase(Value, "Linux", FormatStyle::BS_Linux); in enumeration()
132 IO.enumCase(Value, "Mozilla", FormatStyle::BS_Mozilla); in enumeration()
133 IO.enumCase(Value, "Stroustrup", FormatStyle::BS_Stroustrup); in enumeration()
134 IO.enumCase(Value, "Allman", FormatStyle::BS_Allman); in enumeration()
135 IO.enumCase(Value, "GNU", FormatStyle::BS_GNU); in enumeration()
136 IO.enumCase(Value, "WebKit", FormatStyle::BS_WebKit); in enumeration()
137 IO.enumCase(Value, "Custom", FormatStyle::BS_Custom); in enumeration()
142 struct ScalarEnumerationTraits<FormatStyle::BreakConstructorInitializersStyle> {
144 enumeration(IO &IO, FormatStyle::BreakConstructorInitializersStyle &Value) { in enumeration()
145 IO.enumCase(Value, "BeforeColon", FormatStyle::BCIS_BeforeColon); in enumeration()
146 IO.enumCase(Value, "BeforeComma", FormatStyle::BCIS_BeforeComma); in enumeration()
147 IO.enumCase(Value, "AfterColon", FormatStyle::BCIS_AfterColon); in enumeration()
152 struct ScalarEnumerationTraits<FormatStyle::BreakInheritanceListStyle> {
154 enumeration(IO &IO, FormatStyle::BreakInheritanceListStyle &Value) { in enumeration()
155 IO.enumCase(Value, "BeforeColon", FormatStyle::BILS_BeforeColon); in enumeration()
156 IO.enumCase(Value, "BeforeComma", FormatStyle::BILS_BeforeComma); in enumeration()
157 IO.enumCase(Value, "AfterColon", FormatStyle::BILS_AfterColon); in enumeration()
162 struct ScalarEnumerationTraits<FormatStyle::PPDirectiveIndentStyle> {
163 static void enumeration(IO &IO, FormatStyle::PPDirectiveIndentStyle &Value) { in enumeration()
164 IO.enumCase(Value, "None", FormatStyle::PPDIS_None); in enumeration()
165 IO.enumCase(Value, "AfterHash", FormatStyle::PPDIS_AfterHash); in enumeration()
170 struct ScalarEnumerationTraits<FormatStyle::ReturnTypeBreakingStyle> {
171 static void enumeration(IO &IO, FormatStyle::ReturnTypeBreakingStyle &Value) { in enumeration()
172 IO.enumCase(Value, "None", FormatStyle::RTBS_None); in enumeration()
173 IO.enumCase(Value, "All", FormatStyle::RTBS_All); in enumeration()
174 IO.enumCase(Value, "TopLevel", FormatStyle::RTBS_TopLevel); in enumeration()
176 FormatStyle::RTBS_TopLevelDefinitions); in enumeration()
177 IO.enumCase(Value, "AllDefinitions", FormatStyle::RTBS_AllDefinitions); in enumeration()
182 struct ScalarEnumerationTraits<FormatStyle::BreakTemplateDeclarationsStyle> {
183 static void enumeration(IO &IO, FormatStyle::BreakTemplateDeclarationsStyle &Value) { in enumeration()
184 IO.enumCase(Value, "No", FormatStyle::BTDS_No); in enumeration()
185 IO.enumCase(Value, "MultiLine", FormatStyle::BTDS_MultiLine); in enumeration()
186 IO.enumCase(Value, "Yes", FormatStyle::BTDS_Yes); in enumeration()
189 IO.enumCase(Value, "false", FormatStyle::BTDS_MultiLine); in enumeration()
190 IO.enumCase(Value, "true", FormatStyle::BTDS_Yes); in enumeration()
195 struct ScalarEnumerationTraits<FormatStyle::DefinitionReturnTypeBreakingStyle> {
197 enumeration(IO &IO, FormatStyle::DefinitionReturnTypeBreakingStyle &Value) { in enumeration()
198 IO.enumCase(Value, "None", FormatStyle::DRTBS_None); in enumeration()
199 IO.enumCase(Value, "All", FormatStyle::DRTBS_All); in enumeration()
200 IO.enumCase(Value, "TopLevel", FormatStyle::DRTBS_TopLevel); in enumeration()
203 IO.enumCase(Value, "false", FormatStyle::DRTBS_None); in enumeration()
204 IO.enumCase(Value, "true", FormatStyle::DRTBS_All); in enumeration()
209 struct ScalarEnumerationTraits<FormatStyle::NamespaceIndentationKind> {
211 FormatStyle::NamespaceIndentationKind &Value) { in enumeration()
212 IO.enumCase(Value, "None", FormatStyle::NI_None); in enumeration()
213 IO.enumCase(Value, "Inner", FormatStyle::NI_Inner); in enumeration()
214 IO.enumCase(Value, "All", FormatStyle::NI_All); in enumeration()
218 template <> struct ScalarEnumerationTraits<FormatStyle::BracketAlignmentStyle> {
219 static void enumeration(IO &IO, FormatStyle::BracketAlignmentStyle &Value) { in enumeration()
220 IO.enumCase(Value, "Align", FormatStyle::BAS_Align); in enumeration()
221 IO.enumCase(Value, "DontAlign", FormatStyle::BAS_DontAlign); in enumeration()
222 IO.enumCase(Value, "AlwaysBreak", FormatStyle::BAS_AlwaysBreak); in enumeration()
225 IO.enumCase(Value, "true", FormatStyle::BAS_Align); in enumeration()
226 IO.enumCase(Value, "false", FormatStyle::BAS_DontAlign); in enumeration()
231 struct ScalarEnumerationTraits<FormatStyle::EscapedNewlineAlignmentStyle> {
233 FormatStyle::EscapedNewlineAlignmentStyle &Value) { in enumeration()
234 IO.enumCase(Value, "DontAlign", FormatStyle::ENAS_DontAlign); in enumeration()
235 IO.enumCase(Value, "Left", FormatStyle::ENAS_Left); in enumeration()
236 IO.enumCase(Value, "Right", FormatStyle::ENAS_Right); in enumeration()
239 IO.enumCase(Value, "true", FormatStyle::ENAS_Left); in enumeration()
240 IO.enumCase(Value, "false", FormatStyle::ENAS_Right); in enumeration()
244 template <> struct ScalarEnumerationTraits<FormatStyle::PointerAlignmentStyle> {
245 static void enumeration(IO &IO, FormatStyle::PointerAlignmentStyle &Value) { in enumeration()
246 IO.enumCase(Value, "Middle", FormatStyle::PAS_Middle); in enumeration()
247 IO.enumCase(Value, "Left", FormatStyle::PAS_Left); in enumeration()
248 IO.enumCase(Value, "Right", FormatStyle::PAS_Right); in enumeration()
251 IO.enumCase(Value, "true", FormatStyle::PAS_Left); in enumeration()
252 IO.enumCase(Value, "false", FormatStyle::PAS_Right); in enumeration()
257 struct ScalarEnumerationTraits<FormatStyle::SpaceBeforeParensOptions> {
259 FormatStyle::SpaceBeforeParensOptions &Value) { in enumeration()
260 IO.enumCase(Value, "Never", FormatStyle::SBPO_Never); in enumeration()
262 FormatStyle::SBPO_ControlStatements); in enumeration()
263 IO.enumCase(Value, "Always", FormatStyle::SBPO_Always); in enumeration()
266 IO.enumCase(Value, "false", FormatStyle::SBPO_Never); in enumeration()
267 IO.enumCase(Value, "true", FormatStyle::SBPO_ControlStatements); in enumeration()
271 template <> struct MappingTraits<FormatStyle> {
272 static void mapping(IO &IO, FormatStyle &Style) { in mapping()
282 FormatStyle PredefinedStyle; in mapping()
293 FormatStyle::LanguageKind OldLanguage = Style.Language; in mapping()
294 FormatStyle::LanguageKind Language = in mapping()
295 ((FormatStyle *)IO.getContext())->Language; in mapping()
343 if (Style.AlwaysBreakAfterDefinitionReturnType != FormatStyle::DRTBS_None && in mapping()
344 Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) { in mapping()
345 if (Style.AlwaysBreakAfterDefinitionReturnType == FormatStyle::DRTBS_All) in mapping()
346 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in mapping()
348 FormatStyle::DRTBS_TopLevel) in mapping()
350 FormatStyle::RTBS_TopLevelDefinitions; in mapping()
373 Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) in mapping()
374 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in mapping()
388 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeColon) in mapping()
389 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in mapping()
479 template <> struct MappingTraits<FormatStyle::BraceWrappingFlags> {
480 static void mapping(IO &IO, FormatStyle::BraceWrappingFlags &Wrapping) { in mapping()
499 template <> struct MappingTraits<FormatStyle::RawStringFormat> {
500 static void mapping(IO &IO, FormatStyle::RawStringFormat &Format) { in mapping()
514 template <> struct DocumentListTraits<std::vector<FormatStyle>> {
515 static size_t size(IO &IO, std::vector<FormatStyle> &Seq) { in size()
518 static FormatStyle &element(IO &IO, std::vector<FormatStyle> &Seq, in element()
522 FormatStyle Template; in element()
523 if (!Seq.empty() && Seq[0].Language == FormatStyle::LK_None) { in element()
526 Template = *((const FormatStyle *)IO.getContext()); in element()
527 Template.Language = FormatStyle::LK_None; in element()
569 static FormatStyle expandPresets(const FormatStyle &Style) { in expandPresets()
570 if (Style.BreakBeforeBraces == FormatStyle::BS_Custom) in expandPresets()
572 FormatStyle Expanded = Style; in expandPresets()
577 case FormatStyle::BS_Linux: in expandPresets()
582 case FormatStyle::BS_Mozilla: in expandPresets()
592 case FormatStyle::BS_Stroustrup: in expandPresets()
597 case FormatStyle::BS_Allman: in expandPresets()
609 case FormatStyle::BS_GNU: in expandPresets()
613 case FormatStyle::BS_WebKit: in expandPresets()
622 FormatStyle getLLVMStyle() { in getLLVMStyle()
623 FormatStyle LLVMStyle; in getLLVMStyle()
624 LLVMStyle.Language = FormatStyle::LK_Cpp; in getLLVMStyle()
626 LLVMStyle.AlignEscapedNewlines = FormatStyle::ENAS_Right; in getLLVMStyle()
627 LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; in getLLVMStyle()
633 LLVMStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All; in getLLVMStyle()
638 LLVMStyle.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; in getLLVMStyle()
639 LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getLLVMStyle()
641 LLVMStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_MultiLine; in getLLVMStyle()
644 LLVMStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_None; in getLLVMStyle()
646 LLVMStyle.BreakBeforeBraces = FormatStyle::BS_Attach; in getLLVMStyle()
651 LLVMStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon; in getLLVMStyle()
652 LLVMStyle.BreakInheritanceList = FormatStyle::BILS_BeforeColon; in getLLVMStyle()
674 LLVMStyle.IndentPPDirectives = FormatStyle::PPDIS_None; in getLLVMStyle()
677 LLVMStyle.JavaScriptQuotes = FormatStyle::JSQS_Leave; in getLLVMStyle()
682 LLVMStyle.NamespaceIndentation = FormatStyle::NI_None; in getLLVMStyle()
683 LLVMStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Auto; in getLLVMStyle()
687 LLVMStyle.PointerAlignment = FormatStyle::PAS_Right; in getLLVMStyle()
689 LLVMStyle.Standard = FormatStyle::LS_Cpp11; in getLLVMStyle()
690 LLVMStyle.UseTab = FormatStyle::UT_Never; in getLLVMStyle()
701 LLVMStyle.SpaceBeforeParens = FormatStyle::SBPO_ControlStatements; in getLLVMStyle()
725 FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { in getGoogleStyle()
726 if (Language == FormatStyle::LK_TextProto) { in getGoogleStyle()
727 FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto); in getGoogleStyle()
728 GoogleStyle.Language = FormatStyle::LK_TextProto; in getGoogleStyle()
733 FormatStyle GoogleStyle = getLLVMStyle(); in getGoogleStyle()
737 GoogleStyle.AlignEscapedNewlines = FormatStyle::ENAS_Left; in getGoogleStyle()
741 GoogleStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; in getGoogleStyle()
749 GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never; in getGoogleStyle()
752 GoogleStyle.PointerAlignment = FormatStyle::PAS_Left; in getGoogleStyle()
755 FormatStyle::LK_Cpp, in getGoogleStyle()
772 FormatStyle::LK_TextProto, in getGoogleStyle()
795 GoogleStyle.Standard = FormatStyle::LS_Auto; in getGoogleStyle()
800 if (Language == FormatStyle::LK_Java) { in getGoogleStyle()
801 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getGoogleStyle()
804 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
807 GoogleStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment; in getGoogleStyle()
811 } else if (Language == FormatStyle::LK_JavaScript) { in getGoogleStyle()
812 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak; in getGoogleStyle()
814 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
821 GoogleStyle.NamespaceIndentation = FormatStyle::NI_All; in getGoogleStyle()
823 GoogleStyle.JavaScriptQuotes = FormatStyle::JSQS_Single; in getGoogleStyle()
825 } else if (Language == FormatStyle::LK_Proto) { in getGoogleStyle()
826 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
836 } else if (Language == FormatStyle::LK_ObjC) { in getGoogleStyle()
844 FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) { in getChromiumStyle()
845 FormatStyle ChromiumStyle = getGoogleStyle(Language); in getChromiumStyle()
846 if (Language == FormatStyle::LK_Java) { in getChromiumStyle()
865 } else if (Language == FormatStyle::LK_JavaScript) { in getChromiumStyle()
870 ChromiumStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; in getChromiumStyle()
875 if (Language == FormatStyle::LK_ObjC) in getChromiumStyle()
881 FormatStyle getMozillaStyle() { in getMozillaStyle()
882 FormatStyle MozillaStyle = getLLVMStyle(); in getMozillaStyle()
884 MozillaStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; in getMozillaStyle()
885 MozillaStyle.AlwaysBreakAfterReturnType = FormatStyle::RTBS_TopLevel; in getMozillaStyle()
887 FormatStyle::DRTBS_TopLevel; in getMozillaStyle()
888 MozillaStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; in getMozillaStyle()
891 MozillaStyle.BreakBeforeBraces = FormatStyle::BS_Mozilla; in getMozillaStyle()
892 MozillaStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getMozillaStyle()
893 MozillaStyle.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in getMozillaStyle()
902 MozillaStyle.PointerAlignment = FormatStyle::PAS_Left; in getMozillaStyle()
907 FormatStyle getWebKitStyle() { in getWebKitStyle()
908 FormatStyle Style = getLLVMStyle(); in getWebKitStyle()
910 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getWebKitStyle()
913 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getWebKitStyle()
914 Style.BreakBeforeBraces = FormatStyle::BS_WebKit; in getWebKitStyle()
915 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getWebKitStyle()
920 Style.NamespaceIndentation = FormatStyle::NI_Inner; in getWebKitStyle()
923 Style.PointerAlignment = FormatStyle::PAS_Left; in getWebKitStyle()
928 FormatStyle getGNUStyle() { in getGNUStyle()
929 FormatStyle Style = getLLVMStyle(); in getGNUStyle()
930 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All; in getGNUStyle()
931 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in getGNUStyle()
932 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getGNUStyle()
933 Style.BreakBeforeBraces = FormatStyle::BS_GNU; in getGNUStyle()
938 Style.SpaceBeforeParens = FormatStyle::SBPO_Always; in getGNUStyle()
939 Style.Standard = FormatStyle::LS_Cpp03; in getGNUStyle()
943 FormatStyle getNoStyle() { in getNoStyle()
944 FormatStyle NoStyle = getLLVMStyle(); in getNoStyle()
951 bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language, in getPredefinedStyle()
952 FormatStyle *Style) { in getPredefinedStyle()
975 std::error_code parseConfiguration(StringRef Text, FormatStyle *Style) { in parseConfiguration()
977 FormatStyle::LanguageKind Language = Style->Language; in parseConfiguration()
978 assert(Language != FormatStyle::LK_None); in parseConfiguration()
982 std::vector<FormatStyle> Styles; in parseConfiguration()
995 if (Styles[i].Language == FormatStyle::LK_None && i != 0) in parseConfiguration()
1010 FormatStyle::FormatStyleSet StyleSet; in parseConfiguration()
1013 if (Styles[i].Language != FormatStyle::LK_None) in parseConfiguration()
1019 if (Styles.empty() || Styles[0].Language != FormatStyle::LK_None) in parseConfiguration()
1021 FormatStyle DefaultStyle = Styles[0]; in parseConfiguration()
1029 std::string configurationAsText(const FormatStyle &Style) { in configurationAsText()
1035 FormatStyle NonConstStyle = expandPresets(Style); in configurationAsText()
1040 llvm::Optional<FormatStyle>
1041 FormatStyle::FormatStyleSet::Get(FormatStyle::LanguageKind Language) const { in Get()
1047 FormatStyle Style = It->second; in Get()
1052 void FormatStyle::FormatStyleSet::Add(FormatStyle Style) { in Add()
1063 void FormatStyle::FormatStyleSet::Clear() { in Clear()
1067 llvm::Optional<FormatStyle>
1068 FormatStyle::GetLanguageStyle(FormatStyle::LanguageKind Language) const { in GetLanguageStyle()
1076 JavaScriptRequoter(const Environment &Env, const FormatStyle &Style) in JavaScriptRequoter()
1104 (Style.JavaScriptQuotes == FormatStyle::JSQS_Single && in requoteJSStringLiteral()
1106 (Style.JavaScriptQuotes == FormatStyle::JSQS_Double && in requoteJSStringLiteral()
1111 bool IsSingle = Style.JavaScriptQuotes == FormatStyle::JSQS_Single; in requoteJSStringLiteral()
1163 Formatter(const Environment &Env, const FormatStyle &Style, in Formatter()
1263 ? FormatStyle::PAS_Left in deriveLocalStyle()
1264 : FormatStyle::PAS_Right; in deriveLocalStyle()
1265 if (Style.Standard == FormatStyle::LS_Auto) in deriveLocalStyle()
1267 ? FormatStyle::LS_Cpp11 in deriveLocalStyle()
1268 : FormatStyle::LS_Cpp03; in deriveLocalStyle()
1281 Cleaner(const Environment &Env, const FormatStyle &Style) in Cleaner()
1499 ObjCHeaderStyleGuesser(const Environment &Env, const FormatStyle &Style) in ObjCHeaderStyleGuesser()
1506 assert(Style.Language == FormatStyle::LK_Cpp); in analyze()
1691 static void sortCppIncludes(const FormatStyle &Style, in sortCppIncludes()
1766 tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code, in sortCppIncludes()
1834 static unsigned findJavaImportGroup(const FormatStyle &Style, in findJavaImportGroup()
1854 static void sortJavaImports(const FormatStyle &Style, in sortJavaImports()
1923 tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code, in sortJavaImports()
1984 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, in sortIncludes()
1992 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && in sortIncludes()
1995 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript) in sortIncludes()
1997 if (Style.Language == FormatStyle::LanguageKind::LK_Java) in sortIncludes()
2007 const FormatStyle &Style) { in processReplacements()
2025 const FormatStyle &Style) { in formatReplacements()
2028 auto SortIncludes = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
2040 auto Reformat = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
2063 const FormatStyle &Style) { in fixCppIncludeInsertions()
2135 const FormatStyle &Style) { in cleanupAroundReplacements()
2138 auto Cleanup = [](const FormatStyle &Style, StringRef Code, in cleanupAroundReplacements()
2151 reformat(const FormatStyle &Style, StringRef Code, in reformat()
2155 FormatStyle Expanded = expandPresets(Style); in reformat()
2160 if (Expanded.Language == FormatStyle::LK_JavaScript && isMpegTS(Code)) in reformat()
2168 if (Style.Language == FormatStyle::LK_Cpp) { in reformat()
2180 if (Style.Language == FormatStyle::LK_JavaScript && in reformat()
2181 Style.JavaScriptQuotes != FormatStyle::JSQS_Leave) in reformat()
2217 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat()
2228 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code, in cleanup()
2232 if (Style.Language != FormatStyle::LK_Cpp) in cleanup()
2237 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat()
2247 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style, in fixNamespaceEndComments()
2256 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, in sortUsingDeclarations()
2265 LangOptions getFormattingLangOpts(const FormatStyle &Style) { in getFormattingLangOpts()
2268 LangOpts.CPlusPlus11 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1; in getFormattingLangOpts()
2269 LangOpts.CPlusPlus14 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1; in getFormattingLangOpts()
2270 LangOpts.CPlusPlus17 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1; in getFormattingLangOpts()
2271 LangOpts.CPlusPlus2a = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1; in getFormattingLangOpts()
2293 static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) { in getLanguageByFileName()
2295 return FormatStyle::LK_Java; in getLanguageByFileName()
2297 return FormatStyle::LK_JavaScript; // JavaScript or TypeScript. in getLanguageByFileName()
2299 return FormatStyle::LK_ObjC; in getLanguageByFileName()
2302 return FormatStyle::LK_Proto; in getLanguageByFileName()
2307 return FormatStyle::LK_TextProto; in getLanguageByFileName()
2309 return FormatStyle::LK_TableGen; in getLanguageByFileName()
2310 return FormatStyle::LK_Cpp; in getLanguageByFileName()
2313 FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code) { in guessLanguage()
2315 if (GuessedLanguage == FormatStyle::LK_Cpp) { in guessLanguage()
2325 return FormatStyle::LK_ObjC; in guessLanguage()
2335 llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName, in getStyle()
2342 FormatStyle Style = getLLVMStyle(); in getStyle()
2345 FormatStyle FallbackStyle = getNoStyle(); in getStyle()