12#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_TESTFS_H
13#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_TESTFS_H
17#include "llvm/ADT/IntrusiveRefCntPtr.h"
18#include "llvm/Support/Path.h"
19#include "llvm/Support/VirtualFileSystem.h"
27llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
28buildTestFS(llvm::StringMap<std::string>
const &Files,
29 llvm::StringMap<time_t>
const &Timestamps = {});
34 IntrusiveRefCntPtr<llvm::vfs::FileSystem>
viewImpl()
const override {
38 llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFileSystem =
39 new llvm::vfs::OverlayFileSystem(llvm::vfs::getRealFileSystem());
40 OverlayFileSystem->pushOverlay(MemFS);
41 return OverlayFileSystem;
45 llvm::StringMap<std::string>
Files;
63 std::optional<tooling::CompileCommand>
80 llvm::sys::path::Style = llvm::sys::path::Style::native);
Provides compilation arguments used for parsing C and C++ files.
std::optional< tooling::CompileCommand > getCompileCommand(PathRef File) const override
If there are any known-good commands for building this file, returns one.
std::vector< std::string > ExtraClangFlags
std::optional< ProjectInfo > getProjectInfo(PathRef File) const override
Finds the closest project to File.
llvm::StringMap< std::string > Files
llvm::StringMap< time_t > Timestamps
bool OverlayRealFileSystemForModules
IntrusiveRefCntPtr< llvm::vfs::FileSystem > viewImpl() const override
Overridden by implementations to provide a vfs::FileSystem.
Wrapper for vfs::FileSystem for use in multithreaded programs like clangd.
std::string testPath(PathRef File, llvm::sys::path::Style Style)
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > buildTestFS(llvm::StringMap< std::string > const &Files, llvm::StringMap< time_t > const &Timestamps)
volatile int UnittestSchemeAnchorSource
llvm::StringRef PathRef
A typedef to represent a ref to file path.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//