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 132030 - Code completion for template method doesn't work
Summary: Code completion for template method doesn't work
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-04 11:06 UTC by jindra
Modified: 2008-04-09 08:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (3.40 KB, patch)
2008-04-05 15:49 UTC, Vladimir Voskresensky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jindra 2008-04-04 11:06:04 UTC
I don't know whether it is feature, bug or wrong setting but code completion doesn't work for me  for any #included
files (or more precisely types in the files). I had the same problem in version 6.0 and therefore tried to migrate to
6.1 but nothing changed.
Comment 1 Jesse Grodnik 2008-04-04 16:33:44 UTC
Escalated to P2.

Can you provide an example that shows this problem? It would be very helpful to the development team to have that since
the feature has been extensively tested and works -- so there may be scenarios which the team has not considered.
Comment 2 jindra 2008-04-04 19:43:01 UTC
Hi,
sorry for lack of example, I have studied the case I have noticed first time more precisely. Code completion worked fine
for most of the included file, my mistake to let you think it doesn't, sorry. I have changed Summary of this issue to
reflect this mistake.
Althought for most of the included file completion worked fine, completion wasn't able to process this example:

file object.h:

template<class t>
class Object{
  
public:

  template<class t2>
  Object<t> getSomething(){
    ...
  }
};

file example.h:

#include "object.h"

void doNothing(){
  Object o;
  o.   <-------- no code completion suggestion
}

I have to note that without "template<class t2>" it works.
Comment 3 Vladimir Voskresensky 2008-04-05 08:05:55 UTC
Thank you for details.
I see the bug and you are right, the problem is template function inside template class without templating of fun it works.
Comment 4 Vladimir Voskresensky 2008-04-05 12:33:53 UTC
I made investigation and discovered that because of this error model missed class content at all.
Comment 5 Vladimir Voskresensky 2008-04-05 15:49:31 UTC
Created attachment 59730 [details]
patch
Comment 6 Vladimir Voskresensky 2008-04-05 15:50:46 UTC
Vladimir K., could you review the proposed fix, please?
- I fixed incorrect predicate
- reordered rules to have more precise before less precise ones

all unit & codemodel tests pass without errors.
Comment 8 Vladimir Kvashin 2008-04-06 11:51:44 UTC
I reviewed the proposed fixed thoroughly.
I completely agree with it. It is safe and correct.
I strongly believe it's worth including the fix into 6.1
Comment 9 soldatov 2008-04-07 15:48:23 UTC
verified in 200804040802 build + jars with fixes from developers
Comment 10 Vladimir Voskresensky 2008-04-07 16:07:28 UTC
fix integrated in 6.1
http://hg.netbeans.org/release61?cmd=changeset;node=04f07f45977f
Comment 11 soldatov 2008-04-09 08:10:41 UTC
verified in 200804082140 build (branch: release61)