Patch #3440 2013-03-12 16:37
p2rkw
allow CC to recognize function call inside parentheses- Download
- 3440-allow_CC_to_re.patch (501 bytes)
Index: src/plugins/codecompletion/nativeparser_base.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser_base.cpp (wersja 8909)
+++ src/plugins/codecompletion/nativeparser_base.cpp (kopia robocza)
@@ -621,6 +621,8 @@
while ( (nest > 0)
&& (startAt < line.Len()) )
{
+ if (line.GetChar(startAt) == '(')
+ ++nest;
if (line.GetChar(startAt) == ')')
--nest;
++startAt;
History
test case:
struct C
{
int c;
};
C* getC() {/*...*/}
(*getC()).|
Does not work with compound resolution:
struct C
{
int c;
};
class A
{
public: static C* getC() {/*...*/}
};
(A::getC()).|
Sometimes, I think such things are a bit hard the handle, we can have proposed ways: 1, use a parser generator, like bison, and parse the statement, and build a symbol tree of the statement, then do some symbol lookup. This is the way currently used in GDB. GDB can handle "print (A::getC()).", also GDB can give completion list when you hit the TAB key.
2, we use a hand written parser by ourselves, like a operator precedence parser, then build a symbol tree, did the same thing as the first way.
Committed.
Simple resolution works (with no noticeable side effects); compound resolution is a project for the future.