clang-tools  16.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
clang::clangd::Config Struct Reference

Settings that express user/project preferences and control clangd behavior. More...

#include <Config.h>

Collaboration diagram for clang::clangd::Config:
Collaboration graph
[legend]

Classes

struct  CDBSearchSpec
 
struct  ExternalIndexSpec
 Describes an external index configuration. More...
 

Public Types

enum  BackgroundPolicy { BackgroundPolicy::Build, BackgroundPolicy::Skip }
 
enum  UnusedIncludesPolicy { Strict, None }
 

Public Member Functions

 Config ()=default
 
 Config (const Config &)=delete
 
Configoperator= (const Config &)=delete
 
 Config (Config &&)=default
 
Configoperator= (Config &&)=default
 

Static Public Member Functions

static const Configcurrent ()
 Returns the Config of the current Context, or an empty configuration. More...
 

Public Attributes

struct {
   std::vector< llvm::unique_function< void(std::vector< std::string > &) const > >   Edits
 Edits to apply to the compile command, in sequence. More...
 
   CDBSearchSpec   CDBSearch = {CDBSearchSpec::Ancestors, llvm::None}
 Where to search for compilation databases for this file's flags. More...
 
CompileFlags
 Controls how the compile command for the current file is determined. More...
 
struct {
   BackgroundPolicy   Background = BackgroundPolicy::Build
 Whether this TU should be background-indexed. More...
 
   ExternalIndexSpec   External
 
   bool   StandardLibrary = false
 
Index
 Controls index behavior. More...
 
struct {
   bool   SuppressAll = false
 
   llvm::StringSet   Suppress
 
   struct {
      std::string   Checks
 
      llvm::StringMap< std::string >   CheckOptions
 
   }   ClangTidy
 Configures what clang-tidy checks to run and options to use with them. More...
 
   UnusedIncludesPolicy   UnusedIncludes = None
 
   struct {
      std::vector< std::function< bool(llvm::StringRef)> >   IgnoreHeader
 
   }   Includes
 IncludeCleaner will not diagnose usages of these headers matched by these regexes. More...
 
Diagnostics
 Controls warnings and errors when parsing code. More...
 
struct {
   std::vector< std::string >   FullyQualifiedNamespaces
 
Style
 Style of the codebase. More...
 
struct {
   bool   AllScopes = true
 Whether code completion includes results that are not visible in current scopes. More...
 
Completion
 Configures code completion feature. More...
 
struct {
   bool   ShowAKA = true
 Whether hover show a.k.a type. More...
 
Hover
 Configures hover feature. More...
 
struct {
   bool   Enabled = true
 If false, inlay hints are completely disabled. More...
 
   bool   Parameters = true
 
   bool   DeducedTypes = true
 
