Commit 79ec3b3c authored by Marco Bubke's avatar Marco Bubke

Clang: Fix CodeCompletionsExtractor

Setting a unsigned int to -1 is really stupid.

Change-Id: I43cd1ca1d92eed4a57575f21858a6ce50bcc4fe0
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent e016918e
...@@ -42,8 +42,6 @@ bool CodeCompletionsExtractor::next() ...@@ -42,8 +42,6 @@ bool CodeCompletionsExtractor::next()
{ {
const uint cxCodeCompleteResultCount = cxCodeCompleteResults->NumResults; const uint cxCodeCompleteResultCount = cxCodeCompleteResults->NumResults;
++cxCodeCompleteResultIndex;
if (cxCodeCompleteResultIndex < cxCodeCompleteResultCount) { if (cxCodeCompleteResultIndex < cxCodeCompleteResultCount) {
currentCxCodeCompleteResult = cxCodeCompleteResults->Results[cxCodeCompleteResultIndex]; currentCxCodeCompleteResult = cxCodeCompleteResults->Results[cxCodeCompleteResultIndex];
...@@ -58,6 +56,8 @@ bool CodeCompletionsExtractor::next() ...@@ -58,6 +56,8 @@ bool CodeCompletionsExtractor::next()
extractCompletionChunks(); extractCompletionChunks();
adaptPriority(); adaptPriority();
++cxCodeCompleteResultIndex;
return true; return true;
} }
...@@ -68,7 +68,7 @@ bool CodeCompletionsExtractor::peek(const Utf8String &name) ...@@ -68,7 +68,7 @@ bool CodeCompletionsExtractor::peek(const Utf8String &name)
{ {
const uint cxCodeCompleteResultCount = cxCodeCompleteResults->NumResults; const uint cxCodeCompleteResultCount = cxCodeCompleteResults->NumResults;
uint peekCxCodeCompleteResultIndex = cxCodeCompleteResultIndex + 1; uint peekCxCodeCompleteResultIndex = cxCodeCompleteResultIndex;
while (peekCxCodeCompleteResultIndex < cxCodeCompleteResultCount) { while (peekCxCodeCompleteResultIndex < cxCodeCompleteResultCount) {
if (hasText(name, cxCodeCompleteResults->Results[peekCxCodeCompleteResultIndex].CompletionString)) if (hasText(name, cxCodeCompleteResults->Results[peekCxCodeCompleteResultIndex].CompletionString))
......
...@@ -77,7 +77,7 @@ private: ...@@ -77,7 +77,7 @@ private:
CodeCompletion currentCodeCompletion_; CodeCompletion currentCodeCompletion_;
CXCompletionResult currentCxCodeCompleteResult; CXCompletionResult currentCxCodeCompleteResult;
CXCodeCompleteResults *cxCodeCompleteResults; CXCodeCompleteResults *cxCodeCompleteResults;
uint cxCodeCompleteResultIndex = -1; uint cxCodeCompleteResultIndex = 0;
}; };
std::ostream &operator<<(std::ostream &os, const CodeCompletionsExtractor &extractor); std::ostream &operator<<(std::ostream &os, const CodeCompletionsExtractor &extractor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment