edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::TextAutoCompleteItem Class Reference

An autocomplete item that is being returned Currently simply a string. It is placed in a separate class for future extensions (LSP: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#textDocument_completion) More...

#include <textautocompleteprovider.h>

+ Collaboration diagram for edbee::TextAutoCompleteItem:

Public Member Functions

 TextAutoCompleteItem (const QString &label, const int kind=0, const QString &detail="", const QString &documentation="")
 
QString label () const
 returns the autocmomplete label
 
int kind () const
 
QString detail () const
 
QString documentation () const
 
int matchLabelScore (TextDocument *document, const TextRange &range, const QString &word)
 Compares the given text-autocomplete item with the label This method should return a match score, where a score of 0 means NO match.
 

Protected Attributes

QString label_
 
int kind_
 
QString detail_
 
QString documentation_
 

Detailed Description

An autocomplete item that is being returned Currently simply a string. It is placed in a separate class for future extensions (LSP: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#textDocument_completion)

Constructor & Destructor Documentation

◆ TextAutoCompleteItem()

edbee::TextAutoCompleteItem::TextAutoCompleteItem ( const QString & label,
const int kind = 0,
const QString & detail = "",
const QString & documentation = "" )
Parameters
kindthe kind of autocomplete items (Use a Langserver constant)

Member Function Documentation

◆ detail()

QString edbee::TextAutoCompleteItem::detail ( ) const

◆ documentation()

QString edbee::TextAutoCompleteItem::documentation ( ) const

◆ kind()

int edbee::TextAutoCompleteItem::kind ( ) const

◆ label()

QString edbee::TextAutoCompleteItem::label ( ) const

returns the autocmomplete label

◆ matchLabelScore()

int edbee::TextAutoCompleteItem::matchLabelScore ( TextDocument * document,
const TextRange & range,
const QString & word )

Compares the given text-autocomplete item with the label This method should return a match score, where a score of 0 means NO match.

Returns a copy of the str string. The given string is converted to Unicode using the fromUtf8() function.

See also
fromLatin1(), fromLocal8Bit(), fromUtf8(), QByteArray::fromStdString()

For now a simple prefix-prefix search. Later fuzzy search. Inspiration:

Member Data Documentation

◆ detail_

QString edbee::TextAutoCompleteItem::detail_
protected

◆ documentation_

QString edbee::TextAutoCompleteItem::documentation_
protected

◆ kind_

int edbee::TextAutoCompleteItem::kind_
protected

◆ label_

QString edbee::TextAutoCompleteItem::label_
protected

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