Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/clangd/ConfigFragment.h
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | private: | ||||
T Value; | T Value; | ||||
}; | }; | ||||
/// A chunk of configuration obtained from a config file, LSP, or elsewhere. | /// A chunk of configuration obtained from a config file, LSP, or elsewhere. | ||||
struct Fragment { | struct Fragment { | ||||
/// Parses fragments from a YAML file (one from each --- delimited document). | /// Parses fragments from a YAML file (one from each --- delimited document). | ||||
/// Documents that contained fatal errors are omitted from the results. | /// Documents that contained fatal errors are omitted from the results. | ||||
/// BufferName is used for the SourceMgr and diagnostics. | /// BufferName is used for the SourceMgr and diagnostics. | ||||
static std::vector<Fragment> parseYAML(llvm::StringRef YAML, | /// configFilePath is used for variable replacement in the configuration if | ||||
llvm::StringRef BufferName, | /// present, otherwise it is treated as "" | ||||
DiagnosticCallback); | static std::vector<Fragment> | ||||
parseYAML(llvm::StringRef YAML, llvm::StringRef BufferName, | |||||
std::optional<llvm::StringRef> configFilePath, | |||||
DiagnosticCallback Diags); | |||||
/// Analyzes and consumes this fragment, possibly yielding more diagnostics. | /// Analyzes and consumes this fragment, possibly yielding more diagnostics. | ||||
/// This always produces a usable result (errors are recovered). | /// This always produces a usable result (errors are recovered). | ||||
/// | /// | ||||
/// Typically, providers will compile a Fragment once when it's first loaded, | /// Typically, providers will compile a Fragment once when it's first loaded, | ||||
/// caching the result for reuse. | /// caching the result for reuse. | ||||
/// Like a compiled program, this is good for performance and also encourages | /// Like a compiled program, this is good for performance and also encourages | ||||
/// errors to be reported early and only once. | /// errors to be reported early and only once. | ||||
▲ Show 20 Lines • Show All 240 Lines • Show Last 20 Lines |