   bool   Designators = true
 
InlayHints
 

Static Public Attributes

static clangd::Key< ConfigKey
 Context key which can be used to set the current Config. More...
 

Detailed Description

Settings that express user/project preferences and control clangd behavior.

Generally, features should consume Config::current() and the caller is responsible for setting it appropriately. In practice these callers are ClangdServer, TUScheduler, and BackgroundQueue.

Definition at line 44 of file Config.h.

Member Enumeration Documentation

◆ BackgroundPolicy

Enumerator
Build 
Skip 

Definition at line 71 of file Config.h.

◆ UnusedIncludesPolicy

Enumerator
Strict 
None 

Definition at line 91 of file Config.h.

Constructor & Destructor Documentation

◆ Config() [1/3]

clang::clangd::Config::Config ( )
default

◆ Config() [2/3]

clang::clangd::Config::Config ( const Config )
delete

◆ Config() [3/3]

clang::clangd::Config::Config ( Config &&  )
default

Member Function Documentation

◆ current()

const Config & clang::clangd::Config::current ( )
static

Returns the Config of the current Context, or an empty configuration.

Definition at line 17 of file Config.cpp.

References C, and clang::clangd::Context::current().

Referenced by clang::clangd::DirectoryBasedGlobalCompilationDatabase::BroadcastThread::Filter::filter().

◆ operator=() [1/2]

Config& clang::clangd::Config::operator= ( Config &&  )
default

◆ operator=() [2/2]

Config& clang::clangd::Config::operator= ( const Config )
delete

Member Data Documentation

◆ AllScopes

bool clang::clangd::Config::AllScopes = true

Whether code completion includes results that are not visible in current scopes.

Definition at line 125 of file Config.h.

◆ Background

BackgroundPolicy clang::clangd::Config::Background = BackgroundPolicy::Build

Whether this TU should be background-indexed.

Definition at line 86 of file Config.h.

◆ CDBSearch

CDBSearchSpec clang::clangd::Config::CDBSearch = {CDBSearchSpec::Ancestors, llvm::None}

Where to search for compilation databases for this file's flags.

Definition at line 68 of file Config.h.

Referenced by clang::clangd::DirectoryBasedGlobalCompilationDatabase::BroadcastThread::Filter::filter().

◆ CheckOptions

llvm::StringMap<std::string> clang::clangd::Config::CheckOptions

Definition at line 101 of file Config.h.

◆ Checks

std::string clang::clangd::Config::Checks

Definition at line 100 of file Config.h.

◆ ClangTidy

struct { ... } clang::clangd::Config::ClangTidy

Configures what clang-tidy checks to run and options to use with them.

◆ CompileFlags

struct { ... } clang::clangd::Config::CompileFlags

Controls how the compile command for the current file is determined.

Referenced by clang::clangd::DirectoryBasedGlobalCompilationDatabase::BroadcastThread::Filter::filter().

◆ Completion

struct { ... } clang::clangd::Config::Completion

Configures code completion feature.

◆ DeducedTypes

bool clang::clangd::Config::DeducedTypes = true

Definition at line 140 of file Config.h.

◆ Designators

bool clang::clangd::Config::Designators = true

Definition at line 141 of file Config.h.

◆ Diagnostics

struct { ... } clang::clangd::Config::Diagnostics

Controls warnings and errors when parsing code.

◆ Edits

std::vector<llvm::unique_function<void(std::vector<std::string> &) const> > clang::clangd::Config::Edits

Edits to apply to the compile command, in sequence.

Definition at line 66 of file Config.h.

◆ Enabled

bool clang::clangd::Config::Enabled = true

If false, inlay hints are completely disabled.

Definition at line 136 of file Config.h.

◆ External

ExternalIndexSpec clang::clangd::Config::External

Definition at line 87 of file Config.h.

◆ FullyQualifiedNamespaces

std::vector<std::string> clang::clangd::Config::FullyQualifiedNamespaces

Definition at line 118 of file Config.h.

◆ Hover

struct { ... } clang::clangd::Config::Hover

Configures hover feature.

◆ IgnoreHeader

std::vector<std::function<bool(llvm::StringRef)> > clang::clangd::Config::IgnoreHeader

Definition at line 109 of file Config.h.

◆ Includes

struct { ... } clang::clangd::Config::Includes

IncludeCleaner will not diagnose usages of these headers matched by these regexes.

◆ Index

struct { ... } clang::clangd::Config::Index

Controls index behavior.

◆ InlayHints

struct { ... } clang::clangd::Config::InlayHints

◆ Key

Key< Config > clang::clangd::Config::Key
static

Context key which can be used to set the current Config.

Definition at line 48 of file Config.h.

◆ Parameters

bool clang::clangd::Config::Parameters = true

Definition at line 139 of file Config.h.

◆ ShowAKA

bool clang::clangd::Config::ShowAKA = true

Whether hover show a.k.a type.

Definition at line 131 of file Config.h.

◆ StandardLibrary

bool clang::clangd::Config::StandardLibrary = false

Definition at line 88 of file Config.h.

◆ Style

struct { ... } clang::clangd::Config::Style

Style of the codebase.

◆ Suppress

llvm::StringSet clang::clangd::Config::Suppress

Definition at line 95 of file Config.h.

◆ SuppressAll

bool clang::clangd::Config::SuppressAll = false

Definition at line 94 of file Config.h.

◆ UnusedIncludes

UnusedIncludesPolicy clang::clangd::Config::UnusedIncludes = None

Definition at line 104 of file Config.h.


The documentation for this struct was generated from the following files: