clang-tools 22.0.0git
clang::include_fixer Namespace Reference

Classes

class  ClangIncludeFixerPluginAction
 The core include fixer plugin action. More...
class  FuzzySymbolIndex
class  IncludeFixerActionFactory
class  IncludeFixerContext
 A context for a file being processed. More...
class  IncludeFixerSemaSource
 Handles callbacks from sema, does the include lookup and turns it into an IncludeFixerContext. More...
class  InMemorySymbolIndex
 Xref database with fixed content. More...
struct  SymbolAndSignals
class  SymbolIndex
 This class provides an interface for finding all SymbolInfos corresponding to a symbol name from a symbol database. More...
class  SymbolIndexManager
 This class provides an interface for finding the header files corresponding to an identifier in the source code from multiple symbol databases. More...
class  SymbolInfo
 Describes a named symbol from a header. More...
class  YamlSymbolIndex
 Yaml format database. More...

Functions

static bool addDiagnosticsForContext (TypoCorrection &Correction, const IncludeFixerContext &Context, StringRef Code, SourceLocation StartOfFile, ASTContext &Ctx)
llvm::Expected< tooling::Replacements > createIncludeFixerReplacements (StringRef Code, const IncludeFixerContext &Context, const clang::format::FormatStyle &Style, bool AddQualifiers)
llvm::Expected< tooling::Replacements > createIncludeFixerReplacements (StringRef Code, const IncludeFixerContext &Context, const format::FormatStyle &Style=format::getLLVMStyle(), bool AddQualifiers=true)
 Create replacements, which are generated by clang-format, for the missing header and missing qualifiers insertions.
static double similarityScore (llvm::StringRef FileName, llvm::StringRef Header)
static void rank (std::vector< SymbolAndSignals > &Symbols, llvm::StringRef FileName)

Function Documentation

◆ addDiagnosticsForContext()

bool clang::include_fixer::addDiagnosticsForContext ( TypoCorrection & Correction,
const IncludeFixerContext & Context,
StringRef Code,
SourceLocation StartOfFile,
ASTContext & Ctx )
static

◆ createIncludeFixerReplacements() [1/2]

llvm::Expected< tooling::Replacements > clang::include_fixer::createIncludeFixerReplacements ( StringRef Code,
const IncludeFixerContext & Context,
const clang::format::FormatStyle & Style,
bool AddQualifiers )

◆ createIncludeFixerReplacements() [2/2]

llvm::Expected< tooling::Replacements > clang::include_fixer::createIncludeFixerReplacements ( StringRef Code,
const IncludeFixerContext & Context,
const format::FormatStyle & Style = format::getLLVMStyle(),
bool AddQualifiers = true )

Create replacements, which are generated by clang-format, for the missing header and missing qualifiers insertions.

The function uses the first header for insertion.

Parameters
CodeThe source code.
ContextThe context which contains all information for creating clang-include-fixer replacements.
Styleclang-format style being used.
AddQualifiersWhether we should add qualifiers to all instances of an unidentified symbol.
Returns
Formatted replacements for inserting, sorting headers and adding qualifiers on success; otherwise, an llvm::Error carrying llvm::StringError is returned.

◆ rank()

void clang::include_fixer::rank ( std::vector< SymbolAndSignals > & Symbols,
llvm::StringRef FileName )
static

◆ similarityScore()

double clang::include_fixer::similarityScore ( llvm::StringRef FileName,
llvm::StringRef Header )
static

Definition at line 30 of file SymbolIndexManager.cpp.

Referenced by rank().