#include "index/Index.h"
#include "index/Relation.h"
#include "index/Serialization.h"
#include "index/remote/Client.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/LineEditor/LineEditor.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Signals.h"
#include <optional>
namespace clang {
namespace clangd {
namespace {
llvm::cl::opt<std::string> IndexLocation(
llvm::cl::desc("<path to index file | remote:server.address>"),
llvm::cl::Positional);
llvm::cl::opt<std::string>
ExecCommand("c", llvm::cl::desc("Command to execute and then exit."));
llvm::cl::opt<std::string> ProjectRoot(
"project-root",
llvm::cl::desc(
"Path to the project. Required when connecting using remote index."));
static constexpr char Overview[] = …;
void reportTime(llvm::StringRef Name, llvm::function_ref<void()> F) { … }
std::vector<SymbolID> getSymbolIDsFromIndex(llvm::StringRef QualifiedName,
const SymbolIndex *Index) { … }
class Command { … };
class FuzzyFind : public Command { … };
class Lookup : public Command { … };
class Refs : public Command { … };
class Relations : public Command { … };
class Export : public Command { … };
struct { … } CommandInfo[] = …;
std::unique_ptr<SymbolIndex> openIndex(llvm::StringRef Index) { … }
bool runCommand(std::string Request, const SymbolIndex &Index) { … }
}
}
}
int main(int argc, const char *argv[]) { … }