Revision 842201

Go back to digest for 10th August 2008

Features in Development Tools

David Nolden committed changes in /trunk/KDE/kdevelop/languages/cpp:

Kickass feature of the week:
Automatic adding of include-directives

How it works:
When you push the code-completion button, and either:
- Are calling a function that is not found on any level
- Are trying to construct a type that is only forward-declared or unresolved
- Are trying to list the members of a class that is only forward-declared or unresolved
- Have typed the name of a class/function that is unresolved or only forward-declared, like "QString|"
Then the completion list will have one or multiple entries like "Add missing include #include <QtCore/qstring.h> for class QString", and when you execute that entry, the include-directive is added.

It automatically finds the shortest include-directive possible with the known include-path.

The only precondition is that the searched item is in the persistent symbol table, which means it must have been parsed at least once in the duchain store you're currently using.

File Changes

Added 2 files
  • /trunk/KDE/kdevelop/languages/cpp
  •   /missingincludecompletionitem.cpp
  •   /missingincludecompletionitem.h
Modified 6 files
  • /trunk/KDE/kdevelop/languages/cpp
  •   /CMakeLists.txt
  •   /codecompletioncontext.cpp
  •   /codecompletioncontext.h
  •   /cppcodecompletionworker.cpp
  •   /cppduchain/classdeclaration.cpp
  •   /cppduchain/classdeclaration.h
8 files changed in total