Author Topic: Cant get code completion to work..is there anything special one needs to do?  (Read 4274 times)

lenkite

  • Guest
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!
« Last Edit: December 07, 2005, 07:05:36 pm by lenkite »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
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

lenkite

  • Guest
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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Does the plugin have problems managing namespace or do I have missed something?

No, it just doesn't recognize the "using" keyword (yet).
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
No, it just doesn't recognize the "using" keyword (yet).
Ok. Thank you very much for the information.

Michael