32#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CONFIGFRAGMENT_H
33#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CONFIGFRAGMENT_H
36#include "llvm/Support/SMLoc.h"
37#include "llvm/Support/SourceMgr.h"
67 llvm::StringRef BufferName,
146 std::vector<Located<std::string>>
Add;
164 std::vector<Located<std::string>>
Remove;
192 std::optional<Located<std::string>>
File;
195 std::optional<Located<std::string>>
Server;
269 std::vector<Located<std::string>>
Add;
275 std::vector<Located<std::string>>
Remove;
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++ -*-===//
Conditions in the CompileFlags block affect how a file is parsed.
std::vector< Located< std::string > > Remove
List of flags to remove from the compile command.
std::optional< Located< std::string > > Compiler
Override the compiler executable name to simulate.
std::vector< Located< std::string > > Add
List of flags to append to the compile command.
std::optional< Located< std::string > > CompilationDatabase
Directory to search for compilation database (compile_commands.json etc).
Describes code completion preferences.
std::optional< Located< bool > > AllScopes
Whether code completion should include suggestions from scopes that are not visible.
Controls how clang-tidy will run over the code base.
std::vector< Located< std::string > > Add
std::vector< Located< std::string > > Remove
List of checks to disable.
std::optional< Located< std::string > > FastCheckFilter
Whether to run checks that may slow down clangd.
std::vector< std::pair< Located< std::string >, Located< std::string > > > CheckOptions
A Key-Value pair list of options to pass to clang-tidy checks These take precedence over options spec...
Controls IncludeCleaner diagnostics.
std::optional< Located< bool > > AnalyzeAngledIncludes
If false (default), unused system headers will be ignored.
std::vector< Located< std::string > > IgnoreHeader
Regexes that will be used to avoid diagnosing certain includes as unused or missing.
Controls behavior of diagnostics (errors and warnings).
std::optional< Located< std::string > > MissingIncludes
Controls if clangd should analyze missing #include directives.
std::optional< Located< std::string > > UnusedIncludes
Controls how clangd will correct "unnecessary" #include directives.
std::vector< Located< std::string > > Suppress
Diagnostic codes that should be suppressed.
Describes hover preferences.
std::optional< Located< bool > > ShowAKA
Whether hover show a.k.a type.
Conditions in the If block restrict when a Fragment applies.
std::vector< Located< std::string > > PathExclude
The file being processed must not fully match a regular expression.
bool HasUnrecognizedCondition
An unrecognized key was found while parsing the condition.
std::vector< Located< std::string > > PathMatch
The file being processed must fully match a regular expression.
An external index uses data source outside of clangd itself.
std::optional< Located< std::string > > MountPoint
Source root governed by this index.
std::optional< Located< std::string > > Server
Address and port number for a clangd-index-server.
Located< bool > IsNone
Whether the block is explicitly set to None.
std::optional< Located< std::string > > File
Path to an index file generated by clangd-indexer.
Controls how clangd understands code outside the current file.
std::optional< Located< bool > > StandardLibrary
std::optional< Located< std::string > > Background
Whether files are built in the background to produce a project index.
std::optional< Located< ExternalBlock > > External
Configures labels shown inline with the code.
std::optional< Located< bool > > BlockEnd
Show defined symbol names at the end of a definition block.
std::optional< Located< bool > > Enabled
Enables/disables the inlay-hints feature.
std::optional< Located< bool > > Designators
Show designators in aggregate initialization.
std::optional< Located< bool > > ParameterNames
Show parameter names before function arguments.
std::optional< Located< bool > > DeducedTypes
Show deduced types for auto.
std::optional< Located< uint32_t > > TypeNameLimit
Limit the length of type name hints. (0 means no limit)
Configures semantic tokens that are produced by clangd.
std::vector< Located< std::string > > DisabledKinds
Disables clangd to produce semantic tokens for the given kinds.
std::vector< Located< std::string > > DisabledModifiers
Disables clangd to assign semantic tokens with the given modifiers.
These fields are not part of the user-specified configuration, but instead are populated by the parse...
bool Trusted
Whether this fragment is allowed to make critical security/privacy decisions.
std::string Directory
Absolute path to directory the fragment is associated with.
std::shared_ptr< llvm::SourceMgr > Manager
Retains a buffer of the original source this fragment was parsed from.
llvm::SMLoc Location
The start of the original source for this fragment.
std::vector< Located< std::string > > FullyQualifiedNamespaces
A chunk of configuration obtained from a config file, LSP, or elsewhere.
DiagnosticsBlock Diagnostics
CompiledFragment compile(DiagnosticCallback) &&
Analyzes and consumes this fragment, possibly yielding more diagnostics.
SemanticTokensBlock SemanticTokens
InlayHintsBlock InlayHints
CompileFlagsBlock CompileFlags
static std::vector< Fragment > parseYAML(llvm::StringRef YAML, llvm::StringRef BufferName, DiagnosticCallback)
Parses fragments from a YAML file (one from each — delimited document).
CompletionBlock Completion
An entity written in config along, with its optional location in the file.
const T * operator->() const
Located(T Value, llvm::SMRange Range={})
const T & operator*() const