forked from qt-creator/qt-creator
Clang: Flatten code completion chunks
Avoid the sub vector for performance reason and use an flag for every optional argument because there can be no recursion. Change-Id: Iae1eaa1f164e4129e30358a1719582e5231f0385 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -49,7 +49,7 @@ class CMBIPC_EXPORT CodeCompletionChunk
|
||||
friend CMBIPC_EXPORT bool operator==(const CodeCompletionChunk &first, const CodeCompletionChunk &second);
|
||||
|
||||
public:
|
||||
enum Kind : quint32 {
|
||||
enum Kind : quint8 {
|
||||
Optional,
|
||||
TypedText,
|
||||
Text,
|
||||
@@ -71,25 +71,25 @@ public:
|
||||
Equal,
|
||||
HorizontalSpace,
|
||||
VerticalSpace,
|
||||
Invalid = 255};
|
||||
Invalid = 255
|
||||
};
|
||||
|
||||
CodeCompletionChunk();
|
||||
CodeCompletionChunk() = default;
|
||||
CodeCompletionChunk(Kind kind,
|
||||
const Utf8String &text,
|
||||
const CodeCompletionChunks &optionalChunks = CodeCompletionChunks());
|
||||
bool isOptional = false);
|
||||
|
||||
Kind kind() const;
|
||||
const Utf8String &text() const;
|
||||
const CodeCompletionChunks &optionalChunks() const;
|
||||
bool isOptional() const;
|
||||
|
||||
private:
|
||||
quint32 &kindAsInt();
|
||||
quint8 &kindAsInt();
|
||||
|
||||
private:
|
||||
Utf8String text_;
|
||||
CodeCompletionChunks optionalChunks_;
|
||||
Kind kind_ = Invalid;
|
||||
|
||||
bool isOptional_ = false;
|
||||
};
|
||||
|
||||
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CodeCompletionChunk &chunk);
|
||||
|
||||
Reference in New Issue
Block a user