clang-tools  14.0.0git
Public Member Functions | Public Attributes | List of all members
clang::clangd::ClangdServer::Options Struct Reference

#include <ClangdServer.h>

Inheritance diagram for clang::clangd::ClangdServer::Options:
Inheritance graph
[legend]
Collaboration diagram for clang::clangd::ClangdServer::Options:
Collaboration graph
[legend]

Public Member Functions

 operator TUScheduler::Options () const
 

Public Attributes

unsigned AsyncThreadsCount = getDefaultAsyncThreadsCount()
 To process requests asynchronously, ClangdServer spawns worker threads. More...
 
ASTRetentionPolicy RetentionPolicy
 AST caching policy. The default is to keep up to 3 ASTs in memory. More...
 
bool StorePreamblesInMemory = true
 Cached preambles are potentially large. If false, store them on disk. More...
 
bool BuildDynamicSymbolIndex = false
 If true, ClangdServer builds a dynamic in-memory index for symbols in opened files and uses the index to augment code completion results. More...
 
bool BackgroundIndex = false
 If true, ClangdServer automatically indexes files in the current project on background threads. More...
 
SymbolIndexStaticIndex = nullptr
 If set, use this index to augment code completion results. More...
 
std::function< Context(PathRef)> ContextProvider
 If set, queried to derive a processing context for some work. More...
 
TidyProviderRef ClangTidyProvider
 The Options provider to use when running clang-tidy. More...
 
llvm::Optional< std::string > WorkspaceRoot
 Clangd's workspace root. More...
 
llvm::Optional< std::string > ResourceDir = llvm::None
 The resource directory is used to find internal headers, overriding defaults and -resource-dir compiler flag). More...
 
DebouncePolicy UpdateDebounce
 Time to wait after a new file version before computing diagnostics. More...
 
bool ImplicitCancellation = true
 Cancel certain requests if the file changes before they begin running. More...
 
std::vector< std::string > QueryDriverGlobs
 Clangd will execute compiler drivers matching one of these globs to fetch system include path. More...
 
bool FoldingRanges = false
 Enable preview of FoldingRanges feature. More...
 
FeatureModuleSetFeatureModules = nullptr
 

Detailed Description

Definition at line 99 of file ClangdServer.h.

Member Function Documentation

◆ operator TUScheduler::Options()

clang::clangd::ClangdServer::Options::operator TUScheduler::Options ( ) const
explicit

Definition at line 143 of file ClangdServer.cpp.

Member Data Documentation

◆ AsyncThreadsCount

unsigned clang::clangd::ClangdServer::Options::AsyncThreadsCount = getDefaultAsyncThreadsCount()

To process requests asynchronously, ClangdServer spawns worker threads.

If this is zero, no threads are spawned. All work is done on the calling thread, and callbacks are invoked before "async" functions return.

Definition at line 103 of file ClangdServer.h.

◆ BackgroundIndex

bool clang::clangd::ClangdServer::Options::BackgroundIndex = false

If true, ClangdServer automatically indexes files in the current project on background threads.

The index is stored in the project root.

Definition at line 116 of file ClangdServer.h.

◆ BuildDynamicSymbolIndex

bool clang::clangd::ClangdServer::Options::BuildDynamicSymbolIndex = false

If true, ClangdServer builds a dynamic in-memory index for symbols in opened files and uses the index to augment code completion results.

Definition at line 113 of file ClangdServer.h.

◆ ClangTidyProvider

TidyProviderRef clang::clangd::ClangdServer::Options::ClangTidyProvider

The Options provider to use when running clang-tidy.

If null, clang-tidy checks will be disabled.

Definition at line 134 of file ClangdServer.h.

◆ ContextProvider

std::function<Context(PathRef)> clang::clangd::ClangdServer::Options::ContextProvider

If set, queried to derive a processing context for some work.

Usually used to inject Config (see createConfiguredContextProvider).

When the provider is called, the active context will be that inherited from the request (e.g. addDocument()), or from the ClangdServer constructor if there is no such request (e.g. background indexing).

The path is an absolute path of the file being processed. If there is no particular file (e.g. project loading) then it is empty.

Definition at line 130 of file ClangdServer.h.

◆ FeatureModules

FeatureModuleSet* clang::clangd::ClangdServer::Options::FeatureModules = nullptr

Definition at line 167 of file ClangdServer.h.

◆ FoldingRanges

bool clang::clangd::ClangdServer::Options::FoldingRanges = false

Enable preview of FoldingRanges feature.

Definition at line 165 of file ClangdServer.h.

◆ ImplicitCancellation

bool clang::clangd::ClangdServer::Options::ImplicitCancellation = true

Cancel certain requests if the file changes before they begin running.

This is useful for "transient" actions like enumerateTweaks that were likely implicitly generated, and avoids redundant work if clients forget to cancel. Clients that always cancel stale requests should clear this.

Definition at line 158 of file ClangdServer.h.

◆ QueryDriverGlobs

std::vector<std::string> clang::clangd::ClangdServer::Options::QueryDriverGlobs

Clangd will execute compiler drivers matching one of these globs to fetch system include path.

Definition at line 162 of file ClangdServer.h.

◆ ResourceDir

llvm::Optional<std::string> clang::clangd::ClangdServer::Options::ResourceDir = llvm::None

The resource directory is used to find internal headers, overriding defaults and -resource-dir compiler flag).

If None, ClangdServer calls CompilerInvocation::GetResourcePath() to obtain the standard resource directory.

Definition at line 145 of file ClangdServer.h.

◆ RetentionPolicy

ASTRetentionPolicy clang::clangd::ClangdServer::Options::RetentionPolicy

AST caching policy. The default is to keep up to 3 ASTs in memory.

Definition at line 106 of file ClangdServer.h.

◆ StaticIndex

SymbolIndex* clang::clangd::ClangdServer::Options::StaticIndex = nullptr

If set, use this index to augment code completion results.

Definition at line 119 of file ClangdServer.h.

◆ StorePreamblesInMemory

bool clang::clangd::ClangdServer::Options::StorePreamblesInMemory = true

Cached preambles are potentially large. If false, store them on disk.

Definition at line 109 of file ClangdServer.h.

◆ UpdateDebounce

DebouncePolicy clang::clangd::ClangdServer::Options::UpdateDebounce
Initial value:
= DebouncePolicy{
std::chrono::milliseconds(50),
std::chrono::milliseconds(500),
1,
}

Time to wait after a new file version before computing diagnostics.

Definition at line 148 of file ClangdServer.h.

◆ WorkspaceRoot

llvm::Optional<std::string> clang::clangd::ClangdServer::Options::WorkspaceRoot

Clangd's workspace root.

Relevant for "workspace" operations not bound to a particular file. FIXME: If not set, should use the current working directory.

Definition at line 139 of file ClangdServer.h.


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