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)
Category
Plugin::Bugfix
Status
Accepted
Close date
2013-04-23 21:22
Assigned to
alpha0010
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;
p2rkw 2013-03-12 16:52

test case:

struct C

{

int c;

};

C* getC() {/*...*/}

(*getC()).|

alpha0010 2013-04-14 00:13

Does not work with compound resolution:

struct C

{

int c;

};

class A

{

public: static C* getC() {/*...*/}

};

(A::getC()).|

ollydbg 2013-04-22 14:03

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.

alpha0010 2013-04-23 21:22

Committed.

Simple resolution works (with no noticeable side effects); compound resolution is a project for the future.