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

Classes

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...
 

Typedefs

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

Functions

 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 58 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 51 of file ConfigProvider.h.

Function Documentation

◆ MATCHER_P() [1/4]

clang::clangd::config::MATCHER_P ( DiagKind  ,
K  ,
""   
)

Definition at line 69 of file ConfigTesting.h.

References K.

◆ MATCHER_P() [2/4]

clang::clangd::config::MATCHER_P ( DiagMessage  ,
M  ,
""   
)

Definition at line 68 of file ConfigTesting.h.

References M.

◆ MATCHER_P() [3/4]

clang::clangd::config::MATCHER_P ( DiagPos  ,
,
""   
)

Definition at line 70 of file ConfigTesting.h.

◆ MATCHER_P() [4/4]

clang::clangd::config::MATCHER_P ( DiagRange  ,
,
""   
)

Definition at line 71 of file ConfigTesting.h.

◆ PrintTo()

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

Definition at line 25 of file ConfigYAMLTests.cpp.

References OS.

◆ toPosition()

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

Definition at line 73 of file ConfigTesting.h.

Referenced by toRange().

◆ toRange()

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

Definition at line 81 of file ConfigTesting.h.

References SM, and toPosition().