clang 22.0.0git
clang::format Namespace Reference

Namespaces

namespace  encoding
namespace  internal

Classes

class  AffectedRangeManager
class  AnnotatedLine
class  BreakableBlockComment
class  BreakableComment
class  BreakableLineCommentSection
class  BreakableStringLiteral
class  BreakableStringLiteralUsingOperators
class  BreakableToken
 Base class for tokens / ranges of tokens that can allow breaking within the tokens - for example, to avoid whitespace beyond the column limit, or to reflow text. More...
class  CompoundStatementIndenter
class  ContinuationIndenter
class  DefinitionBlockSeparator
class  Environment
class  FatalDiagnosticConsumer
struct  FormatToken
 A wrapper around a Token storing information about the whitespace characters preceding it. More...
class  FormatTokenLexer
class  FormatTokenSource
class  IndexedTokenSource
class  IntegerLiteralSeparatorFixer
class  JavaScriptImportSorter
struct  JsImportedSymbol
struct  JsModuleReference
class  LeftRightQualifierAlignmentFixer
struct  LineState
 The current state when indenting a unwrapped line. More...
class  MacroCallReconstructor
 Converts a sequence of UnwrappedLines containing expanded macros into a single UnwrappedLine containing the macro calls. More...
class  MacroExpander
 Takes a set of macro definitions as strings and allows expanding calls to those macros. More...
struct  MacroExpansion
 Contains information on the token's role in a macro expansion. More...
class  NamespaceEndCommentsFixer
class  NumericLiteralCaseFixer
struct  NumericLiteralInfo
class  ObjCPropertyAttributeOrderFixer
struct  ObjCPropertyEntry
struct  ParenState
class  ParseErrorCategory
struct  RawStringFormatStyleManager
class  ScopedLineState
class  ScopedMacroState
class  TokenAnalyzer
class  TokenAnnotator
 Determines extra information about the tokens comprising an UnwrappedLine. More...
struct  UnwrappedLine
 An unwrapped line is a sequence of Token, that we would like to put on a single line if there was no column limit. More...
class  UnwrappedLineConsumer
 Interface for users of the UnwrappedLineParser to receive the parsed lines. More...
class  UnwrappedLineFormatter
struct  UnwrappedLineNode
class  UnwrappedLineParser
class  UsingDeclarationsSorter
class  WhitespaceManager
 Manages the whitespaces around tokens and their replacements. More...

Typedefs

typedef std::function< std::pair< tooling::Replacements, unsigned >(const Environment &)> AnalyzerPass

Enumerations

enum class  ParseError {
  Success = 0 , Error , Unsuitable , BinPackTrailingCommaConflict ,
  InvalidQualifierSpecified , DuplicateQualifierSpecified , MissingQualifierType , MissingQualifierOrder
}
enum  TokenType : uint8_t { NUM_TOKEN_TYPES }
 Determines the semantic type of a syntactic token, e.g. More...
enum  BraceBlockKind { BK_Unknown , BK_Block , BK_BracedInit }
enum  ParameterPackingKind { PPK_BinPacked , PPK_OnePerLine , PPK_Inconclusive }
enum  FormatDecision { FD_Unformatted , FD_Continue , FD_Break }
enum  MacroRole { MR_ExpandedArg , MR_UnexpandedArg , MR_Hidden }
 Roles a token can take in a configured macro expansion. More...
enum  LexerState { NORMAL , TEMPLATE_STRING , TOKEN_STASHED }
enum class  Base { Binary , Decimal , Hex , Other }
enum  LineType {
  LT_Invalid , LT_AccessModifier , LT_ImportStatement , LT_ObjCDecl ,
  LT_ObjCMethodDecl , LT_ObjCProperty , LT_Other , LT_PreprocessorDirective ,
  LT_VirtualFunctionDecl , LT_ArrayOfStructInitializer , LT_CommentAbovePPDirective , LT_RequiresExpression ,
  LT_SimpleRequirement
}
enum  ScopeType { ST_Class , ST_CompoundRequirement , ST_Other }

Functions

const std::error_category & getParseCategory ()
std::error_code make_error_code (ParseError e)
static constexpr StringRef Blanks (" \t\v\f\r")
static StringRef getLineCommentIndentPrefix (StringRef Comment, const FormatStyle &Style)
static BreakableToken::Split getCommentSplit (StringRef Text, unsigned ContentStartColumn, unsigned ColumnLimit, unsigned TabWidth, encoding::Encoding Encoding, const FormatStyle &Style, bool DecorationEndsWithStar=false)
static BreakableToken::Split getStringSplit (StringRef Text, unsigned UsedColumns, unsigned ColumnLimit, unsigned TabWidth, encoding::Encoding Encoding)
bool switchesFormatting (const FormatToken &Token)
 Checks if Token switches formatting, like /* clang-format off *‍/.
static bool mayReflowContent (StringRef Content)
static bool shouldIndentWrappedSelectorName (const FormatStyle &Style, LineType LineType)
static bool shouldUnindentNextOperator (const FormatToken &Tok)
static unsigned getLengthToMatchingParen (const FormatToken &Tok, ArrayRef< ParenState > Stack)
static unsigned getLengthToNextOperator (const FormatToken &Tok)
static bool startsSegmentOfBuilderTypeCall (const FormatToken &Tok)
static bool isAlignableBinaryOperator (const FormatToken &Token)
static bool startsNextOperand (const FormatToken &Current)
static bool mustBreakBinaryOperation (const FormatToken &Current, const FormatStyle &Style)
static bool opensProtoMessageField (const FormatToken &LessTok, const FormatStyle &Style)
static std::optional< StringRef > getRawStringDelimiter (StringRef TokenText)
static StringRef getCanonicalRawStringDelimiter (const FormatStyle &Style, FormatStyle::LanguageKind Language)
static bool hasNestedBlockInlined (const FormatToken *Previous, const FormatToken &Current, const FormatStyle &Style)
static unsigned getLastLineEndColumn (StringRef Text, unsigned StartColumn, unsigned TabWidth, encoding::Encoding Encoding)
static StringRef getEnclosingFunctionName (const FormatToken &Current)
llvm::Error make_string_error (const Twine &Message)
static void expandPresetsBraceWrapping (FormatStyle &Expanded)
static void expandPresetsSpaceBeforeParens (FormatStyle &Expanded)
static void expandPresetsSpacesInParens (FormatStyle &Expanded)
FormatStyle getLLVMStyle (FormatStyle::LanguageKind Language)
FormatStyle getGoogleStyle (FormatStyle::LanguageKind Language)
FormatStyle getChromiumStyle (FormatStyle::LanguageKind Language)
FormatStyle getMozillaStyle ()
FormatStyle getWebKitStyle ()
FormatStyle getGNUStyle ()
FormatStyle getMicrosoftStyle (FormatStyle::LanguageKind Language)
FormatStyle getClangFormatStyle ()
FormatStyle getNoStyle ()
bool getPredefinedStyle (StringRef Name, FormatStyle::LanguageKind Language, FormatStyle *Style)
ParseError validateQualifierOrder (FormatStyle *Style)
std::error_code parseConfiguration (llvm::MemoryBufferRef Config, FormatStyle *Style, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler, void *DiagHandlerCtxt, bool IsDotHFile)
std::string configurationAsText (const FormatStyle &Style)
static bool affectsRange (ArrayRef< tooling::Range > Ranges, unsigned Start, unsigned End)
static std::pair< unsigned, unsignedFindCursorIndex (const ArrayRef< IncludeDirective > &Includes, const ArrayRef< unsigned > &Indices, unsigned Cursor)
std::string replaceCRLF (const std::string &Code)
static void sortCppIncludes (const FormatStyle &Style, const ArrayRef< IncludeDirective > &Includes, ArrayRef< tooling::Range > Ranges, StringRef FileName, StringRef Code, tooling::Replacements &Replaces, unsigned *Cursor)
tooling::Replacements sortCppIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces, unsigned *Cursor)
static unsigned findJavaImportGroup (const FormatStyle &Style, StringRef ImportIdentifier)
static void sortJavaImports (const FormatStyle &Style, const ArrayRef< JavaImportDirective > &Imports, ArrayRef< tooling::Range > Ranges, StringRef FileName, StringRef Code, tooling::Replacements &Replaces)
tooling::Replacements sortJavaImports (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces)
bool isMpegTS (StringRef Code)
bool isLikelyXml (StringRef Code)
tooling::Replacements sortIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, unsigned *Cursor)
template<typename T>
static Expected< tooling::ReplacementsprocessReplacements (T ProcessFunc, StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style)
Expected< tooling::ReplacementsformatReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style)
Expected< tooling::ReplacementscleanupAroundReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style)
tooling::Replacements reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, FormattingAttemptStatus *Status)
tooling::Replacements cleanup (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName)
tooling::Replacements reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, bool *IncompleteFormat)
tooling::Replacements fixNamespaceEndComments (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName)
tooling::Replacements sortUsingDeclarations (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName)
LangOptions getFormattingLangOpts (const FormatStyle &Style)
static FormatStyle::LanguageKind getLanguageByFileName (StringRef FileName)
static FormatStyle::LanguageKind getLanguageByComment (const Environment &Env)
FormatStyle::LanguageKind guessLanguage (StringRef FileName, StringRef Code)
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > loadAndParseConfigFile (StringRef ConfigFile, llvm::vfs::FileSystem *FS, FormatStyle *Style, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler, bool IsDotHFile)
Expected< FormatStyle > getStyle (StringRef StyleName, StringRef FileName, StringRef FallbackStyleName, StringRef Code, llvm::vfs::FileSystem *FS, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler)
static bool isClangFormatOnOff (StringRef Comment, bool On)
bool isClangFormatOn (StringRef Comment)
bool isClangFormatOff (StringRef Comment)
const char * getTokenTypeName (TokenType Type)
 Determines the name of a token type.
static unsigned CodePointsBetween (const FormatToken *Begin, const FormatToken *End)
bool startsNextParameter (const FormatToken &Current, const FormatStyle &Style)
struct clang::format::FormatToken getPreviousNonComment () const
 Returns the previous token ignoring comments.
FormatTokengetNextNonComment () const
 Returns the next token ignoring comments.
bool isBlockIndentedInitRBrace (const FormatStyle &Style) const
 Returns true if this token ends a block indented initializer list.
bool opensBlockOrBlockTypeList (const FormatStyle &Style) const
 Returns true if this tokens starts a block-type list, i.e. a list that should be indented with a block indent.
bool isCppStructuredBinding (bool IsCpp) const
 Returns whether the token is the left square bracket of a C++ structured binding declaration.
bool closesBlockOrBlockTypeList (const FormatStyle &Style) const
 Same as opensBlockOrBlockTypeList, but for the closing token.
const FormatTokengetNamespaceToken () const
 Return the actual namespace token, if this token starts a namespace block.
void copyFrom (const FormatToken &Tok)
static auto lexCSharpString (const char *Begin, const char *End, bool Verbatim, bool Interpolated)
static size_t countLeadingWhitespace (StringRef Text)
 Count the length of leading whitespace in a token.
static Base getBase (StringRef IntegerLiteral)
template<typename T>
void forEachToken (const UnwrappedLine &Line, const T &Call, FormatToken *Parent=nullptr)
bool matchFilePath (StringRef Pattern, StringRef FilePath)
bool matchFilePath (llvm::StringRef Pattern, llvm::StringRef FilePath)
const FormatTokengetNamespaceToken (const AnnotatedLine *Line, const SmallVectorImpl< AnnotatedLine * > &AnnotatedLines)
StringRef getNamespaceTokenText (const AnnotatedLine *Line, const SmallVectorImpl< AnnotatedLine * > &AnnotatedLines)
static bool isNumericLiteralCaseFixerNeeded (const FormatStyle &Style)
static std::string transformComponent (StringRef Component, FormatStyle::NumericLiteralComponentStyle ConfigValue)
static bool matchesReservedSuffix (StringRef Suffix)
 Test if Suffix matches a C++ literal reserved by the library.
static std::string format (StringRef NumericLiteral, const FormatStyle &Style)
void addQualifierAlignmentFixerPasses (const FormatStyle &Style, SmallVectorImpl< AnalyzerPass > &Passes)
static void replaceToken (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const CharSourceRange &Range, std::string NewText)
static void removeToken (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First)
static void insertQualifierAfter (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First, const std::string &Qualifier)
static void insertQualifierBefore (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First, const std::string &Qualifier)
static bool endsWithSpace (const std::string &s)
static bool startsWithSpace (const std::string &s)
static void rotateTokens (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First, const FormatToken *Last, bool Left)
static bool isConfiguredQualifier (const FormatToken *const Tok, const std::vector< tok::TokenKind > &Qualifiers)
static bool isQualifier (const FormatToken *const Tok)
void prepareLeftRightOrderingForQualifierAlignmentFixer (const std::vector< std::string > &Order, std::vector< std::string > &LeftOrder, std::vector< std::string > &RightOrder, std::vector< tok::TokenKind > &Qualifiers)
bool isQualifierOrType (const FormatToken *Tok, const LangOptions &LangOpts)
bool isConfiguredQualifierOrType (const FormatToken *Tok, const std::vector< tok::TokenKind > &Qualifiers, const LangOptions &LangOpts)
bool isPossibleMacro (const FormatToken *Tok)
bool operator< (const JsModuleReference &LHS, const JsModuleReference &RHS)
tooling::Replacements sortJavaScriptImports (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName)
static bool mustBreakAfterAttributes (const FormatToken &Tok, const FormatStyle &Style)
static unsigned maxNestingDepth (const AnnotatedLine &Line)
static FormatTokengetFunctionName (const AnnotatedLine &Line, FormatToken *&OpeningParen)
static bool isCtorOrDtorName (const FormatToken *Tok)
static bool isFunctionDeclarationName (const LangOptions &LangOpts, const FormatToken &Current, const AnnotatedLine &Line, FormatToken *&ClosingParen)
static bool isAllmanBrace (const FormatToken &Tok)
static bool IsFunctionArgument (const FormatToken &Tok)
static bool isEmptyLambdaAllowed (const FormatToken &Tok, FormatStyle::ShortLambdaStyle ShortLambdaOption)
static bool isAllmanLambdaBrace (const FormatToken &Tok)
static auto computeNewlines (const AnnotatedLine &Line, const AnnotatedLine *PreviousLine, const AnnotatedLine *PrevPrevLine, const SmallVectorImpl< AnnotatedLine * > &Lines, const FormatStyle &Style)
std::ostream & operator<< (std::ostream &Stream, const UnwrappedLine &Line)
template<class T>
static void hash_combine (std::size_t &seed, const T &v)
static bool isGoogScope (const UnwrappedLine &Line)
static bool isIIFE (const UnwrappedLine &Line, const AdditionalKeywords &Keywords)
static bool ShouldBreakBeforeBrace (const FormatStyle &Style, const FormatToken &InitialToken)
static bool tokenCanStartNewLine (const FormatToken &Tok)
static bool mustBeJSIdent (const AdditionalKeywords &Keywords, const FormatToken *FormatTok)
static bool mustBeJSIdentOrValue (const AdditionalKeywords &Keywords, const FormatToken *FormatTok)
static bool isJSDeclOrStmt (const AdditionalKeywords &Keywords, const FormatToken *FormatTok)
static bool isC78Type (const FormatToken &Tok)
static bool isC78ParameterDecl (const FormatToken *Tok, const FormatToken *Next, const FormatToken *FuncName)
static FormatTokengetLastNonComment (const UnwrappedLine &Line)
static void markOptionalBraces (FormatToken *LeftBrace)
static bool continuesLineCommentSection (const FormatToken &FormatTok, const UnwrappedLine &Line, const FormatStyle &Style, const llvm::Regex &CommentPragmasRegex)
template<typename F>
static void AlignTokenSequence (const FormatStyle &Style, unsigned Start, unsigned End, unsigned Column, bool RightJustify, F &&Matches, SmallVector< WhitespaceManager::Change, 16 > &Changes)
template<typename F>
static unsigned AlignTokens (const FormatStyle &Style, F &&Matches, SmallVector< WhitespaceManager::Change, 16 > &Changes, unsigned StartAt, const FormatStyle::AlignConsecutiveStyle &ACS={}, bool RightJustify=false)
static void AlignMatchingTokenSequence (unsigned &StartOfSequence, unsigned &EndOfSequence, unsigned &MinColumn, std::function< bool(const WhitespaceManager::Change &C)> Matches, SmallVector< WhitespaceManager::Change, 16 > &Changes)

Variables

const char * StyleOptionHelpDescription
const char * DefaultFormatStyle = "file"
const char * DefaultFallbackStyle = "LLVM"
static SmallVector< StringRef > CppNonKeywordTypes

Typedef Documentation

◆ AnalyzerPass

Enumeration Type Documentation

◆ Base

enum class clang::format::Base
strong
Enumerator
Binary 
Decimal 
Hex 
Other 

Definition at line 20 of file IntegerLiteralSeparatorFixer.cpp.

◆ BraceBlockKind

Enumerator
BK_Unknown 
BK_Block 
BK_BracedInit 

Definition at line 226 of file FormatToken.h.

◆ FormatDecision

Enumerator
FD_Unformatted 
FD_Continue 
FD_Break 

Definition at line 231 of file FormatToken.h.

◆ LexerState

Enumerator
NORMAL 
TEMPLATE_STRING 
TOKEN_STASHED 

Definition at line 29 of file FormatTokenLexer.h.

◆ LineType

Enumerator
LT_Invalid 
LT_AccessModifier 
LT_ImportStatement 
LT_ObjCDecl 
LT_ObjCMethodDecl 
LT_ObjCProperty 
LT_Other 
LT_PreprocessorDirective 
LT_VirtualFunctionDecl 
LT_ArrayOfStructInitializer 
LT_CommentAbovePPDirective 
LT_RequiresExpression 
LT_SimpleRequirement 

Definition at line 23 of file TokenAnnotator.h.

◆ MacroRole

Roles a token can take in a configured macro expansion.

Enumerator
MR_ExpandedArg 

The token was expanded from a macro argument when formatting the expanded token sequence.

MR_UnexpandedArg 

The token is part of a macro argument that was previously formatted as expansion when formatting the unexpanded macro call.

MR_Hidden 

The token was expanded from a macro definition, and is not visible as part of the macro call.

Definition at line 234 of file FormatToken.h.

◆ ParameterPackingKind

Enumerator
PPK_BinPacked 
PPK_OnePerLine 
PPK_Inconclusive 

Definition at line 229 of file FormatToken.h.

◆ ParseError

enum class clang::format::ParseError
strong
Enumerator
Success 
Error 
Unsuitable 
BinPackTrailingCommaConflict 
InvalidQualifierSpecified 
DuplicateQualifierSpecified 
MissingQualifierType 
MissingQualifierOrder 

Definition at line 35 of file Format.h.

◆ ScopeType

Enumerator
ST_Class 
ST_CompoundRequirement 
ST_Other 

Definition at line 40 of file TokenAnnotator.h.

◆ TokenType

enum clang::format::TokenType : uint8_t

Determines the semantic type of a syntactic token, e.g.

whether "<" is a template opener or binary operator.

Enumerator
NUM_TOKEN_TYPES 

Definition at line 215 of file FormatToken.h.

Function Documentation

◆ addQualifierAlignmentFixerPasses()

void clang::format::addQualifierAlignmentFixerPasses ( const FormatStyle & Style,
SmallVectorImpl< AnalyzerPass > & Passes )

◆ affectsRange()

bool clang::format::affectsRange ( ArrayRef< tooling::Range > Ranges,
unsigned Start,
unsigned End )
static

Definition at line 3221 of file Format.cpp.

Referenced by sortCppIncludes(), and sortJavaImports().

◆ AlignMatchingTokenSequence()

void clang::format::AlignMatchingTokenSequence ( unsigned & StartOfSequence,
unsigned & EndOfSequence,
unsigned & MinColumn,
std::function< bool(const WhitespaceManager::Change &C)> Matches,
SmallVector< WhitespaceManager::Change, 16 > & Changes )
static

Definition at line 701 of file WhitespaceManager.cpp.

References clang::C, std::function, and NewlinesBefore.

◆ AlignTokens()

template<typename F>
unsigned clang::format::AlignTokens ( const FormatStyle & Style,
F && Matches,
SmallVector< WhitespaceManager::Change, 16 > & Changes,
unsigned StartAt,
const FormatStyle::AlignConsecutiveStyle & ACS = {},
bool RightJustify = false )
static

Definition at line 528 of file WhitespaceManager.cpp.

◆ AlignTokenSequence()

template<typename F>
void clang::format::AlignTokenSequence ( const FormatStyle & Style,
unsigned Start,
unsigned End,
unsigned Column,
bool RightJustify,
F && Matches,
SmallVector< WhitespaceManager::Change, 16 > & Changes )
static

Definition at line 287 of file WhitespaceManager.cpp.

References BK_BracedInit, clang::Column, NewlinesBefore, Previous, and Tok.

◆ Blanks()

◆ cleanup()

tooling::Replacements clang::format::cleanup ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName )

Definition at line 4065 of file Format.cpp.

References clang::FileName, and clang::format::Environment::make().

Referenced by cleanupAroundReplacements().

◆ cleanupAroundReplacements()

Expected< tooling::Replacements > clang::format::cleanupAroundReplacements ( StringRef Code,
const tooling::Replacements & Replaces,
const FormatStyle & Style )

Definition at line 3838 of file Format.cpp.

References cleanup(), clang::FileName, and processReplacements().

Referenced by clang::tooling::applyAtomicChanges().

◆ closesBlockOrBlockTypeList()

bool clang::format::closesBlockOrBlockTypeList ( const FormatStyle & Style) const

Same as opensBlockOrBlockTypeList, but for the closing token.

Definition at line 870 of file FormatToken.h.

◆ CodePointsBetween()

unsigned clang::format::CodePointsBetween ( const FormatToken * Begin,
const FormatToken * End )
static

◆ computeNewlines()

◆ configurationAsText()

std::string clang::format::configurationAsText ( const FormatStyle & Style)

◆ continuesLineCommentSection()

bool clang::format::continuesLineCommentSection ( const FormatToken & FormatTok,
const UnwrappedLine & Line,
const FormatStyle & Style,
const llvm::Regex & CommentPragmasRegex )
static

◆ copyFrom()

void clang::format::copyFrom ( const FormatToken & Tok)

Definition at line 891 of file FormatToken.h.

◆ countLeadingWhitespace()

size_t clang::format::countLeadingWhitespace ( StringRef Text)
static

Count the length of leading whitespace in a token.

Definition at line 1199 of file FormatTokenLexer.cpp.

References clang::isHorizontalWhitespace(), clang::isVerticalWhitespace(), clang::isWhitespace(), and clang::Text.

◆ endsWithSpace()

bool clang::format::endsWithSpace ( const std::string & s)
static

Definition at line 100 of file QualifierAlignmentFixer.cpp.

References s.

Referenced by rotateTokens().

◆ expandPresetsBraceWrapping()

void clang::format::expandPresetsBraceWrapping ( FormatStyle & Expanded)
static

Definition at line 1415 of file Format.cpp.

Referenced by configurationAsText(), and clang::format::internal::reformat().

◆ expandPresetsSpaceBeforeParens()

void clang::format::expandPresetsSpaceBeforeParens ( FormatStyle & Expanded)
static

Definition at line 1515 of file Format.cpp.

Referenced by configurationAsText(), and clang::format::internal::reformat().

◆ expandPresetsSpacesInParens()

void clang::format::expandPresetsSpacesInParens ( FormatStyle & Expanded)
static

Definition at line 1539 of file Format.cpp.

Referenced by configurationAsText(), and clang::format::internal::reformat().

◆ FindCursorIndex()

std::pair< unsigned, unsigned > clang::format::FindCursorIndex ( const ArrayRef< IncludeDirective > & Includes,
const ArrayRef< unsigned > & Indices,
unsigned Cursor )
static

Definition at line 3241 of file Format.cpp.

References clang::Text.

Referenced by sortCppIncludes().

◆ findJavaImportGroup()

unsigned clang::format::findJavaImportGroup ( const FormatStyle & Style,
StringRef ImportIdentifier )
static

Definition at line 3522 of file Format.cpp.

Referenced by sortJavaImports().

◆ fixNamespaceEndComments()

tooling::Replacements clang::format::fixNamespaceEndComments ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName )

◆ forEachToken()

template<typename T>
void clang::format::forEachToken ( const UnwrappedLine & Line,
const T & Call,
FormatToken * Parent = nullptr )

◆ format()

◆ formatReplacements()

Expected< tooling::Replacements > clang::format::formatReplacements ( StringRef Code,
const tooling::Replacements & Replaces,
const FormatStyle & Style )

◆ getBase()

Base clang::format::getBase ( StringRef IntegerLiteral)
static

◆ getCanonicalRawStringDelimiter()

StringRef clang::format::getCanonicalRawStringDelimiter ( const FormatStyle & Style,
FormatStyle::LanguageKind Language )
static

Definition at line 196 of file ContinuationIndenter.cpp.

◆ getChromiumStyle()

FormatStyle clang::format::getChromiumStyle ( FormatStyle::LanguageKind Language)

Definition at line 1926 of file Format.cpp.

References getGoogleStyle(), and clang::tooling::IncludeStyle::IBS_Preserve.

Referenced by getPredefinedStyle().

◆ getClangFormatStyle()

FormatStyle clang::format::getClangFormatStyle ( )

Definition at line 2079 of file Format.cpp.

References getLLVMStyle().

Referenced by getPredefinedStyle().

◆ getCommentSplit()

BreakableToken::Split clang::format::getCommentSplit ( StringRef Text,
unsigned ContentStartColumn,
unsigned ColumnLimit,
unsigned TabWidth,
encoding::Encoding Encoding,
const FormatStyle & Style,
bool DecorationEndsWithStar = false )
static

◆ getEnclosingFunctionName()

StringRef clang::format::getEnclosingFunctionName ( const FormatToken & Current)
static

Definition at line 2401 of file ContinuationIndenter.cpp.

References Tok.

◆ getFormattingLangOpts()

◆ getFunctionName()

FormatToken * clang::format::getFunctionName ( const AnnotatedLine & Line,
FormatToken *& OpeningParen )
static

Definition at line 3651 of file TokenAnnotator.cpp.

References clang::Line, and Tok.

Referenced by clang::format::TokenAnnotator::annotate().

◆ getGNUStyle()

FormatStyle clang::format::getGNUStyle ( )

Definition at line 2035 of file Format.cpp.

References getLLVMStyle().

Referenced by getPredefinedStyle().

◆ getGoogleStyle()

FormatStyle clang::format::getGoogleStyle ( FormatStyle::LanguageKind Language)

◆ getLanguageByComment()

FormatStyle::LanguageKind clang::format::getLanguageByComment ( const Environment & Env)
static

◆ getLanguageByFileName()

FormatStyle::LanguageKind clang::format::getLanguageByFileName ( StringRef FileName)
static

Definition at line 4165 of file Format.cpp.

References clang::FileName.

Referenced by guessLanguage().

◆ getLastLineEndColumn()

unsigned clang::format::getLastLineEndColumn ( StringRef Text,
unsigned StartColumn,
unsigned TabWidth,
encoding::Encoding Encoding )
static

◆ getLastNonComment()

FormatToken * clang::format::getLastNonComment ( const UnwrappedLine & Line)
static

Definition at line 2781 of file UnwrappedLineParser.cpp.

References getLastNonComment(), clang::Token::isNot(), and clang::Line.

Referenced by getLastNonComment().

◆ getLengthToMatchingParen()

◆ getLengthToNextOperator()

unsigned clang::format::getLengthToNextOperator ( const FormatToken & Tok)
static

Definition at line 119 of file ContinuationIndenter.cpp.

References Tok.

Referenced by clang::format::ContinuationIndenter::mustBreak().

◆ getLineCommentIndentPrefix()

StringRef clang::format::getLineCommentIndentPrefix ( StringRef Comment,
const FormatStyle & Style )
static

◆ getLLVMStyle()

◆ getMicrosoftStyle()

FormatStyle clang::format::getMicrosoftStyle ( FormatStyle::LanguageKind Language)

Definition at line 2050 of file Format.cpp.

References getLLVMStyle().

Referenced by getPredefinedStyle().

◆ getMozillaStyle()

FormatStyle clang::format::getMozillaStyle ( )

Definition at line 1985 of file Format.cpp.

References getLLVMStyle().

Referenced by getPredefinedStyle().

◆ getNamespaceToken() [1/2]

const FormatToken * clang::format::getNamespaceToken ( ) const

Return the actual namespace token, if this token starts a namespace block.

Definition at line 878 of file FormatToken.h.

Referenced by clang::format::NamespaceEndCommentsFixer::analyze(), computeNewlines(), and getNamespaceTokenText().

◆ getNamespaceToken() [2/2]

const FormatToken * clang::format::getNamespaceToken ( const AnnotatedLine * Line,
const SmallVectorImpl< AnnotatedLine * > & AnnotatedLines )

◆ getNamespaceTokenText()

StringRef clang::format::getNamespaceTokenText ( const AnnotatedLine * Line,
const SmallVectorImpl< AnnotatedLine * > & AnnotatedLines )

◆ getNextNonComment()

FormatToken * clang::format::getNextNonComment ( ) const
nodiscard

Returns the next token ignoring comments.

Definition at line 842 of file FormatToken.h.

References Tok.

◆ getNoStyle()

FormatStyle clang::format::getNoStyle ( )

Definition at line 2093 of file Format.cpp.

References getLLVMStyle().

Referenced by getPredefinedStyle(), and getStyle().

◆ getParseCategory()

const std::error_category & clang::format::getParseCategory ( )

Definition at line 1376 of file Format.cpp.

References clang::C.

Referenced by make_error_code().

◆ getPredefinedStyle()

bool clang::format::getPredefinedStyle ( StringRef Name,
FormatStyle::LanguageKind Language,
FormatStyle * Style )

◆ getPreviousNonComment()

struct clang::format::FormatToken clang::format::getPreviousNonComment ( ) const

Returns the previous token ignoring comments.

Definition at line 223 of file FormatToken.h.

References LIST_TOKEN_TYPES, and NUM_TOKEN_TYPES.

◆ getRawStringDelimiter()

std::optional< StringRef > clang::format::getRawStringDelimiter ( StringRef TokenText)
static

Definition at line 170 of file ContinuationIndenter.cpp.

References TokenText.

◆ getStringSplit()

◆ getStyle()

Expected< FormatStyle > clang::format::getStyle ( StringRef StyleName,
StringRef FileName,
StringRef FallbackStyleName,
StringRef Code,
llvm::vfs::FileSystem * FS,
bool AllowUnknownOptions,
llvm::SourceMgr::DiagHandlerTy DiagHandler )

◆ getTokenTypeName()

const char * clang::format::getTokenTypeName ( TokenType Type)

Determines the name of a token type.

Definition at line 23 of file FormatToken.cpp.

References LIST_TOKEN_TYPES, NUM_TOKEN_TYPES, and TokNames.

◆ getWebKitStyle()

FormatStyle clang::format::getWebKitStyle ( )

Definition at line 2011 of file Format.cpp.

References getLLVMStyle().

Referenced by getPredefinedStyle().

◆ guessLanguage()

FormatStyle::LanguageKind clang::format::guessLanguage ( StringRef FileName,
StringRef Code )

Definition at line 4238 of file Format.cpp.

References clang::FileName, getLanguageByComment(), getLanguageByFileName(), and getLLVMStyle().

Referenced by getStyle().

◆ hash_combine()

template<class T>
void clang::format::hash_combine ( std::size_t & seed,
const T & v )
inlinestatic

Definition at line 660 of file UnwrappedLineParser.cpp.

References clang::T.

◆ hasNestedBlockInlined()

bool clang::format::hasNestedBlockInlined ( const FormatToken * Previous,
const FormatToken & Current,
const FormatStyle & Style )
static

Definition at line 1602 of file ContinuationIndenter.cpp.

References clang::format::FormatToken::is(), and Previous.

◆ insertQualifierAfter()

void clang::format::insertQualifierAfter ( const SourceManager & SourceMgr,
tooling::Replacements & Fixes,
const FormatToken * First,
const std::string & Qualifier )
static

◆ insertQualifierBefore()

void clang::format::insertQualifierBefore ( const SourceManager & SourceMgr,
tooling::Replacements & Fixes,
const FormatToken * First,
const std::string & Qualifier )
static

◆ isAlignableBinaryOperator()

bool clang::format::isAlignableBinaryOperator ( const FormatToken & Token)
static

◆ isAllmanBrace()

bool clang::format::isAllmanBrace ( const FormatToken & Tok)
static

Definition at line 5591 of file TokenAnnotator.cpp.

References BK_Block, and Tok.

◆ isAllmanLambdaBrace()

bool clang::format::isAllmanLambdaBrace ( const FormatToken & Tok)
static

Definition at line 5609 of file TokenAnnotator.cpp.

References BK_Block, and Tok.

◆ isBlockIndentedInitRBrace()

bool clang::format::FormatToken::isBlockIndentedInitRBrace ( const FormatStyle & Style) const
nodiscard

Returns true if this token ends a block indented initializer list.

Definition at line 54 of file FormatToken.cpp.

References BK_BracedInit, clang::format::FormatToken::is(), and MatchingParen.

◆ isC78ParameterDecl()

bool clang::format::isC78ParameterDecl ( const FormatToken * Tok,
const FormatToken * Next,
const FormatToken * FuncName )
static

◆ isC78Type()

bool clang::format::isC78Type ( const FormatToken & Tok)
static

Definition at line 1298 of file UnwrappedLineParser.cpp.

References isC78Type(), and Tok.

Referenced by isC78ParameterDecl(), and isC78Type().

◆ isClangFormatOff()

◆ isClangFormatOn()

◆ isClangFormatOnOff()

bool clang::format::isClangFormatOnOff ( StringRef Comment,
bool On )
static

Definition at line 4451 of file Format.cpp.

Referenced by isClangFormatOff(), and isClangFormatOn().

◆ isConfiguredQualifier()

bool clang::format::isConfiguredQualifier ( const FormatToken *const Tok,
const std::vector< tok::TokenKind > & Qualifiers )
static

◆ isConfiguredQualifierOrType()

bool clang::format::isConfiguredQualifierOrType ( const FormatToken * Tok,
const std::vector< tok::TokenKind > & Qualifiers,
const LangOptions & LangOpts )

◆ isCppStructuredBinding()

bool clang::format::isCppStructuredBinding ( bool IsCpp) const

Returns whether the token is the left square bracket of a C++ structured binding declaration.

Definition at line 858 of file FormatToken.h.

◆ isCtorOrDtorName()

bool clang::format::isCtorOrDtorName ( const FormatToken * Tok)
static

Definition at line 3711 of file TokenAnnotator.cpp.

References Tok.

Referenced by clang::format::TokenAnnotator::annotate().

◆ isEmptyLambdaAllowed()

bool clang::format::isEmptyLambdaAllowed ( const FormatToken & Tok,
FormatStyle::ShortLambdaStyle ShortLambdaOption )
static

Definition at line 5604 of file TokenAnnotator.cpp.

References Tok.

◆ IsFunctionArgument()

bool clang::format::IsFunctionArgument ( const FormatToken & Tok)
static

Definition at line 5597 of file TokenAnnotator.cpp.

References Tok.

◆ isFunctionDeclarationName()

◆ isGoogScope()

bool clang::format::isGoogScope ( const UnwrappedLine & Line)
static

Definition at line 914 of file UnwrappedLineParser.cpp.

References isGoogScope(), and clang::Line.

Referenced by isGoogScope().

◆ isIIFE()

bool clang::format::isIIFE ( const UnwrappedLine & Line,
const AdditionalKeywords & Keywords )
static

Definition at line 932 of file UnwrappedLineParser.cpp.

References isIIFE(), clang::AdditionalKeywords::kw_function, and clang::Line.

Referenced by isIIFE().

◆ isJSDeclOrStmt()

◆ isLikelyXml()

bool clang::format::isLikelyXml ( StringRef Code)

Definition at line 3683 of file Format.cpp.

Referenced by clang::format::internal::reformat(), and sortIncludes().

◆ isMpegTS()

bool clang::format::isMpegTS ( StringRef Code)

Definition at line 3676 of file Format.cpp.

Referenced by clang::format::internal::reformat(), and sortIncludes().

◆ isNumericLiteralCaseFixerNeeded()

bool clang::format::isNumericLiteralCaseFixerNeeded ( const FormatStyle & Style)
static

◆ isPossibleMacro()

◆ isQualifier()

◆ isQualifierOrType()

bool clang::format::isQualifierOrType ( const FormatToken * Tok,
const LangOptions & LangOpts )

◆ lexCSharpString()

auto clang::format::lexCSharpString ( const char * Begin,
const char * End,
bool Verbatim,
bool Interpolated )
static

Definition at line 789 of file FormatTokenLexer.cpp.

◆ loadAndParseConfigFile()

llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > clang::format::loadAndParseConfigFile ( StringRef ConfigFile,
llvm::vfs::FileSystem * FS,
FormatStyle * Style,
bool AllowUnknownOptions,
llvm::SourceMgr::DiagHandlerTy DiagHandler,
bool IsDotHFile )

Definition at line 4266 of file Format.cpp.

References parseConfiguration(), and clang::Text.

Referenced by getStyle().

◆ make_error_code()

std::error_code clang::format::make_error_code ( ParseError e)

Definition at line 1380 of file Format.cpp.

References getParseCategory().

Referenced by parseConfiguration().

◆ make_string_error()

llvm::Error clang::format::make_string_error ( const Twine & Message)
inline

Definition at line 1384 of file Format.cpp.

Referenced by getStyle().

◆ markOptionalBraces()

void clang::format::markOptionalBraces ( FormatToken * LeftBrace)
static

◆ matchesReservedSuffix()

bool clang::format::matchesReservedSuffix ( StringRef Suffix)
static

Test if Suffix matches a C++ literal reserved by the library.

Matches against all suffixes reserved in the C++23 standard.

Definition at line 62 of file NumericLiteralCaseFixer.cpp.

Referenced by format().

◆ matchFilePath() [1/2]

bool clang::format::matchFilePath ( llvm::StringRef Pattern,
llvm::StringRef FilePath )

◆ matchFilePath() [2/2]

bool clang::format::matchFilePath ( StringRef Pattern,
StringRef FilePath )

Definition at line 24 of file MatchFilePath.cpp.

References clang::C, clang::Match, and matchFilePath().

Referenced by matchFilePath().

◆ maxNestingDepth()

unsigned clang::format::maxNestingDepth ( const AnnotatedLine & Line)
static

Definition at line 3642 of file TokenAnnotator.cpp.

References clang::Line, clang::Result, and Tok.

Referenced by clang::format::TokenAnnotator::annotate().

◆ mayReflowContent()

bool clang::format::mayReflowContent ( StringRef Content)
static

◆ mustBeJSIdent()

◆ mustBeJSIdentOrValue()

bool clang::format::mustBeJSIdentOrValue ( const AdditionalKeywords & Keywords,
const FormatToken * FormatTok )
static

◆ mustBreakAfterAttributes()

bool clang::format::mustBreakAfterAttributes ( const FormatToken & Tok,
const FormatStyle & Style )
static

Definition at line 26 of file TokenAnnotator.cpp.

References Tok.

Referenced by clang::format::TokenAnnotator::calculateFormattingInformation().

◆ mustBreakBinaryOperation()

bool clang::format::mustBreakBinaryOperation ( const FormatToken & Current,
const FormatStyle & Style )
static

◆ opensBlockOrBlockTypeList()

bool clang::format::FormatToken::opensBlockOrBlockTypeList ( const FormatStyle & Style) const
nodiscard

Returns true if this tokens starts a block-type list, i.e. a list that should be indented with a block indent.

Definition at line 69 of file FormatToken.cpp.

References BK_Block, BK_BracedInit, clang::format::FormatToken::getBlockKind(), clang::format::FormatToken::is(), and NestingLevel.

◆ opensProtoMessageField()

bool clang::format::opensProtoMessageField ( const FormatToken & LessTok,
const FormatStyle & Style )
static

◆ operator<()

◆ operator<<()

std::ostream & clang::format::operator<< ( std::ostream & Stream,
const UnwrappedLine & Line )

Definition at line 90 of file UnwrappedLineParser.cpp.

References clang::Line.

◆ parseConfiguration()

std::error_code clang::format::parseConfiguration ( llvm::MemoryBufferRef Config,
FormatStyle * Style,
bool AllowUnknownOptions,
llvm::SourceMgr::DiagHandlerTy DiagHandler,
void * DiagHandlerCtxt,
bool IsDotHFile )

◆ prepareLeftRightOrderingForQualifierAlignmentFixer()

void clang::format::prepareLeftRightOrderingForQualifierAlignmentFixer ( const std::vector< std::string > & Order,
std::vector< std::string > & LeftOrder,
std::vector< std::string > & RightOrder,
std::vector< tok::TokenKind > & Qualifiers )

◆ processReplacements()

template<typename T>
Expected< tooling::Replacements > clang::format::processReplacements ( T ProcessFunc,
StringRef Code,
const tooling::Replacements & Replaces,
const FormatStyle & Style )
static

◆ reformat() [1/2]

tooling::Replacements clang::format::reformat ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName,
bool * IncompleteFormat )

Definition at line 4077 of file Format.cpp.

References clang::FileName, reformat(), and clang::Result.

◆ reformat() [2/2]

tooling::Replacements clang::format::reformat ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName,
FormattingAttemptStatus * Status )

◆ removeToken()

void clang::format::removeToken ( const SourceManager & SourceMgr,
tooling::Replacements & Fixes,
const FormatToken * First )
static

◆ replaceCRLF()

std::string clang::format::replaceCRLF ( const std::string & Code)

Definition at line 3262 of file Format.cpp.

Referenced by sortCppIncludes(), and sortJavaImports().

◆ replaceToken()

void clang::format::replaceToken ( const SourceManager & SourceMgr,
tooling::Replacements & Fixes,
const CharSourceRange & Range,
std::string NewText )
static

◆ rotateTokens()

◆ ShouldBreakBeforeBrace()

bool clang::format::ShouldBreakBeforeBrace ( const FormatStyle & Style,
const FormatToken & InitialToken )
static

◆ shouldIndentWrappedSelectorName()

bool clang::format::shouldIndentWrappedSelectorName ( const FormatStyle & Style,
LineType LineType )
static

Definition at line 34 of file ContinuationIndenter.cpp.

References LT_ObjCMethodDecl.

◆ shouldUnindentNextOperator()

bool clang::format::shouldUnindentNextOperator ( const FormatToken & Tok)
static

Definition at line 41 of file ContinuationIndenter.cpp.

References clang::prec::Assignment, Previous, and Tok.

◆ sortCppIncludes() [1/2]

void clang::format::sortCppIncludes ( const FormatStyle & Style,
const ArrayRef< IncludeDirective > & Includes,
ArrayRef< tooling::Range > Ranges,
StringRef FileName,
StringRef Code,
tooling::Replacements & Replaces,
unsigned * Cursor )
static

◆ sortCppIncludes() [2/2]

◆ sortIncludes()

tooling::Replacements clang::format::sortIncludes ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName,
unsigned * Cursor )

◆ sortJavaImports() [1/2]

void clang::format::sortJavaImports ( const FormatStyle & Style,
const ArrayRef< JavaImportDirective > & Imports,
ArrayRef< tooling::Range > Ranges,
StringRef FileName,
StringRef Code,
tooling::Replacements & Replaces )
static

◆ sortJavaImports() [2/2]

tooling::Replacements clang::format::sortJavaImports ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName,
tooling::Replacements & Replaces )

◆ sortJavaScriptImports()

tooling::Replacements clang::format::sortJavaScriptImports ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName )

◆ sortUsingDeclarations()

tooling::Replacements clang::format::sortUsingDeclarations ( const FormatStyle & Style,
StringRef Code,
ArrayRef< tooling::Range > Ranges,
StringRef FileName )

◆ startsNextOperand()

bool clang::format::startsNextOperand ( const FormatToken & Current)
static

◆ startsNextParameter()

bool clang::format::startsNextParameter ( const FormatToken & Current,
const FormatStyle & Style )

◆ startsSegmentOfBuilderTypeCall()

bool clang::format::startsSegmentOfBuilderTypeCall ( const FormatToken & Tok)
static

Definition at line 127 of file ContinuationIndenter.cpp.

References Tok.

Referenced by clang::format::ContinuationIndenter::mustBreak().

◆ startsWithSpace()

bool clang::format::startsWithSpace ( const std::string & s)
static

Definition at line 106 of file QualifierAlignmentFixer.cpp.

References s.

Referenced by rotateTokens().

◆ switchesFormatting()

bool clang::format::switchesFormatting ( const FormatToken & Token)

Checks if Token switches formatting, like /* clang-format off *‍/.

Token must be a comment.

Definition at line 206 of file BreakableToken.cpp.

References clang::Token::is().

Referenced by clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), clang::format::BreakableBlockComment::mayReflow(), and clang::format::BreakableLineCommentSection::mayReflow().

◆ tokenCanStartNewLine()

bool clang::format::tokenCanStartNewLine ( const FormatToken & Tok)
static

Definition at line 1233 of file UnwrappedLineParser.cpp.

References Tok, and tokenCanStartNewLine().

Referenced by tokenCanStartNewLine().

◆ transformComponent()

std::string clang::format::transformComponent ( StringRef Component,
FormatStyle::NumericLiteralComponentStyle ConfigValue )
static

Definition at line 47 of file NumericLiteralCaseFixer.cpp.

Referenced by format().

◆ validateQualifierOrder()

Variable Documentation

◆ CppNonKeywordTypes

SmallVector<StringRef> clang::format::CppNonKeywordTypes
static
Initial value:
= {
"clock_t", "int16_t", "int32_t", "int64_t", "int8_t",
"intptr_t", "ptrdiff_t", "size_t", "time_t", "uint16_t",
"uint32_t", "uint64_t", "uint8_t", "uintptr_t",
}

Definition at line 37 of file FormatToken.cpp.

◆ DefaultFallbackStyle

const char* clang::format::DefaultFallbackStyle = "LLVM"

Definition at line 4263 of file Format.cpp.

◆ DefaultFormatStyle

const char* clang::format::DefaultFormatStyle = "file"

Definition at line 4261 of file Format.cpp.

◆ StyleOptionHelpDescription

const char* clang::format::StyleOptionHelpDescription
Initial value:
=
"Set coding style. <string> can be:\n"
"1. A preset: LLVM, GNU, Google, Chromium, Microsoft,\n"
" Mozilla, WebKit.\n"
"2. 'file' to load style configuration from a\n"
" .clang-format file in one of the parent directories\n"
" of the source file (for stdin, see --assume-filename).\n"
" If no .clang-format file is found, falls back to\n"
" --fallback-style.\n"
" --style=file is the default.\n"
"3. 'file:<format_file_path>' to explicitly specify\n"
" the configuration file.\n"
"4. \"{key: value, ...}\" to set specific parameters, e.g.:\n"
" --style=\"{BasedOnStyle: llvm, IndentWidth: 8}\""

Definition at line 4150 of file Format.cpp.