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,
79 static std::unique_ptr<Provider>
85 static std::unique_ptr<Provider>
combine(std::vector<const Provider *>);
99 virtual std::vector<CompiledFragment>
static cl::opt< std::string > Config("config", desc(R"(
Specifies a configuration in YAML/JSON format:
-config="{Checks:' *', CheckOptions:{x:y}}"
When the value is empty, clang-tidy will
attempt to find a file named .clang-tidy for
each source file in its parent directories.
)"), cl::init(""), cl::cat(ClangTidyCategory))
llvm::StringRef Directory
Wrapper for vfs::FileSystem for use in multithreaded programs like clangd.
A source of configuration fragments.
virtual ~Provider()=default
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< const 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.
===– 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.