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.

Bug 186961 - Code completion not working properly
Summary: Code completion not working properly
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Vladimir Voskresensky
Depends on:
Reported: 2010-05-30 17:34 UTC by shiretu
Modified: 2012-10-30 21:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Screen shoot (355.31 KB, image/png)
2010-05-30 17:41 UTC, shiretu
forward class declaration (360.73 KB, image/png)
2010-05-30 17:47 UTC, shiretu
Headers filter (305.82 KB, image/png)
2010-06-21 08:28 UTC, shiretu

Note You need to log in before you can comment on or make changes to this bug.
Description shiretu 2010-05-30 17:34:50 UTC

I've been using NetBeans for the last 4 and a half years. I can honestly say that NetBeans is, by far, the most usable IDE for C/C++ development. Well, at least this is my opinion and I've been working with Visual Studio XXXX and Eclipse as well. None of the last mentioned IDEs managed to "enslave" me as NetBeans did :)

I'm working on a quite large project ( And I always work with the bleeding edge NetBeans. However, I noticed that the cnd completion engine decreased in its quality, rendering it almost unusable (see the screen-shoot). I'm also experiencing issues with forward class declarations. It almost never gets the right include file. Is including the header files(s) with the forward declaration, not the one who is actually defining the prototype of the class. And when presented with the list of alternatives I end up having 9-10 of them for the same class, except the right one :(

I've tried to rebuild the completion caches from the IDE (right click on the project -> Code Assistance -> Reparse project). Also tried the brute force approach by completely deleting the ~/.netbeans directory and erase everything in /tmp directory on boot time. Nothing seems to help.

Also, when it works, there is a big latency when providing the list of available options (up to 4 seconds).

Could you please investigate the problems more deeply? My productivity totally depends on your efforts and switching to another IDE is not an option for me. I'm available to provide assistance any time. Also I can compile the whole IDE from scratch if this is necessary. I'm willing to do almost anything to help you help me and the rest of the community having the same issue.

About my environment:

Project I'm working on: svn co --username anonymous --password "" crtmpserver
NetBeans version: NetBeans IDE 6.9 RC1 (Build 201005242201)
OS: Mac OS X 10.6.3
Java version: Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065) Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)

For tests, you can extract my project from svn with the provided svn command and open all netbeans projects inside builders/netbeans/osx (relative to the directory where you extracted the sources)

Best regards,
Comment 1 shiretu 2010-05-30 17:41:51 UTC
Created attachment 99655 [details]
Screen shoot
Comment 2 shiretu 2010-05-30 17:47:42 UTC
Created attachment 99656 [details]
forward class declaration
Comment 3 soldatov 2010-05-30 19:25:02 UTC
I believe all users understands, "Reparse Project" very dangerous menu item if 2 or more projects are opened in IDE. It reparses current project and deletes code model in other projects fully (of course you can select all projects in Projects tab and call "Reparse Project" for all projects)
Comment 4 shiretu 2010-05-30 20:48:31 UTC
I understand that...
That is why I completely erased my ~/.netbeans directory and re-opened all my projects again. Nothing seems to help.

I presume that ~/.netbeans is the only place in which NetBeans keeps his stuff. Am I right about that?
Comment 5 soldatov 2010-05-30 21:25:13 UTC
(In reply to comment #4)
> I presume that ~/.netbeans is the only place in which NetBeans keeps his stuff.
> Am I right about that?
Comment 6 Alexander Simon 2010-06-07 07:58:54 UTC
(In reply to comment #4)
> I understand that...
> That is why I completely erased my ~/.netbeans directory and re-opened all my
> projects again. Nothing seems to help.
> I presume that ~/.netbeans is the only place in which NetBeans keeps his stuff.
> Am I right about that?
You can clear only CND cache:
This folder contains parsing information.
Comment 7 Alexander Simon 2010-06-07 08:41:18 UTC
thanks for detailed report and Netbeans projects in the repository.
It seems first scenario was fixed in:
Bug 187070 -  do not use findDeclaration() and findClassifier() methods for model resolving
Can you check development build?
If your problem is fixed please vote for including Bug 187070 in the NB 8.9.1.
It seems the second scenario cannot be reproduced on current sources.
Could you provide another screen shot for second scenario?
Comment 8 shiretu 2010-06-21 08:28:14 UTC
Created attachment 100264 [details]
Headers filter

Somehow, *.cpp files are included in the list of alternatives when autocompletion kicks in for #include directives
Comment 9 shiretu 2010-06-21 08:31:05 UTC

We can arrange for a TeamViewer session if you like, to see it in action. Also I also have many other observations that I want to present.

Let me know if you are interested by sending me an email on my private email

Comment 10 Vladimir Voskresensky 2010-07-12 06:06:57 UTC
just to summarize:
1) source files in include completion was resolved by fixing extensions ("cpp" was in the list of headers extensions) => needs to check discovery logic, because Andrei didn't add it manually
2) confirmed list of useless class forward in completion list
Comment 11 Leonid Lenyashin 2012-10-30 21:09:44 UTC
There was no activity on this issue for quite a long time. We apologize that the issue was not addressed so far due to lack of development resources. We might not have time in near future to fix this problem, so it is closed as WONTFIX.
If the issue is still critical for you please do not hesitate to REOPEN it.
Thank you for using our product and reporting bugs. We are really sorry that we were not able to fix this issue timely.

CND team.