Author Topic: Enabling auto-completion for files not included in the project  (Read 6207 times)

lemerou

  • Guest
Hi,

I'm using Codeblocks rev 2535 with Ubuntu 6.06 for coding a wxWidgets based application, and I have a litte problem with the auto-completion.
Actually, it is only enable for my local files and doesn't parse all "wx.....h" files in my "/usr/include" directory.

It works only if I add all includes files of wxWidgets in the project but it is not a good solution.
How can I force the parser to scan the "/usr/include/wx2.6/wx" directory ?

sethjackson

  • Guest
Re: Enabling auto-completion for files not included in the project
« Reply #1 on: June 06, 2006, 04:52:21 pm »
Hmm maybe:

Settings -> Editor -> Code-completion and symbols browser -> Follow GLOBAL includes

Yomen

  • Guest
Re: Enabling auto-completion for files not included in the project
« Reply #2 on: June 15, 2006, 02:15:40 am »
Code
Hmm maybe:

Settings -> Editor -> Code-completion and symbols browser -> Follow GLOBAL includes

This doesn't work for me, I still don't get code-completion to 'suggest' anything outside my immediate project files.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Enabling auto-completion for files not included in the project
« Reply #3 on: June 15, 2006, 08:38:23 am »
You have to understand that C::B will not blindly go around your hard disk to find header files...
It uses "search dirs" which are coincidentally the compiler's search dirs.
Now, in the wxWidgets case (as in many other linux packages too), you don't setup the compiler's search dirs yourself but rather add `wx-config --cflags` in compiler options and this takes care of everything. But C::B doesn't know about it...

So, the short answer is to manually add "/usr/include/wx2.6/wx" (or whatever) in your compiler search dirs so that C::B can locate the wx headers.
Be patient!
This bug will be fixed soon...

takeshimiya

  • Guest
Re: Enabling auto-completion for files not included in the project
« Reply #4 on: June 15, 2006, 02:36:37 pm »
You have to understand that C::B will not blindly go around your hard disk to find header files...
It uses "search dirs" which are coincidentally the compiler's search dirs.
Now, in the wxWidgets case (as in many other linux packages too), you don't setup the compiler's search dirs yourself but rather add `wx-config --cflags` in compiler options and this takes care of everything. But C::B doesn't know about it...

So, the short answer is to manually add "/usr/include/wx2.6/wx" (or whatever) in your compiler search dirs so that C::B can locate the wx headers.

Hi!

Little question: how much feasible is to parse the output from backticks looking for a -I and feed it to the CodeCompletion plugin?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Enabling auto-completion for files not included in the project
« Reply #5 on: June 15, 2006, 03:01:22 pm »
Little question: how much feasible is to parse the output from backticks looking for a -I and feed it to the CodeCompletion plugin?

That would require more effort than it's worth. What would be more feasible though, with the new Extensions node in the project file, is allow adding additional search paths for the CC plugin per-project.
Be patient!
This bug will be fixed soon...

takeshimiya

  • Guest
Re: Enabling auto-completion for files not included in the project
« Reply #6 on: June 15, 2006, 04:27:35 pm »
Little question: how much feasible is to parse the output from backticks looking for a -I and feed it to the CodeCompletion plugin?

That would require more effort than it's worth. What would be more feasible though, with the new Extensions node in the project file, is allow adding additional search paths for the CC plugin per-project.

But that wouldn't be hardcoding the paths in the project file (in linux for example)?

ptruog

  • Guest
Re: Enabling auto-completion for files not included in the project
« Reply #7 on: June 15, 2006, 11:27:57 pm »
I wonder if the ability to create another directory in the management view where you can add external header files for the purpose of code-completion would be a relatively painless short term fix.  A user created directory called say "external headers", where the user can then add any/all header files they wish, but would not 'dirty' the project tree with all these external headers.

EX:
- workspace
  - hello world
    + sources
    + headers
    + "external headers"

by being able to 'right click' on "external headers" the user can add any/all external headers they wish.  -- Whereas now, you can add more files to the project tree, but these would get populated in the "headers" tree.

Many thanks!

I can add this to the bug base for FR tracking purposes, if anyone wishes??



ptruog

  • Guest
Re: Enabling auto-completion for files not included in the project
« Reply #8 on: June 15, 2006, 11:29:33 pm »
P.S. I noticed you guys have changed the behaviour of these forums whereby I can no longer use an arbitrary user name to make 'anonymous' postings.   :?  -- I now _HAVE_ to actually log in.   :(

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Enabling auto-completion for files not included in the project
« Reply #9 on: June 15, 2006, 11:44:45 pm »
P.S. I noticed you guys have changed the behaviour of these forums whereby I can no longer use an arbitrary user name to make 'anonymous' postings.   :?  -- I now _HAVE_ to actually log in.   :(

Because:

http://forums.codeblocks.org/index.php?topic=3334.0

Best wishes,
Michael