17#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CONFIGPROVIDER_H
18#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CONFIGPROVIDER_H
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/SourceMgr.h"
41 std::chrono::steady_clock::time_point::max();
68 static std::unique_ptr<Provider>
fromYAMLFile(llvm::StringRef AbsPath,
71 bool Trusted =
false);
79 static std::unique_ptr<Provider>
81 bool Trusted =
false);
85 static std::unique_ptr<Provider>
86 combine(std::vector<std::unique_ptr<Provider>>);
91 static std::vector<std::unique_ptr<Provider>>
110 virtual std::vector<CompiledFragment>
static cl::opt< std::string > Directory(cl::Positional, cl::Required, cl::desc("<Search Root Directory>"))
Wrapper for vfs::FileSystem for use in multithreaded programs like clangd.
A source of configuration fragments.
virtual ~Provider()=default
static const char *const EnableConfigFlagDesc
Help text for the –enable-config flag, shared by clangd tools that expose createDefaultProviders() on...
static std::vector< std::unique_ptr< Provider > > createDefaultProviders(const ThreadsafeFS &)
Returns providers for the configuration files that clangd tools read by default: project config (ance...
static std::unique_ptr< Provider > fromYAMLFile(llvm::StringRef AbsPath, llvm::StringRef Directory, const ThreadsafeFS &, bool Trusted=false)
Reads fragments from a single YAML file with a fixed path.
Config getConfig(const Params &, DiagnosticCallback) const
Build a config based on this provider.
static std::unique_ptr< Provider > fromAncestorRelativeYAMLFiles(llvm::StringRef RelPath, const ThreadsafeFS &, bool Trusted=false)
static std::unique_ptr< Provider > combine(std::vector< std::unique_ptr< Provider > >)
A provider that includes fragments from all the supplied providers.
std::function< bool(const Params &, Config &)> CompiledFragment
A chunk of configuration that has been fully analyzed and is ready to apply.
llvm::function_ref< void(const llvm::SMDiagnostic &)> DiagnosticCallback
Used to report problems in parsing or interpreting a config.
FIXME: Skip testing on windows temporarily due to the different escaping code mode.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Settings that express user/project preferences and control clangd behavior.
Describes the context used to evaluate configuration fragments.
std::chrono::steady_clock::time_point FreshTime
Hint that stale data is OK to improve performance (e.g.
llvm::StringRef Path
Absolute path to a source file we're applying the config to.