Code::Blocks Forums

User forums => Help => Topic started by: lenkite on December 07, 2005, 07:04:04 pm

Title: Cant get code completion to work..is there anything special one needs to do?
Post by: lenkite on December 07, 2005, 07:04:04 pm
I have a very simple cpp program with a '#include <iostream>'. I type 'cin.' and hit ctrl-space and nothing happens.  :(  Same thing for any of the standard library classes like vector, et al. I am using CodeBlocks 1.0 RC2.

I had a look at Settings > Plugin Settings > Code Completion, but didn't see any settinsgs which would fix the roblem.

All help appreciated!
Title: Re: Cant get code completion to work..is there anything special one needs to do?
Post by: thomas on December 07, 2005, 07:06:29 pm
Three things:

1. Code completion only scans files stored on the hard disk (i.e. you must save before code complete can work)
2. Code completion does not work properly without a project (in particular "find declaration" or "swap header/source")
3. Code completion does not work at all with standard C++ headers, so cin is a no-no, sorry.
Title: Re: Cant get code completion to work..is there anything special one needs to do?
Post by: Michael on December 07, 2005, 07:52:53 pm
Hello,

I have remarked a small problem with the code completion plugin.

I have implemented using templates a PriorityQueue which wraps a multimap. The class has been defined inside a namespace.

To test the PriorityQueue, I have created a cpp file, imported the PriorityQueue and played a bit with it. The problem is that the code completion plugin does not seem to work. I know that it does not work with standard C++ headers (thanks to thomas), but with the "non standard" of my PriorityQueue, it should work. Checking a bit, I have remarked that when typing the namespace (where the PriorityQueue has been defined) and the scope operator ("::"), then the plugin works and it displays me all the class functions.

Does the plugin have problems managing namespace or do I have missed something?

I use C::B RC 2 (GNU GCC compiler) unter Windows XP SP2.

Thank you very much.

Michael
Title: Re: Cant get code completion to work..is there anything special one needs to do?
Post by: lenkite on December 07, 2005, 08:29:12 pm
Thanks thomas..I was tearing my head out wondering whether I made some sort of stupid error.
That apart, I really hope we get code-completion with standard headers...could make use of ctags here.
Title: Re: Cant get code completion to work..is there anything special one needs to do?
Post by: mandrav on December 07, 2005, 08:38:18 pm
Does the plugin have problems managing namespace or do I have missed something?

No, it just doesn't recognize the "using" keyword (yet).
Title: Re: Cant get code completion to work..is there anything special one needs to do?
Post by: Michael on December 07, 2005, 08:56:04 pm
No, it just doesn't recognize the "using" keyword (yet).
Ok. Thank you very much for the information.

Michael