Author Topic: code completion with multiple files  (Read 5379 times)

Offline joof

  • Single posting newcomer
  • *
  • Posts: 3
code completion with multiple files
« 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.
joof

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: code completion with multiple files
« Reply #1 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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: code completion with multiple files
« Reply #2 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 ?

Offline joof

  • Single posting newcomer
  • *
  • Posts: 3
Re: code completion with multiple files
« Reply #3 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!
joof

Offline joof

  • Single posting newcomer
  • *
  • Posts: 3
Re: code completion with multiple files
« Reply #4 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.
joof