#include "IncludeFixer.h"
#include "AST.h"
#include "Diagnostics.h"
#include "SourceCode.h"
#include "index/Index.h"
#include "index/Symbol.h"
#include "support/Logger.h"
#include "support/Trace.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/Type.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticParse.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TokenKinds.h"
#include "clang/Lex/Lexer.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/TypoCorrection.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FormatVariadic.h"
#include <algorithm>
#include <optional>
#include <set>
#include <string>
#include <vector>
namespace clang {
namespace clangd {
namespace {
std::optional<llvm::StringRef> getArgStr(const clang::Diagnostic &Info,
unsigned Index) { … }
std::vector<Fix> only(std::optional<Fix> F) { … }
}
std::vector<Fix> IncludeFixer::fix(DiagnosticsEngine::Level DiagLevel,
const clang::Diagnostic &Info) const { … }
std::optional<Fix> IncludeFixer::insertHeader(llvm::StringRef Spelled,
llvm::StringRef Symbol,
tooling::IncludeDirective Directive) const { … }
std::vector<Fix> IncludeFixer::fixIncompleteType(const Type &T) const { … }
std::vector<Fix> IncludeFixer::fixesForSymbols(const SymbolSlab &Syms) const { … }
std::optional<std::string> qualifiedByUnresolved(const SourceManager &SM,
SourceLocation Loc,
const LangOptions &LangOpts) { … }
struct CheapUnresolvedName { … };
std::optional<std::string> getSpelledSpecifier(const CXXScopeSpec &SS,
const SourceManager &SM) { … }
std::optional<CheapUnresolvedName> extractUnresolvedNameCheaply(
const SourceManager &SM, const DeclarationNameInfo &Unresolved,
CXXScopeSpec *SS, const LangOptions &LangOpts, bool UnresolvedIsSpecifier) { … }
std::vector<std::string>
collectAccessibleScopes(Sema &Sem, const DeclarationNameInfo &Typo, Scope *S,
Sema::LookupNameKind LookupKind) { … }
class IncludeFixer::UnresolvedNameRecorder : public ExternalSemaSource { … };
llvm::IntrusiveRefCntPtr<ExternalSemaSource>
IncludeFixer::unresolvedNameRecorder() { … }
std::vector<Fix> IncludeFixer::fixUnresolvedName() const { … }
std::optional<const SymbolSlab *>
IncludeFixer::fuzzyFindCached(const FuzzyFindRequest &Req) const { … }
std::optional<const SymbolSlab *>
IncludeFixer::lookupCached(const SymbolID &ID) const { … }
}
}