This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
If project has class Test in file.h and user choose Test class from code completion list while change code in file welcome.cc => CND should check wether Test is available from current #include directives of welcome.cc and if Test is not accesible => #include "file.h" should be added It should be orthogonal with Java editor and auto adding "import" statements.
*** Issue 125053 has been marked as a duplicate of this issue. ***
Plan: 1. Create 2 services: 1.1 First one will check visibility of CSM item that we want to add in current position. 1.2 Second one will find header file that makes CSM item visible. 2. Then I will implement some algorithm of #inlude insertion to document. 3. At last this code will be integrated with NetBeans code completion module (in defaultAction of CsmResultItem).
Keep in mind "Fix includes action". See: http://www.netbeans.org/issues/show_bug.cgi?id=89298 1.3 Privide service that visits all unresolved references and finds headers that can resolve references.
I've implemented one service (CsmIncludeResolver, IncludeResolverImpl) that checks visibility of CSM object (isObjectVisible) and finds include string (#inlude <f.h> or #inlude "f.h") that makes CSM object visible (findIncludeString). Also this functionality was integrated with code completion module. http://hg.netbeans.org/main?cmd=changeset;node=5251efd7bb2a