Author Topic: Help on code completion  (Read 4840 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5358
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Help on code completion
« Reply #15 on: November 26, 2018, 03:47:23 pm »

So, here's a new version of the patch.

An option has been added to "settings -> editor -> code completion -> C/C+++ Parser"
This time, "settings.xrc" is well handled in the patch.

If "Parse headers" is selected, the project header files are added at the end of the list of files to be parsed.

Otherwise, we find the old behavior.

Is the option useful? Is it really annoying to parse the header files that have been added to the project?

Returns are welcome.

Have a good day.

Translated with
First, this reply comes a little late, I understand what this patch try to solve, thanks!

The problem here is like your said:
However, there is still a slight inconsistency, since these headers files are parsed when they are added to the project.
This is true, and I think this may cause some problems as your said. I remember we have such behaviour in our CC, and later, we just parse the translation files, and only follow the "#include" statement, so that only header files included in a cpp files or other parsed header files will be parsed.

So, what is the motivation to parse those independent header files? When you are editing a translation file, you wrote a new statement "#include new_header_file", and you press the "save" button, this new_header_file will be parsed.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.