clang-tools 19.0.0git
Public Attributes | List of all members
clang::clangd::CompletionItem Struct Reference

#include <Protocol.h>

Public Attributes

std::string label
 The label of this completion item.
 
std::optional< CompletionItemLabelDetailslabelDetails
 Additional details for the label.
 
CompletionItemKind kind = CompletionItemKind::Missing
 The kind of this completion item.
 
std::string detail
 A human-readable string with additional information about this item, like type or symbol information.
 
std::optional< MarkupContentdocumentation
 A human-readable string that represents a doc-comment.
 
std::string sortText
 A string that should be used when comparing this item with other items.
 
std::string filterText
 A string that should be used when filtering a set of completion items.
 
std::string insertText
 A string that should be inserted to a document when selecting this completion.
 
InsertTextFormat insertTextFormat = InsertTextFormat::Missing
 The format of the insert text.
 
std::optional< TextEdittextEdit
 An edit which is applied to a document when selecting this completion.
 
std::vector< TextEditadditionalTextEdits
 An optional array of additional text edits that are applied when selecting this completion.
 
bool deprecated = false
 Indicates if this item is deprecated.
 
float score = 0.f
 The score that clangd calculates to rank the returned completions.
 

Detailed Description

Definition at line 1288 of file Protocol.h.

Member Data Documentation

◆ additionalTextEdits

std::vector<TextEdit> clang::clangd::CompletionItem::additionalTextEdits

An optional array of additional text edits that are applied when selecting this completion.

Edits must not overlap with the main edit nor with themselves.

Definition at line 1333 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ deprecated

bool clang::clangd::CompletionItem::deprecated = false

Indicates if this item is deprecated.

Definition at line 1336 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ detail

std::string clang::clangd::CompletionItem::detail

A human-readable string with additional information about this item, like type or symbol information.

Definition at line 1302 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ documentation

std::optional<MarkupContent> clang::clangd::CompletionItem::documentation

A human-readable string that represents a doc-comment.

Definition at line 1305 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ filterText

std::string clang::clangd::CompletionItem::filterText

A string that should be used when filtering a set of completion items.

When falsy the label is used.

Definition at line 1313 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ insertText

std::string clang::clangd::CompletionItem::insertText

A string that should be inserted to a document when selecting this completion.

When falsy the label is used.

Definition at line 1317 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ insertTextFormat

InsertTextFormat clang::clangd::CompletionItem::insertTextFormat = InsertTextFormat::Missing

The format of the insert text.

The format applies to both the insertText property and the newText property of a provided textEdit.

Definition at line 1321 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ kind

CompletionItemKind clang::clangd::CompletionItem::kind = CompletionItemKind::Missing

The kind of this completion item.

Based of the kind an icon is chosen by the editor.

Definition at line 1298 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ label

std::string clang::clangd::CompletionItem::label

The label of this completion item.

By default also the text that is inserted when selecting this completion.

Definition at line 1291 of file Protocol.h.

Referenced by clang::clangd::operator<(), clang::clangd::operator<<(), and clang::clangd::CodeCompletion::render().

◆ labelDetails

std::optional<CompletionItemLabelDetails> clang::clangd::CompletionItem::labelDetails

Additional details for the label.

Definition at line 1294 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ score

float clang::clangd::CompletionItem::score = 0.f

The score that clangd calculates to rank the returned completions.

This excludes the fuzzy-match between filterText and the partial word. This can be used to re-rank results as the user types, using client-side fuzzy-matching (that score should be multiplied with this one). This is a clangd extension.

Definition at line 1343 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().

◆ sortText

std::string clang::clangd::CompletionItem::sortText

A string that should be used when comparing this item with other items.

When falsy the label is used.

Definition at line 1309 of file Protocol.h.

Referenced by clang::clangd::operator<(), and clang::clangd::CodeCompletion::render().

◆ textEdit

std::optional<TextEdit> clang::clangd::CompletionItem::textEdit

An edit which is applied to a document when selecting this completion.

When an edit is provided insertText is ignored.

Note: The range of the edit must be a single line range and it must contain the position at which completion has been requested.

Definition at line 1328 of file Protocol.h.

Referenced by clang::clangd::CodeCompletion::render().


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