Author Topic: Code completion plugin  (Read 18084 times)

Koron

  • Guest
Code completion plugin
« on: May 16, 2005, 07:51:39 pm »
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

  • Guest
Code completion plugin
« Reply #1 on: May 16, 2005, 07:56:25 pm »
Version is 1.0-beta7

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Code completion plugin
« Reply #2 on: May 16, 2005, 11:29:53 pm »
It's by design. Code completion was designed to parse only saved files.

jludvig

  • Guest
Code completion plugin
« Reply #3 on: May 17, 2005, 12:33:00 am »
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.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Code completion plugin
« Reply #4 on: May 17, 2005, 04:16:08 am »
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

  • Guest
Code completion plugin
« Reply #5 on: May 17, 2005, 11:57:59 am »
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

  • Guest
Code completion plugin
« Reply #6 on: May 17, 2005, 12:06:23 pm »
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

  • Guest
Code completion plugin
« Reply #7 on: May 17, 2005, 12:39:17 pm »
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.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Code completion plugin
« Reply #8 on: May 17, 2005, 06:02:56 pm »
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

  • Guest
Code completion plugin
« Reply #9 on: May 18, 2005, 01:34:13 pm »
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?

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Code completion plugin
« Reply #10 on: August 01, 2005, 07:20:42 pm »
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?

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Code completion plugin
« Reply #11 on: August 01, 2005, 08:27:00 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)

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Code completion plugin
« Reply #12 on: August 01, 2005, 09:23:03 pm »
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).

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Code completion plugin
« Reply #13 on: August 02, 2005, 01:03:58 am »
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.

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Code completion plugin
« Reply #14 on: August 02, 2005, 04:38:44 pm »
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?