llvm/clang-tools-extra/clangd/unittests/TestFS.cpp

//===-- TestFS.cpp ----------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "TestFS.h"
#include "GlobalCompilationDatabase.h"
#include "URI.h"
#include "support/Logger.h"
#include "support/Path.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"
#include <optional>

namespace clang {
namespace clangd {

namespace {

// Tries to strip \p Prefix from beginning of \p Path. Returns true on success.
// If \p Prefix doesn't match, leaves \p Path untouched and returns false.
bool pathConsumeFront(PathRef &Path, PathRef Prefix) {}
} // namespace

llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
buildTestFS(llvm::StringMap<std::string> const &Files,
            llvm::StringMap<time_t> const &Timestamps) {}

MockCompilationDatabase::MockCompilationDatabase(llvm::StringRef Directory,
                                                 llvm::StringRef RelPathPrefix)
    :{}

std::optional<ProjectInfo>
MockCompilationDatabase::getProjectInfo(PathRef File) const {}

std::optional<tooling::CompileCommand>
MockCompilationDatabase::getCompileCommand(PathRef File) const {}

const char *testRoot() {}

std::string testPath(PathRef File, llvm::sys::path::Style Style) {}

/// unittest: is a scheme that refers to files relative to testRoot().
/// URI body is a path relative to testRoot() e.g. unittest:///x.h for
/// /clangd-test/x.h.
class TestScheme : public URIScheme {};

const char *TestScheme::Scheme =;

static URISchemeRegistry::Add<TestScheme> X(TestScheme::Scheme, "Test schema");

volatile int UnittestSchemeAnchorSource =;

} // namespace clangd
} // namespace clang