clang-tools 10.0.0

Namespaces | Macros | Functions
CodeComplete.cpp File Reference
`#include "CodeComplete.h"`
`#include "AST.h"`
`#include "CodeCompletionStrings.h"`
`#include "Compiler.h"`
`#include "Diagnostics.h"`
`#include "ExpectedTypes.h"`
`#include "FileDistance.h"`
`#include "FuzzyMatch.h"`
`#include "Headers.h"`
`#include "Logger.h"`
`#include "Preamble.h"`
`#include "Protocol.h"`
`#include "Quality.h"`
`#include "SourceCode.h"`
`#include "TUScheduler.h"`
`#include "Threading.h"`
`#include "Trace.h"`
`#include "URI.h"`
`#include "index/Index.h"`
`#include "index/Symbol.h"`
`#include "index/SymbolOrigin.h"`
`#include "clang/AST/Decl.h"`
`#include "clang/AST/DeclBase.h"`
`#include "clang/Basic/CharInfo.h"`
`#include "clang/Basic/LangOptions.h"`
`#include "clang/Basic/SourceLocation.h"`
`#include "clang/Format/Format.h"`
`#include "clang/Frontend/CompilerInstance.h"`
`#include "clang/Frontend/FrontendActions.h"`
`#include "clang/Lex/ExternalPreprocessorSource.h"`
`#include "clang/Lex/Preprocessor.h"`
`#include "clang/Lex/PreprocessorOptions.h"`
`#include "clang/Sema/CodeCompleteConsumer.h"`
`#include "clang/Sema/DeclSpec.h"`
`#include "clang/Sema/Sema.h"`
`#include "llvm/ADT/ArrayRef.h"`
`#include "llvm/ADT/None.h"`
`#include "llvm/ADT/Optional.h"`
`#include "llvm/ADT/SmallVector.h"`
`#include "llvm/ADT/StringExtras.h"`
`#include "llvm/ADT/StringRef.h"`
`#include "llvm/Support/Compiler.h"`
`#include "llvm/Support/Debug.h"`
`#include "llvm/Support/Error.h"`
`#include "llvm/Support/Format.h"`
`#include "llvm/Support/FormatVariadic.h"`
`#include "llvm/Support/ScopedPrinter.h"`
`#include <algorithm>`
`#include <iterator>`
Include dependency graph for CodeComplete.cpp:

Go to the source code of this file.

## Namespaces
| clang
| ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
| clang::clangd

## Macros
#define | DEBUG_TYPE "CodeComplete"

## Functions
CompletionPrefix | clang::clangd::guessCompletionPrefix (llvm::StringRef Content, unsigned Offset)
CodeCompleteResult | clang::clangd::codeComplete (PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind)
SignatureHelp | clang::clangd::signatureHelp (PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, const SymbolIndex *Index)
bool | clang::clangd::isIndexedForCodeCompletion (const NamedDecl &ND, ASTContext &ASTCtx)
llvm::raw_ostream & | clang::clangd::operator<< (llvm::raw_ostream &OS, const CodeCompletion &C)
llvm::raw_ostream & | clang::clangd::operator<< (llvm::raw_ostream &OS, const CodeCompleteResult &R)

## Macro Definition Documentation

## ◆ DEBUG_TYPE

#define DEBUG_TYPE "CodeComplete"

Definition at line 71 of file CodeComplete.cpp.

## Variable Documentation

## ◆ AccessibleScopes

std::vector<std::string> AccessibleScopes

Definition at line 525 of file CodeComplete.cpp.

## ◆ CCContext

CodeCompletionContext CCContext

Definition at line 690 of file CodeComplete.cpp.

## ◆ CCSema

Sema* CCSema = nullptr

Definition at line 691 of file CodeComplete.cpp.

## ◆ Command

const tooling::CompileCommand& Command

Definition at line 1019 of file CodeComplete.cpp.

Referenced by clang::clangd::asCommand().

## ◆ Contents

llvm::StringRef Contents

Definition at line 1021 of file CodeComplete.cpp.

Referenced by clang::clangd::DraftStore::addDraft(), clang::clangd::TEST_F(), clang::clangd::DraftStore::updateDraft(), and clang::clangd::FileIndex::updateMain().

## ◆ FileName

PathRef FileName

Definition at line 1018 of file CodeComplete.cpp.

Referenced by clang::tidy::utils::IncludeSorter::AddInclude(), Modularize::PreprocessorTracker::create(), clang::tidy::utils::IncludeInserter::CreateIncludeInsertion(), clang::tidy::utils::IncludeSorter::current_FileID(), clang::tidy::utils::defaultHeaderFileExtensions(), clang::clangd::filenameWithoutExtension(), clang::clangd::MockCompilationDatabase::getCompileCommand(), clang::tidy::DefaultOptionsProvider::getGlobalOptions(), clang::tidy::llvm_check::getPriority(), clang::clangd::ParsedAST::getTokens(), clang::tidy::ClangTidyDiagnosticConsumer::HandleDiagnostic(), clang::find_all_symbols::YamlReporter::reportSymbols(), and clang::tidy::fuchsia::RestrictedIncludesPPCallbacks::RestrictedIncludesPPCallbacks().

## ◆ IdentifierResult

const RawIdentifier* IdentifierResult = nullptr

Definition at line 167 of file CodeComplete.cpp.

## ◆ IDForDoc

llvm::Optional<SymbolID> IDForDoc

Definition at line 794 of file CodeComplete.cpp.

## ◆ IndexResult

const Symbol* IndexResult = nullptr

Definition at line 166 of file CodeComplete.cpp.

## ◆ Name

llvm::StringRef Name

Definition at line 156 of file CodeComplete.cpp.

Referenced by clang::find_all_symbols::SymbolInfo::SymbolInfo().

## ◆ Offset

size_t Offset

Definition at line 1022 of file CodeComplete.cpp.

Referenced by clang::tidy::utils::IncludeSorter::AddInclude(), clang::clangd::buildRenameEdit(), llvm::yaml::MappingTraits< tooling::Range >::NormalizedRange::denormalize(), clang::clangd::TweakTest::expandCases(), clang::clangd::offsetToClangLineColumn(), clang::clangd::offsetToPosition(), and clang::clangd::signatureHelp().

## ◆ Preamble

const PreambleData* Preamble

Definition at line 1020 of file CodeComplete.cpp.

## ◆ Quality

SignatureQualitySignals Quality

Definition at line 796 of file CodeComplete.cpp.

## ◆ RankedIncludeHeaders

llvm::SmallVector<llvm::StringRef, 1> RankedIncludeHeaders

Definition at line 168 of file CodeComplete.cpp.

## ◆ References

unsigned References

Definition at line 157 of file CodeComplete.cpp.

Referenced by clang::clangd::SymbolQualitySignals::evaluate(), and clang::clangd::SymbolQualitySignals::merge().

## ◆ Results

std::vector<CodeCompletionResult> Results

Definition at line 689 of file CodeComplete.cpp.

Referenced by clang::tidy::modernize::collectParamDecls(), clang::clangd::findReferences(), clang::clangd::flattenSymbolHierarchy(), clang::clangd::TUScheduler::getAllFileContents(), clang::clangd::getIndexableLocalDecls(), clang::clangd::lookup(), and clang::include_fixer::YamlSymbolIndex::search().

## ◆ ReturnType

std::string ReturnType

Definition at line 395 of file CodeComplete.cpp.

Referenced by clang::doc::FunctionInfo::merge().

## ◆ SemaResult

const CodeCompletionResult* SemaResult = nullptr

Definition at line 165 of file CodeComplete.cpp.

## ◆ Signature

SignatureInformation Signature

Definition at line 394 of file CodeComplete.cpp.

## ◆ SnippetSuffix

std::string SnippetSuffix

Definition at line 393 of file CodeComplete.cpp.

## ◆ UnresolvedQualifier

llvm::Optional<std::string> UnresolvedQualifier

Definition at line 528 of file CodeComplete.cpp.

## ◆ VFS

llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS

Definition at line 1023 of file CodeComplete.cpp.

Referenced by clang::clangd::prepareCompilerInstance().