clang-tools  8.0.0
Classes | Public Member Functions | Public Attributes | List of all members
clang::clangd::CodeCompleteOptions Struct Reference

#include <CodeComplete.h>

Collaboration diagram for clang::clangd::CodeCompleteOptions:
[legend]

Classes

struct  IncludeInsertionIndicator
 A visual indicator to prepend to the completion label to indicate whether completion result would trigger an #include insertion or not. More...
 

Public Member Functions

clang::CodeCompleteOptions getClangCompleteOpts () const
 Returns options that can be passed to clang's completion engine. More...
 

Public Attributes

bool EnableSnippets = false
 When true, completion items will contain expandable code snippets in completion (e.g. More...
 
bool IncludeCodePatterns = true
 Add code patterns to completion results. More...
 
bool IncludeMacros = true
 Add macros to code completion results. More...
 
bool IncludeComments = true
 Add comments to code completion results, if available. More...
 
bool IncludeIneligibleResults = false
 Include results that are not legal completions in the current context. More...
 
bool BundleOverloads = false
 Combine overloads into a single completion item where possible. More...
 
size_t Limit = 0
 Limit the number of results returned (0 means no limit). More...
 
struct clang::clangd::CodeCompleteOptions::IncludeInsertionIndicator IncludeIndicator
 
bool ShowOrigins = false
 Expose origins of completion items in the label (for debugging). More...
 
bool SpeculativeIndexRequest = false
 If set to true, this will send an asynchronous speculative index request, based on the index request for the last code completion on the same file and the filter text typed before the cursor, before sema code completion is invoked. More...
 
const SymbolIndexIndex = nullptr
 If Index is set, it is used to augment the code completion results. More...
 
bool IncludeFixIts = false
 Include completions that require small corrections, e.g. More...
 
bool EnableFunctionArgSnippets = true
 Whether to generate snippets for function arguments on code-completion. More...
 
bool AllScopes = false
 Whether to include index symbols that are not defined in the scopes visible from the code completion point. More...
 

Detailed Description

Definition at line 40 of file CodeComplete.h.

Member Function Documentation

◆ getClangCompleteOpts()

clang::CodeCompleteOptions clang::clangd::CodeCompleteOptions::getClangCompleteOpts ( ) const

Returns options that can be passed to clang's completion engine.

Definition at line 1571 of file CodeComplete.cpp.

References Index, and Result.

Member Data Documentation

◆ AllScopes

bool clang::clangd::CodeCompleteOptions::AllScopes = false

Whether to include index symbols that are not defined in the scopes visible from the code completion point.

This applies in contexts without explicit scope qualifiers.

Such completions can insert scope qualifiers.

Definition at line 111 of file CodeComplete.h.

◆ BundleOverloads

bool clang::clangd::CodeCompleteOptions::BundleOverloads = false

Combine overloads into a single completion item where possible.

Definition at line 65 of file CodeComplete.h.

◆ EnableFunctionArgSnippets

bool clang::clangd::CodeCompleteOptions::EnableFunctionArgSnippets = true

Whether to generate snippets for function arguments on code-completion.

Needs snippets to be enabled as well.

Definition at line 104 of file CodeComplete.h.

◆ EnableSnippets

bool clang::clangd::CodeCompleteOptions::EnableSnippets = false

When true, completion items will contain expandable code snippets in completion (e.g.

return ${1:expression} or `foo(${1:int a}, ${2:int b})).

Definition at line 47 of file CodeComplete.h.

◆ IncludeCodePatterns

bool clang::clangd::CodeCompleteOptions::IncludeCodePatterns = true

Add code patterns to completion results.

If EnableSnippets is false, this options is ignored and code patterns will always be omitted.

Definition at line 52 of file CodeComplete.h.

◆ IncludeComments

bool clang::clangd::CodeCompleteOptions::IncludeComments = true

Add comments to code completion results, if available.

Definition at line 58 of file CodeComplete.h.

◆ IncludeFixIts

bool clang::clangd::CodeCompleteOptions::IncludeFixIts = false

Include completions that require small corrections, e.g.

change '.' to '->' on member access etc.

Definition at line 100 of file CodeComplete.h.

◆ IncludeIndicator

struct clang::clangd::CodeCompleteOptions::IncludeInsertionIndicator clang::clangd::CodeCompleteOptions::IncludeIndicator

◆ IncludeIneligibleResults

bool clang::clangd::CodeCompleteOptions::IncludeIneligibleResults = false

Include results that are not legal completions in the current context.

For example, private members are usually inaccessible.

Definition at line 62 of file CodeComplete.h.

◆ IncludeMacros

bool clang::clangd::CodeCompleteOptions::IncludeMacros = true

Add macros to code completion results.

Definition at line 55 of file CodeComplete.h.

◆ Index

const SymbolIndex* clang::clangd::CodeCompleteOptions::Index = nullptr

If Index is set, it is used to augment the code completion results.

FIXME(ioeric): we might want a better way to pass the index around inside clangd.

Definition at line 96 of file CodeComplete.h.

◆ Limit

size_t clang::clangd::CodeCompleteOptions::Limit = 0

Limit the number of results returned (0 means no limit).

If more results are available, we set CompletionList.isIncomplete.

Definition at line 69 of file CodeComplete.h.

◆ ShowOrigins

bool clang::clangd::CodeCompleteOptions::ShowOrigins = false

Expose origins of completion items in the label (for debugging).

Definition at line 79 of file CodeComplete.h.

◆ SpeculativeIndexRequest

bool clang::clangd::CodeCompleteOptions::SpeculativeIndexRequest = false

If set to true, this will send an asynchronous speculative index request, based on the index request for the last code completion on the same file and the filter text typed before the cursor, before sema code completion is invoked.

This can reduce the code completion latency (by roughly latency of sema code completion) if the speculative request is the same as the one generated for the ongoing code completion from sema. As a sequence of code completions often have the same scopes and proximity paths etc, this should be effective for a number of code completions.

Definition at line 89 of file CodeComplete.h.


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