10#include "llvm/ADT/SmallVector.h"
11#include "llvm/Support/Errc.h"
12#include "llvm/Support/FileSystem.h"
13#include "llvm/Support/MemoryBuffer.h"
14#include "llvm/Support/Path.h"
21namespace include_fixer {
23llvm::ErrorOr<std::unique_ptr<YamlSymbolIndex>>
25 auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
27 return Buffer.getError();
33llvm::ErrorOr<std::unique_ptr<YamlSymbolIndex>>
35 llvm::StringRef
Name) {
39 assert(
Directory.size() <= PathStorage.size());
41 llvm::sys::path::append(PathStorage,
Name);
45 return llvm::make_error_code(llvm::errc::no_such_file_or_directory);
48std::vector<SymbolAndSignals>
50 std::vector<SymbolAndSignals>
Results;
51 for (
const auto &Symbol : Symbols) {
52 if (Symbol.Symbol.getName() == Identifier)
llvm::SmallString< 256U > Name
std::vector< CodeCompletionResult > Results
llvm::StringRef Directory
static llvm::ErrorOr< std::unique_ptr< YamlSymbolIndex > > createFromFile(llvm::StringRef FilePath)
Create a new Yaml db from a file.
std::vector< find_all_symbols::SymbolAndSignals > search(llvm::StringRef Identifier) override
Search for all SymbolInfos corresponding to an identifier.
static llvm::ErrorOr< std::unique_ptr< YamlSymbolIndex > > createFromDirectory(llvm::StringRef Directory, llvm::StringRef Name)
Look for a file called Name in Directory and all parent directories.
std::vector< SymbolAndSignals > ReadSymbolInfosFromYAML(llvm::StringRef Yaml)
Read SymbolInfos from a YAML document.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//