The code completion tooltip does not seem to recognize C++11 initializer lists. You can see from the attached image that it is miscounting the commas.
Tickets: #385
diff --git a/src/plugins/codecompletion/nativeparser.cpp b/src/plugins/codecompletion/nativeparser.cpp index b1f0592..3a2c630 100644 --- a/src/plugins/codecompletion/nativeparser.cpp +++ b/src/plugins/codecompletion/nativeparser.cpp @@ -890,6 +890,7 @@ int NativeParser::GetCallTips(wxArrayString& items, int& typedCommas, cbEditor* if (pos == wxNOT_FOUND) pos = searchData.control->GetCurrentPos(); int nest = 0; + int nestInit = 0; // C++11 initializer lists while (--pos > 0) { const int style = searchData.control->GetStyleAt(pos); @@ -905,7 +906,7 @@ int NativeParser::GetCallTips(wxArrayString& items, int& typedCommas, cbEditor* return wxSCI_INVALID_POSITION; else if (ch == _T(',')) { - if (nest == 0) + if (nest == 0 && nestInit == 0) ++commas; } else if (ch == _T(')')) @@ -916,6 +917,13 @@ int NativeParser::GetCallTips(wxArrayString& items, int& typedCommas, cbEditor* if (nest > 0) break; } + else if (nest == 0) + { + if (ch == _T('{')) + ++nestInit; + else if (ch == _T('}')) + --nestInit; + } }// while // strip un-wanted
Probably handles this specific case, but our parser has more issues than just that: http://en.wikipedia.org/wiki/C%2B%2B11#Initializer_lists
Another similar report here: Re: C++11 code completion (CC) doesn't work with list-initialization
Code::Blocks / Tickets / #706 C++ parser doesn't comply with bracket initialization is marked as duplicated of this ticket.
Looks to be the same as ticket 385.
Log in to post a comment.
Probably handles this specific case, but our parser has more issues than just that: http://en.wikipedia.org/wiki/C%2B%2B11#Initializer_lists
Another similar report here: Re: C++11 code completion (CC) doesn't work with list-initialization
Code::Blocks / Tickets / #706 C++ parser doesn't comply with bracket initialization is marked as duplicated of this ticket.
Looks to be the same as ticket 385.