clang-tools 19.0.0git
Classes | Typedefs | Functions
clang::clangd::config Namespace Reference


struct  CapturedDiags
class  FileConfigCache
struct  Fragment
 A chunk of configuration obtained from a config file, LSP, or elsewhere. More...
struct  Located
 An entity written in config along, with its optional location in the file. More...
struct  Params
 Describes the context used to evaluate configuration fragments. More...
class  Provider
 A source of configuration fragments. More...


using DiagnosticCallback = llvm::function_ref< void(const llvm::SMDiagnostic &)>
 Used to report problems in parsing or interpreting a config.
using CompiledFragment = std::function< bool(const Params &, Config &)>
 A chunk of configuration that has been fully analyzed and is ready to apply.


 MATCHER_P (diagMessage, M, "")
 MATCHER_P (diagKind, K, "")
 MATCHER_P (diagPos, P, "")
 MATCHER_P (diagRange, R, "")
Position toPosition (llvm::SMLoc L, const llvm::SourceMgr &SM)
Range toRange (llvm::SMRange R, const llvm::SourceMgr &SM)
template<typename T >
void PrintTo (const Located< T > &V, std::ostream *OS)

Typedef Documentation

◆ CompiledFragment

using clang::clangd::config::CompiledFragment = typedef std::function<bool(const Params &, Config &)>

A chunk of configuration that has been fully analyzed and is ready to apply.

Typically this is obtained from a Fragment by calling Fragment::compile().

Calling it updates the configuration to reflect settings from the fragment. Returns true if the condition was met and the settings were used.

Definition at line 56 of file ConfigProvider.h.

◆ DiagnosticCallback

using clang::clangd::config::DiagnosticCallback = typedef llvm::function_ref<void(const llvm::SMDiagnostic &)>

Used to report problems in parsing or interpreting a config.

Errors reflect structurally invalid config that should be user-visible. Warnings reflect e.g. unknown properties that are recoverable. Notes are used to report files and fragments. (This can be used to track when previous warnings/errors have been "fixed").

Definition at line 49 of file ConfigProvider.h.

Function Documentation

◆ MATCHER_P() [1/4]

clang::clangd::config::MATCHER_P ( diagKind  ,
K  ,

Definition at line 70 of file ConfigTesting.h.

References K.

◆ MATCHER_P() [2/4]

clang::clangd::config::MATCHER_P ( diagMessage  ,
M  ,

Definition at line 69 of file ConfigTesting.h.

References M.

◆ MATCHER_P() [3/4]

clang::clangd::config::MATCHER_P ( diagPos  ,

Definition at line 71 of file ConfigTesting.h.

◆ MATCHER_P() [4/4]

clang::clangd::config::MATCHER_P ( diagRange  ,

Definition at line 72 of file ConfigTesting.h.

◆ PrintTo()

template<typename T >
void clang::clangd::config::PrintTo ( const Located< T > &  V,
std::ostream *  OS 

Definition at line 26 of file ConfigYAMLTests.cpp.

References OS.

◆ toPosition()

Position clang::clangd::config::toPosition ( llvm::SMLoc  L,
const llvm::SourceMgr &  SM 

Definition at line 74 of file ConfigTesting.h.

References clang::clangd::Position::character, and clang::clangd::Position::line.

Referenced by toRange().

◆ toRange()

Range clang::clangd::config::toRange ( llvm::SMRange  R,
const llvm::SourceMgr &  SM 

Definition at line 82 of file ConfigTesting.h.

References toPosition().