Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: joof on July 31, 2009, 01:55:34 pm

Title: code completion with multiple files
Post by: joof on July 31, 2009, 01:55:34 pm
Hi,

The code completion doesn't work when using multiple files i.e. declaration and implementation are in the different files. I tried to look the answer from settings and from web but didn't found. More datailed description is below. I'm using Code::Blocks 8.02 Build:Fed 27 2008, 20:59:09 on Windows XP.


The code completion works fine when I have only on file. When I write inside the main function 'foo.' (without quotes) the completion list appears saying 'MemberFunction'.

main.cpp
Code
#include <iostream>

using namespace std;

class Foo
{
public:
    void MemberFunction(void)
};

void Foo::MemberFunction(void)
{
   
}

int main()
{
    Foo foo;
   
    //testing code completion here
   
   
    return 0;
}


But when I split the code into three files (and add them to the project) the completion doesn't work anymore. When I now write inside the main function 'foo.' nothing happens. Also the symbols list is not showing anymore the Foo class.

main.cpp
Code
#include <iostream>
#include "Foo.hpp"

using namespace std;

int main()
{
    Foo foo;
   
    //testing code completion here
   
   
    return 0;
}

Foo.hpp
Code
class Foo
{
public:
    void MemberFunction(void);
};

Foo.cpp
Code
#include "Foo.hpp"

void Foo::MemberFunction(void)
{
   
}


How can I make this to work? Thanks.
Title: Re: code completion with multiple files
Post by: oBFusCATed on July 31, 2009, 02:21:41 pm
There is a separate branch in svn with vastly improved code completion, there is your only hope :)
You could try a nightly build if you don't want to build one yourself
Title: Re: code completion with multiple files
Post by: Jenna on July 31, 2009, 02:30:47 pm
There is a separate branch in svn with vastly improved code completion, there is your only hope :)
You could try a nightly build if you don't want to build one yourself

The nightly builds do not use the cc-branch.

Nevertheless it works here with actual trunk.

Did you save your files, before trying code-completion ?
Title: Re: code completion with multiple files
Post by: joof on July 31, 2009, 02:35:34 pm
Sorry this was a false alarm, now it is working. I knew this should be a trivial case. When I made the above example project and re-opened my real project symbol browser showed all the classes from all project files and the code completion worked as assumed.  :D I guess the workspace and/or the project files must be saved before symbols from new files are included.


Many thanks to the developers this is a great program!
Title: Re: code completion with multiple files
Post by: joof on July 31, 2009, 02:38:55 pm
Did you save your files, before trying code-completion ?

I did save the actual code files but not the project and workspace files.