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

New code completion remarks/issues

(1/54) > >>

killerbot:
Shortly in a nightly build the new code completion engine will be available.
One can already get it from svn.

This thread is the start base to discuss issues.

killerbot:
I have several classes with several members and methods, and I don't get any completion at all.
All members start with "m_", none of them work, calling the other member methods from within a member method same story. In the Symbols browser the classes are shown correctly !!!

I think i has something to do with namespace.

Example :
I have class CStop in the namespace vipnt. That class has a member m_Angle (amongst other) and (amongst other) the following method "Configure", but no completion on either.
However when I start typing like this in a member method of this class, I do get completions.


--- Quote ---   vipnt::CStop::Configure
   vipnt::CStop::m_Angle

--- End quote ---

Note when I to "ctr-space" I see a lot of things, but the moment I start typing m_ there are already no more matches in the list.

killerbot:
Here's a reduced testing example showing the issue. (just add the 2 files to the dummy console application you get from the CB project wizard)

1) create Stop.h with the following content :

--- Code: ---#ifndef _STOP_H_INCLUDE
#define _STOP_H_INCLUDE

namespace vipnt
{

class CStop
{
public:
void RePaint();
bool HasWork() const;

private:

int* m_Angle;
int* m_Variance;
};

} // namespace vipnt
#endif // _STOP_H_INCLUDE

--- End code ---

2) create Stop.cpp with the following content :

--- Code: ---#include "Stop.h"

namespace vipnt
{

namespace
{
const int NumberOfZones = 6;
} // namespace


bool CStop::HasWork() const
{
return true;
} // end of HasWork

void CStop::RePaint()
{
} // end of RePaint

} // namespace vipnt

--- End code ---

go into RePaint and try :
 m_Angle : no completion
 HasWork no completion
 ctrl-space  nothing to find in there that starts with m_

Now remove in the cpp file the anonymous namespace (declaring the constant) and everything will work.

EDIT : when I moved the anonymous namespace in front of the vipnt namespace in the cpp file then again it works.
Nesting seems to introduce issues.

killerbot:
other interesting things to note. Look at the code completion toolbar, the read only field at the left.

enter the vipnt namespace --> vipnt
enter the anonymous (nested) --> vipnt
enter CStop::HasWork()  --> CStop !!!!!!!!!!!!!!!!!!!
enter CStop::RePaint()  --> CStop  !!!!!!!!!!!!!!!!!!!

NOW : move the anonyous namespace between the HasWork en RePaint methods.

enter the vipnt namespace --> vipnt
enter CStop::HasWork()  --> vipnt::CStop
enter the anonymous (nested) --> vipnt
enter CStop::RePaint()  --> vipnt::CStop

This gives better things in the toolbar, and it also brings back the completion.

Strange, strange, strange.


OPEN  QUESTION : could it have to do with one namespace being immediately nested after the start of another namespace

--- Code: ---namespace vipnt
{

namespace
{
const int NumberOfZones = 6;
}

...

--- End code ---

oBFusCATed:
I have been wondering lately,
why not add some kind of functionality/application test for the code completion.
Parsing is one of the areas that allow easy testing.
The benefits of the testing (obvious to many I'm sure) are:
1. You get instant answer if your change is correct or you add new test, so other don't break you code later
2. The behavior of the code is documented through the test
3. Users are happier, because of less bugs
4. Developers are braver when they refactor, because they have a safety net.
5. There is measure of progress (5 test pass we have 10 left for example)

Best regards

Navigation

[0] Message Index

[#] Next page

Go to full version