clang-tools 22.0.0git
clang::clangd::IncludeFixer Class Reference

Attempts to recover from error diagnostics by suggesting include insertion fixes. More...

#include <IncludeFixer.h>

Classes

class  UnresolvedNameRecorder

Public Member Functions

 IncludeFixer (llvm::StringRef File, std::shared_ptr< IncludeInserter > Inserter, const SymbolIndex &Index, unsigned IndexRequestLimit, Symbol::IncludeDirective Directive)
std::vector< Fixfix (DiagnosticsEngine::Level DiagLevel, const clang::Diagnostic &Info) const
 Returns include insertions that can potentially recover the diagnostic.
llvm::IntrusiveRefCntPtr< ExternalSemaSourceunresolvedNameRecorder ()
 Returns an ExternalSemaSource that records failed name lookups in Sema.

Detailed Description

Attempts to recover from error diagnostics by suggesting include insertion fixes.

For example, member access into incomplete type can be fixes by include headers with the definition.

Definition at line 34 of file clangd/IncludeFixer.h.

Constructor & Destructor Documentation

◆ IncludeFixer()

clang::clangd::IncludeFixer::IncludeFixer ( llvm::StringRef File,
std::shared_ptr< IncludeInserter > Inserter,
const SymbolIndex & Index,
unsigned IndexRequestLimit,
Symbol::IncludeDirective Directive )
inline

Definition at line 36 of file clangd/IncludeFixer.h.

Member Function Documentation

◆ fix()

std::vector< Fix > clang::clangd::IncludeFixer::fix ( DiagnosticsEngine::Level DiagLevel,
const clang::Diagnostic & Info ) const

Returns include insertions that can potentially recover the diagnostic.

If Info is a note and fixes are returned, they should replace the note.

Definition at line 72 of file clangd/IncludeFixer.cpp.

References dlog, clang::clangd::Info, and clang::clangd::Type.

◆ unresolvedNameRecorder()

llvm::IntrusiveRefCntPtr< ExternalSemaSource > clang::clangd::IncludeFixer::unresolvedNameRecorder ( )

Returns an ExternalSemaSource that records failed name lookups in Sema.

This allows IncludeFixer to suggest inserting headers that define those names.

Definition at line 552 of file clangd/IncludeFixer.cpp.


The documentation for this class was generated from the following files: