LLVM 22.0.0git
llvm::lsp::CompletionItem Struct Reference

#include "llvm/Support/LSP/Protocol.h"

Public Member Functions

 CompletionItem ()=default
 CompletionItem (const Twine &label, CompletionItemKind kind, StringRef sortText="")

Public Attributes

std::string label
 The label of this completion item.
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.

Detailed Description

Definition at line 843 of file Protocol.h.

Constructor & Destructor Documentation

◆ CompletionItem() [1/2]

llvm::lsp::CompletionItem::CompletionItem ( )
default

◆ CompletionItem() [2/2]

llvm::lsp::CompletionItem::CompletionItem ( const Twine & label,
CompletionItemKind kind,
StringRef sortText = "" )
inline

Definition at line 845 of file Protocol.h.

References insertTextFormat, kind, label, llvm::lsp::PlainText, and sortText.

Member Data Documentation

◆ additionalTextEdits

std::vector<TextEdit> llvm::lsp::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 891 of file Protocol.h.

◆ deprecated

bool llvm::lsp::CompletionItem::deprecated = false

Indicates if this item is deprecated.

Definition at line 894 of file Protocol.h.

◆ detail

std::string llvm::lsp::CompletionItem::detail

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

Definition at line 860 of file Protocol.h.

◆ documentation

std::optional<MarkupContent> llvm::lsp::CompletionItem::documentation

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

Definition at line 863 of file Protocol.h.

◆ filterText

std::string llvm::lsp::CompletionItem::filterText

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

When falsy the label is used.

Definition at line 871 of file Protocol.h.

◆ insertText

std::string llvm::lsp::CompletionItem::insertText

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

When falsy the label is used.

Definition at line 875 of file Protocol.h.

◆ insertTextFormat

InsertTextFormat llvm::lsp::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 879 of file Protocol.h.

Referenced by CompletionItem().

◆ kind

CompletionItemKind llvm::lsp::CompletionItem::kind = CompletionItemKind::Missing

The kind of this completion item.

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

Definition at line 856 of file Protocol.h.

Referenced by CompletionItem().

◆ label

std::string llvm::lsp::CompletionItem::label

The label of this completion item.

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

Definition at line 852 of file Protocol.h.

Referenced by CompletionItem(), and llvm::lsp::operator<().

◆ sortText

std::string llvm::lsp::CompletionItem::sortText

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

When falsy the label is used.

Definition at line 867 of file Protocol.h.

Referenced by CompletionItem(), and llvm::lsp::operator<().

◆ textEdit

std::optional<TextEdit> llvm::lsp::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 886 of file Protocol.h.


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