code completion and namespace

Discussion about CodeLite development process and patches
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

code completion and namespace

Post 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
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: code completion and namespace

Post 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
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: code completion and namespace

Post by jfouche »

Ok, I will investigate why this doesn't works for me
--
Jérémie
Jérémie
Post Reply