Code::Blocks Forums

User forums => Help => Topic started by: al7amimi on October 28, 2013, 09:58:06 pm

Title: Objects of a class
Post by: al7amimi on October 28, 2013, 09:58:06 pm
Correct me if I am wrong. If I am not mistaken in the older releases the editor was able to auto-complete the members of a user defined class as if I was typing a C++ keyword. Is this still possible? Where exactly in the settings that option is available ?

thnx

This thing is still broken
basically in one file the editor was auto completing the headers of the members, in another file, the just like before failed to auto complete the headers of the class members. Any clues?!

thnx

Title: Re: Objects of a class
Post by: al7amimi on November 01, 2013, 01:35:23 am
up
Title: Re: Objects of a class
Post by: Alpha on November 01, 2013, 02:33:25 am
Code::Blocks version?  Are you using a project?  Are file extensions standard?
Title: Re: Objects of a class
Post by: al7amimi on November 01, 2013, 04:40:11 am
Code::Blocks version?  Are you using a project?  Are file extensions standard?

great! yes I am using 12.11, and the extension is .cpp. I did make sure to save the file and test to see if the members' headers are suggested by the editor, but that did not happen. I have to mention that in one particular cpp file -I dont use projects-, the editor miraculously suggested all headers, in that particular case -if it does help- the class name was Employee! I know, that sounded dumb, but I wanted to mention it.

I am serious in seeking help regarding this issue since that particular feature is one of the strongest points to minimize my typo errors...

thnx in advance,
Title: Re: Objects of a class
Post by: Alpha on November 02, 2013, 12:41:12 am
Check under:
Settings->Editor->Code completion
what you have enabled/disabled.  If changing settings in there does not help, you can try the latest nightly build (http://forums.codeblocks.org/index.php/board,20.0.html) (the CodeCompletion plugin has received many fixes and improvements since 12.11).
Also, what OS are you on?
Title: Re: Objects of a class
Post by: al7amimi on November 02, 2013, 02:41:24 am
Can you please check the attached image to verify that the settings are correct?!

thnx

[attachment deleted by admin]
Title: Re: Objects of a class
Post by: Alpha on November 02, 2013, 08:52:41 pm
Settings look like they should work.  Can you give exact steps to reproduce?
Title: Re: Objects of a class
Post by: dmoore on November 02, 2013, 09:14:57 pm
I can't reproduce OPs problem. I tried the following code saved as main.cpp with no project on Linux with recent rev of trunk

Code
#include <stdio.h>
#include <string.h>

class myclass
{
public:
    myclass() {}
    int myfunc(int a)
    {
        return a+1;
    }

};

int main()
{
    myclass a=myclass();
    a.|
}

a. offers myfunc as would be expected
Title: Re: Objects of a class
Post by: al7amimi on November 04, 2013, 03:15:33 am
I am forced to disable/enable code completion and restart every time to enable this feature?! The older version did not have such issue...so what do you guys think?!

thnx
Title: Re: Objects of a class
Post by: al7amimi on November 04, 2013, 11:11:00 am
Restarting the editor every time is not fair if you ask me...
Title: Re: Objects of a class
Post by: oBFusCATed on November 04, 2013, 11:38:08 am
Your last comment doesn't help much in resolving the problem!

There is no such feature added in C::B 12.11 or later that requires you to restart the IDE for CC to work correctly.
Please try a night build or post a minimal sample and steps that reproduces the problem.

Keep in mind that the current implementation of the parser doesn't support complex marco or template expressions in the code, so this might be the cause.
Title: Re: Objects of a class
Post by: al7amimi on November 06, 2013, 05:57:53 am
I just restarted the application to enforce auto-completion
Title: Re: Objects of a class
Post by: al7amimi on November 12, 2013, 10:28:28 am
up
Title: Re: Objects of a class
Post by: BlueHazzard on November 12, 2013, 10:52:08 am
Your last comment doesn't help much in resolving the problem!

There is no such feature added in C::B 12.11 or later that requires you to restart the IDE for CC to work correctly.
Please try a night build or post a minimal sample and steps that reproduces the problem.

Have you tried a nightly build?