Page 1 of 1

code completion and namespace

Posted: Sun Jun 07, 2009 8:59 pm
by jfouche
Hi Eran

I usualy use namespace in my own projects. I define one in a .h file, and in the .cpp file according to the .h file, I write

Code: Select all

using namespace xxx;
In the cpp file, code completion doesn't work. Here is an example :

Code: Select all

// h file
namespace ns {

class Foo
{
  ...
  void Bar();
};

}

Code: Select all

// cpp file
#include "foo.h"
using namespace ns;

void Foo:: // <- code completion doesn't show anything

void ns::Foo:: // <- code completion is OK
The problem probably comes from the fact that the code completion is looking for the global namespace and no Foo class is define in the global namespace. I think that an improvment can be done by adding a search in all namespace defined by the using namespace keywords in a file. I would like to try to fixe this. Could you give me a clue where I can begin a patch for this ?
Thanks

Re: code completion and namespace

Posted: Sun Jun 07, 2009 9:58 pm
by eranif
jfouche wrote:The problem probably comes from the fact that the code completion is looking for the global namespace and no Foo class is define in the global namespace. I think that an improvment can be done by adding a search in all namespace defined by the using namespace keywords in a file. I would like to try to fixe this
Not really.

When parsing the file, codelite also collect all the 'using namespace ...' lines and tries to search in each of the mentioned namespace (like you suggested)

Btw, your example works for me (see the attached screenshot)

Eran

Re: code completion and namespace

Posted: Sun Jun 07, 2009 10:49 pm
by jfouche
Ok, I will investigate why this doesn't works for me
--
Jérémie