forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompletionItem.h
More file actions
91 lines (82 loc) · 3.21 KB
/
CompletionItem.h
File metadata and controls
91 lines (82 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef COMPLETIONITEM_H
#define COMPLETIONITEM_H
#include "LSP/JSONObject.h"
#include "LSP/basic_types.h"
#include <memory>
#include <vector>
namespace LSP
{
class WXDLLIMPEXP_CL CompletionItem : public Serializable
{
wxString m_label;
int m_kind = wxNOT_FOUND;
wxString m_detail;
MarkupContent m_documentation;
wxString m_filterText;
wxString m_insertText;
wxString m_insertTextFormat;
std::shared_ptr<LSP::TextEdit> m_textEdit;
std::vector<std::shared_ptr<TextEdit>> m_vAdditionalText;
public:
enum eTriggerKind {
kTriggerUnknown = -1,
kTriggerKindInvoked = 1, // Completion was triggered by typing an identifier (24x7 code complete)
kTriggerCharacter = 2, // Completion was triggered by a trigger character (e.g. ".")
kTriggerForIncompleteCompletions = 3, // user internally
kTriggerUser = 4, // manual invocation (e.g Ctrl+Space)
};
enum eCompletionItemKind {
kKindText = 1,
kKindMethod = 2,
kKindFunction = 3,
kKindConstructor = 4,
kKindField = 5,
kKindVariable = 6,
kKindClass = 7,
kKindInterface = 8,
kKindModule = 9,
kKindProperty = 10,
kKindUnit = 11,
kKindValue = 12,
kKindEnum = 13,
kKindKeyword = 14,
kKindSnippet = 15,
kKindColor = 16,
kKindFile = 17,
kKindReference = 18,
kKindFolder = 19,
kKindEnumMember = 20,
kKindConstant = 21,
kKindStruct = 22,
kKindEvent = 23,
kKindOperator = 24,
kKindTypeParameter = 25,
};
public:
using Ptr_t = std::shared_ptr<CompletionItem>;
using Vec_t = std::vector<CompletionItem::Ptr_t>;
public:
CompletionItem() = default;
~CompletionItem() override = default;
JSONItem ToJSON() const override;
void FromJSON(const JSONItem& json) override;
void SetDetail(const wxString& detail) { this->m_detail = detail; }
void SetDocumentation(const MarkupContent& documentation) { this->m_documentation = documentation; }
void SetFilterText(const wxString& filterText) { this->m_filterText = filterText; }
void SetInsertText(const wxString& insertText) { this->m_insertText = insertText; }
void SetKind(int kind) { this->m_kind = kind; }
void SetLabel(const wxString& label) { this->m_label = label; }
const wxString& GetDetail() const { return m_detail; }
const MarkupContent& GetDocumentation() const { return m_documentation; }
const wxString& GetFilterText() const { return m_filterText; }
const wxString& GetInsertText() const { return m_insertText; }
int GetKind() const { return m_kind; }
const wxString& GetLabel() const { return m_label; }
std::shared_ptr<LSP::TextEdit> GetTextEdit() { return m_textEdit; }
bool HasTextEdit() const { return m_textEdit != nullptr; }
void SetInsertTextFormat(const wxString& insertTextFormat) { this->m_insertTextFormat = insertTextFormat; }
const wxString& GetInsertTextFormat() const { return m_insertTextFormat; }
const std::vector<std::shared_ptr<TextEdit>>& GetAdditionalText() const { return m_vAdditionalText; }
};
} // namespace LSP
#endif // COMPLETIONITEM_H