Home | History | Annotate | Download | only in Format

Lines Matching refs:Style

30 static bool shouldIndentWrappedSelectorName(const FormatStyle &Style,
32 return Style.IndentWrappedFunctionNames || LineType == LT_ObjCMethodDecl;
121 const FormatStyle &Style) {
124 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma)
126 if (Style.Language == FormatStyle::LK_Proto && Current.is(TT_SelectorName))
130 Style.BreakConstructorInitializers !=
133 Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
137 const FormatStyle &Style) {
140 return Style.Language == FormatStyle::LK_TextProto ||
141 (Style.Language == FormatStyle::LK_Proto &&
174 getCanonicalRawStringDelimiter(const FormatStyle &Style,
176 for (const auto &Format : Style.RawStringFormats) {
224 ContinuationIndenter::ContinuationIndenter(const FormatStyle &Style,
230 : Style(Style), Keywords(Keywords), SourceMgr(SourceMgr),
233 CommentPragmasRegex(Style.CommentPragmas), RawStringFormats(Style) {}
248 if (Style.IndentPPDirectives == FormatStyle::PPDIS_AfterHash &&
264 if (Style.Language == FormatStyle::LK_TextProto) {
282 Current.closesBlockOrBlockTypeList(Style)))
313 if (Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None)
332 if (Style.BraceWrapping.BeforeLambdaBody && Current.CanBreakBefore &&
340 Current.closesBlockOrBlockTypeList(Style))
344 if (Style.Language == FormatStyle::LK_ObjC &&
345 Style.ObjCBreakBeforeNestedBlockParam &&
355 if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) ||
357 Style.isCpp() &&
362 (Previous.NestingLevel == 1 || Style.BinPackParameters)) ||
363 (Style.BreakBeforeTernaryOperators && Current.is(TT_ConditionalExpr) &&
365 (!Style.BreakBeforeTernaryOperators &&
371 ((Style.BreakBeforeTernaryOperators && Current.is(TT_ConditionalExpr) &&
373 (!Style.BreakBeforeTernaryOperators && Previous.is(TT_ConditionalExpr) &&
379 opensProtoMessageField(Previous, Style)) &&
380 Style.ColumnLimit > 0 &&
386 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon
393 (Style.AllowShortFunctionsOnASingleLine != FormatStyle::SFS_All ||
394 Style.BreakConstructorInitializers != FormatStyle::BCIS_BeforeColon ||
395 Style.ColumnLimit != 0))
404 (Style.ObjCBreakBeforeNestedBlockParam ||
409 if (Current.isMemberAccess() && Style.ColumnLimit != 0 &&
410 State.Column + getLengthToNextOperator(Current) > Style.ColumnLimit &&
424 Style.Language == FormatStyle::LK_JavaScript) &&
437 if (Style.AlwaysBreakBeforeMultilineStrings &&
438 (NewLineColumn == State.FirstIndent + Style.ContinuationIndentWidth ||
447 // current style uses wrapping before or after operators for the given
486 return Style.AlwaysBreakTemplateDeclarations != FormatStyle::BTDS_No;
497 (!Style.isCSharp() ||
498 Style.AlwaysBreakAfterReturnType != FormatStyle::RTBS_None)) ||
506 if (Style.ColumnLimit != 0 && Previous.is(BK_Block) &&
586 if (Style.IndentPPDirectives == FormatStyle::PPDIS_AfterHash &&
596 if (Style.UseTab != FormatStyle::UT_Never)
606 if (Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma &&
609 if (Style.BreakInheritanceList == FormatStyle::BILS_AfterColon &&
616 std::max(State.FirstIndent + Style.ContinuationIndentWidth,
630 if (Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak &&
633 Style.Cpp11BracedListStyle)) &&
650 if (Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign &&
657 if (State.Stack.back().AvoidBinPacking && startsNextParameter(Current, Style))
663 if (Current.is(TT_LambdaArrow) && Style.Language == FormatStyle::LK_Java)
691 Style.BreakBeforeBinaryOperators != FormatStyle::BOS_None) ||
692 (P->is(TT_ConditionalExpr) && Style.BreakBeforeTernaryOperators);
700 Style.AlignOperands != FormatStyle::OAS_DontAlign)) ||
719 Style.BreakConstructorInitializers ==
732 if (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None)
782 (State.Column <= Style.ColumnLimit / 3 ||
784 Penalty += Style.PenaltyBreakFirstLessLess;
802 Style.PenaltyIndentedWhitespace * (State.Column - State.FirstIndent);
815 (Style.Language != FormatStyle::LK_JavaScript ||
830 (shouldIndentWrappedSelectorName(Style, State.Line->Type)
832 State.FirstIndent + Style.ContinuationIndentWidth)
855 Style.ContinuationIndentWidth;
874 unsigned MaxEmptyLinesToKeep = Style.MaxEmptyLinesToKeep + 1;
907 (!Style.isCpp() && Current.is(tok::r_brace) && State.Stack.size() > 1 &&
909 (Style.Language == FormatStyle::LK_ObjC && Current.is(tok::r_brace) &&
910 State.Stack.size() > 1 && !Style.ObjCBreakBeforeNestedBlockParam);
929 opensProtoMessageField(*PreviousNonComment, Style)))
939 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon;
942 (!Style.AllowAllParametersOfDeclarationOnNextLine &&
944 (!Style.AllowAllArgumentsOnNextLine &&
946 (!Style.AllowAllConstructorInitializersOnNextLine &&
955 Style.AllowAllConstructorInitializersOnNextLine)
976 Style.ContinuationIndentWidth;
983 if (Style.Language == FormatStyle::LK_Java &&
986 State.Stack.back().Indent + Style.ContinuationIndentWidth);
988 if (Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths &&
990 return (Style.IndentWidth * State.Line->First->IndentLevel) +
991 Style.IndentWidth;
998 (Style.Language == FormatStyle::LK_Proto ||
999 Style.Language == FormatStyle::LK_TextProto))) &&
1001 if (Current.closesBlockOrBlockTypeList(Style))
1030 ((Style.Language == FormatStyle::LK_Proto ||
1031 Style.Language == FormatStyle::LK_TextProto) &&
1062 if (Style.AlignOperands != FormatStyle::OAS_DontAlign) {
1063 Indent -= Style.ContinuationIndentWidth;
1065 if (Style.BreakBeforeTernaryOperators &&
1079 (!Style.IndentWrappedFunctionNames &&
1085 if (shouldIndentWrappedSelectorName(Style, State.Line->Type))
1087 Style.ContinuationIndentWidth);
1096 // In either case, we want to respect Style.IndentWrappedFunctionNames.
1113 else if (Style.isCSharp()) // C# allows `["key"] = value` inside object
1134 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon)
1137 Style.BreakInheritanceList == FormatStyle::BILS_AfterColon)
1141 return State.FirstIndent + Style.ConstructorInitializerIndentWidth;
1158 return State.Stack.back().Indent + Style.ContinuationIndentWidth;
1164 const FormatStyle &Style) {
1171 return (Style.BraceWrapping.BeforeLambdaBody && Current.is(TT_LambdaLSquare));
1204 if (Style.BreakBeforeTernaryOperators && Current.is(tok::question))
1206 if (!Style.BreakBeforeTernaryOperators && Current.isNot(tok::colon)) {
1223 Style.BreakConstructorInitializers != FormatStyle::BCIS_AfterColon) {
1231 (Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma
1235 if (Style.ConstructorInitializerAllOnOneLineOrOnePerLine) {
1238 !Style.AllowAllConstructorInitializersOnNextLine;
1244 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon) {
1246 State.FirstIndent + Style.ConstructorInitializerIndentWidth;
1248 if (Style.ConstructorInitializerAllOnOneLineOrOnePerLine)
1253 State.FirstIndent + Style.ConstructorInitializerIndentWidth;
1283 !Newline && hasNestedBlockInlined(Previous, Current, Style);
1334 Style.AlignOperands != FormatStyle::OAS_DontAlign) ||
1358 (Style.AlignOperands != FormatStyle::OAS_DontAlign ||
1361 (Style.Language != FormatStyle::LK_Java && *I > 0)) &&
1362 (Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign ||
1377 if (Style.AlignOperands == FormatStyle::OAS_AlignAfterOperator)
1380 if (Style.AlignOperands != FormatStyle::OAS_DontAlign)
1393 Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign)
1409 NewParenState.Indent += Style.ContinuationIndentWidth;
1453 opensProtoMessageField(Current, Style)) {
1454 if (Current.opensBlockOrBlockTypeList(Style)) {
1455 NewIndent = Style.IndentWidth +
1458 NewIndent = State.Stack.back().LastSpace + Style.ContinuationIndentWidth;
1465 Style.Language == FormatStyle::LK_Proto ||
1466 Style.Language == FormatStyle::LK_TextProto ||
1467 !Style.BinPackArguments ||
1475 NewIndent = Style.ContinuationIndentWidth +
1496 (Style.ObjCBinPackProtocolList == FormatStyle::BPS_Auto &&
1497 Style.BinPackParameters) ||
1498 Style.ObjCBinPackProtocolList == FormatStyle::BPS_Always;
1501 (State.Line->Type != LT_ObjCDecl && Style.BinPackParameters) ||
1506 (Style.Language == FormatStyle::LK_JavaScript && EndsInComma) ||
1508 (!State.Line->MustBeDeclaration && !Style.BinPackArguments) ||
1509 (Style.ExperimentalAutoDetectBinPacking &&
1514 Style.ObjCBreakBeforeNestedBlockParam) {
1515 if (Style.ColumnLimit) {
1535 if (Style.Language == FormatStyle::LK_JavaScript && EndsInComma)
1555 if (Style.BraceWrapping.BeforeLambdaBody && Current.Next != nullptr &&
1606 Style.ColumnLimit)
1624 ? Style.ObjCBlockIndentWidth
1625 : Style.IndentWidth);
1653 getCanonicalRawStringDelimiter(Style, RawStringStyle.Language);
1714 ? CurrentIndent + Style.IndentWidth
1777 *NewCode, FirstStartColumn, Style.TabWidth, Encoding);
1783 StartColumn + NewPrefixSize > Style.ColumnLimit
1784 ? StartColumn + NewPrefixSize - Style.ColumnLimit
1793 return Fixes.second + PrefixExcessCharacters * Style.PenaltyExcessCharacter;
1808 return Style.PenaltyExcessCharacter * (ColumnsUsed - getColumnLimit(State));
1816 // Compute the raw string style to use in case this is a raw string literal
1861 Penalty += Style.PenaltyExcessCharacter * ExcessCharacters;
1912 if (Style.Language == FormatStyle::LK_Java ||
1913 Style.Language == FormatStyle::LK_JavaScript || Style.isCSharp() ||
1914 !Style.BreakStringLiterals || !AllowBreak)
1956 State.Line->InPPDirective, Encoding, Style);
1959 if (!Style.ReflowComments ||
1968 State.Line->InPPDirective, Encoding, Style, Whitespaces.useCRLF());
1972 if (!Style.ReflowComments ||
1977 Current, StartColumn, /*InPPDirective=*/false, Encoding, Style);
1994 ColumnLimit = Style.ColumnLimit;
2007 ? Style.PenaltyBreakString
2008 : Style.PenaltyBreakComment;
2067 Penalty += Style.PenaltyExcessCharacter *
2130 Style.PenaltyExcessCharacter;
2270 Style.PenaltyExcessCharacter;
2324 Penalty += Style.PenaltyExcessCharacter *
2363 return Style.ColumnLimit - (State.Line->InPPDirective ? 2 : 0);
2380 if (Style.ColumnLimit != 0 && Style.BreakStringLiterals &&
2382 Style.ColumnLimit)