News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Code completion plugin

Started by Koron, May 16, 2005, 07:51:39 PM

Previous topic - Next topic

Koron

Why code completion not work for example with WNDCLASSEX, RECT and not work , if file, with new classes, is not saved?

I have WinXP, AMD XP2.4GHz with 512MB RAM

Anonymous


rickg22

It's by design. Code completion was designed to parse only saved files.

jludvig

Hey Rick and other devs - thanks a buch for opensourcing this marvellous IDE. And I was so close to buying visual studio...

Some things i'd love to see in the code completion plugin:

parse templated classes and typedefs or whatever keeps me from getting code-completion on my stadard template library objects.

you do parse includes like #include <vector> or #include<windows.h> right? or maybe that's the thing...

strong code completion is a big issue for me so I appreciate the recent improvements in the latest version. I have tried to look at the code but it's a bit of a mouthfull - I don't have that much spare time at the moment.

rickg22

The options for codecompletion are in the main menu, under "Settings, configure plugins".

Yes, includes are parsed too if you set it up. Just make sure to grab a cup of coffee and enable both "codecompletion cache" and "parse external includes". When the parsing's finished, you can safely close the project.

I'm not sure if this is correct, but AFAIK included files aren't parsed separately but per-project instead, so unfortunately you'd have to repeat the process for all your projects.

jludvig

I already enabled the cache and the parsing of global and local includes... still the parser seem to leave out some stuff. I also experienced a crash on startup when I had cache enabled - codeblocks refused to start until i disabled it in registry.

will run some more tests and get back to this thread with more detailed feedback.

jludvig

I't the combination of "parse GLOBAL includes" and "use cache" that crashes the codecompletion plug. It might have something to do with how I set my paths to the compiler. I tried using the codeblocks settings with no luck and now use the environment variables "LIB" and "INCLUDE" I bet the codecompletion plug doesn't search those paths - it's pretty microsoft specific I guess.
What is the correct way of setting it up? thanks.

jludvig

the parsing only to work for files that are added directly to the project.

I tried creating a simple class in a file called "ParseTest.h".

I placed the file in my visual toolkit include dir, and included it as a global include <ParseTest.h> - no dice
I event tried adding that directory to the project include's instead of just having it set in the global settings->compiler dialog.
I then moved it to my project folder and included it as "ParseTest.h" again it compiled ok, but no parsing
Only when I added the file to the project it was recognized by the codecompletion plugin.

rickg22

Hmmmmmmmm.... strange indeed.
Yes, the environment variables are microsoft-specific. You have to add the include directories in Project's Properties, etc. But I'm not sure about the parser analysing global includes.

Regarding the crash, do you happen to have "parse preprocessor directives" enabled in the codecompletion plugin? I think it crashed for me once when it was disabled.

jludvig

the include directories were added to project properties and the IDE compiler settings, didn't make a difference - you cannot reproduce the bug on your system?

Game_Ender

The code completion plugin is supposed to parse directories included in your project, but I can't seem to get it to work. It talks about your project and the compiler's "include directories", by this I assume it means the directories listed in "Directories/compiler" in the "Project's compiler options" dialog. Is this correct? I have the Ogre include directory as one of the compiler directories but it does not do any code completion related to external files, only one my project.  Am I doing something wrong?

Urxae

Quote from: Game_Ender on August 01, 2005, 07:20:42 PM
I have the Ogre include directory as one of the compiler directories but it does not do any code completion related to external files, only one my project.  Am I doing something wrong?
In Settings -> Plugins' settings -> Code completion, do you have "Follow GLOBAL includes" set? (I believe it's off by default because it takes a while to parse all that stuff)

Game_Ender

Yes I have follow LOCAL and GLOBAL include checked, and all the cache options turned on.  Also, the newline characters don't work right for me, they just display as a tiny square.  I don't know if this may cause any issues but I installed codeblocks RC1 over top of my old one (final-beta 7).

rickg22

Quote from: Game_Ender on August 01, 2005, 09:23:03 PM
Also, the newline characters don't work right for me, they just display as a tiny square.  I don't know if this may cause any issues but I installed codeblocks RC1 over top of my old one (final-beta 7).

AH HAH!

OK, first of all, purge your codeblocks directory. (If you have your projects inside it, then it's an "uh-oh", because that's normally a wrong behavior :P )

Second, after installing CB, if it still doesn't work,
try disabling and-or enabling caching AND smartsense (I recall someone saying smartsense screwed up code completion). So, try with caching - smartsense both on, one on otherone off, etc until you try all the combinations.

Third - if you have caching enabled, purge the cache - might have become corrupted or something.

Hope that helps.

Game_Ender

Thats doesn't work seem to work. So my guess is I don't have it setup right.  The code completion plugin is supposed to follow the include paths in  BuildOptions->Directories->Compiler.  Is there anyone who has gotten the code completion plugin to parse files not in their project?