Author Topic: Code Completion  (Read 3815 times)

gatu

  • Guest
Code Completion
« on: November 30, 2006, 02:56:58 pm »
Hi,
I am starting to work with Code:Blocks. My problem is that I create some classes in a project with their functions, but then when I want to use their functions in another class, the code completion doesn't work. Do you know what could be the reason?
Thank you

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Code Completion
« Reply #1 on: November 30, 2006, 03:34:02 pm »
Hi !

Did you check how your code completion is configured ?
See "Settings/Editor", click on "Code-completion and symbols browser" in the left column and check the Code completion and C/C++ parser tabs.

From today's nightly build, you can also add directories to parse in the project properties, ie right click on the project, click on Properties and select the C/C++ parser options.

Dje

gatu

  • Guest
Re: Code Completion
« Reply #2 on: November 30, 2006, 04:16:51 pm »
Hi,
Thank's Dje for the information, now it will be easier and quicklier to program.

Gatu

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Code Completion
« Reply #3 on: November 30, 2006, 05:33:42 pm »
Quote from: dje
From today's nightly build, you can also add directories to parse in the project properties, ie right click on the project, click on Properties and select the C/C++ parser options.

Just to clarify: these are not directories to parse but directories to be searched when locating a file to parse.

They 're mostly useful when you don't add compiler search dirs in build options but use backticked expressions (e.g. `freetype-config --cflags`). In this case, the parser is not aware of where freetype (in this example) is located. So, by manually adding the freetype's directory in the parser's search dirs you 're actually helping the parser find freetype's files.

Of course, backticked expressions are not the only reason these parser search dirs are useful. As another example, I have a set of projects in a workspace. To minimize maintenance overhead, I 'm using build scripts to configure these projects. Now, although build scripts are an awesome feature, the C/C++ parser faces the same problem: it doesn't know where to search for files. The parser search directories come to the rescue again.
Be patient!
This bug will be fixed soon...

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Code Completion
« Reply #4 on: November 30, 2006, 05:44:42 pm »
Thanks for these "free" clarifications.
I had clearly not understood this feature and did not test it since my code completion works.

Dje