Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Global static objects ignored by CC

(1/1)

ptDev:
I noticed just now that code completion is very thorough while analysing the scope of declared objects, but to the extreme of ignoring global static objects. Is this behaviour intentional?

ollydbg:

--- Quote from: ptDev on April 29, 2010, 12:22:23 am ---I noticed just now that code completion is very thorough while analysing the scope of declared objects, but to the extreme of ignoring global static objects. Is this behaviour intentional?

--- End quote ---
Ok, I don't fully understand what's your meaning. Can you give a simple test code?

eg:


--- Code: ---//global static objects
static int aaa;

--- End code ---
???

BTW:The parserthread.cpp do the whole "syntax analyze" job, and this file is quite easy to understand.

MortenMacFly:
Probably you should start with telling us the version of C::B you are using.

ptDev:

--- Quote from: MortenMacFly on April 29, 2010, 06:28:05 am ---Probably you should start with telling us the version of C::B you are using.

--- End quote ---

I apoplogize, I wrote this quite late last night, and was a bit too tired to explain properly.

I am running Code::Blocks svn revision 6202, built with MinGW-TDM 4.4.1-2 and wxWidgets 2.8.10.
The code which CC didn't parse properly was something similar to:


--- Code: ---#include "myarray.h"
#include "myclass.h"

static myspace::myarray a;  // Global static objects typed before any myclass member functions
static myspace::myarray b;

// ...

void myclass::method()
{
   a.  // ... <-- Here, I typed the access operator, but the CC member list did not appear

}

--- End code ---

However, declaring local objects from the same namespace and class resulted in the expected behaviour:


--- Code: ---void myclass::method()
{
   myspace::myarray a;
   a.  // ... <-- Here, the CC member list appeared normally

}

--- End code ---

If I switched between ommiting the local object or not, so would the CC tooltip disappear or reappear.

ollydbg:
Ok, I have just test the sample code like below with our parserTest project.


--- Code: ---namespace myspace {

class myarray{
public:
int m_aaa;
}

};

 myspace::myarray a;  // Global static objects typed before any myclass member functions
 myspace::myarray b;
--- End code ---

And the output of the parser is like below:

--- Code: ---...

000058. namespace namespace myspace {...} [1,1]
000059. class class myarray {...} [3,0]
000060. variable int myspace::myarray::m_aaa [5,0]
000061. variable myarray myspace::a [10,0]
000062. variable myarray myspace::b [11,0]

--- End code ---

And if I add the "static" before the statement, I found that the parser give the same result:

--- Code: ---...
--------------L-i-s-t--L-o-g--------------

000060. namespace namespace myspace {...} [1,1]
000061. class class myarray {...} [3,0]
000062. variable int myspace::myarray::m_aaa [5,0]
000063. variable myarray myspace::a [10,0]
000064. variable myarray myspace::b [11,0]

--- End code ---

So, as a conclusion, I think parser works as expected. So, maybe there's a bug in other part of CC.  :D

Navigation

[0] Message Index

Go to full version