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 63212 - [code_templates] Code templates are shown among methods in code completion
Summary: [code_templates] Code templates are shown among methods in code completion
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
: 64775 65296 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-29 09:18 UTC by Roman Strobl
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Strobl 2005-08-29 09:18:31 UTC
[NetBeans 200508281800; FC4; JDK 1.5.0_04]

Issue Summary:
--------------
Code templates are shown among methods in code completion. That's of no usage
and makes methods and fields harded to access.

Steps to Reproduce:
-------------------
1. Create a new java class.
2. In constructor, type in "this.f".
3. Invoke code completion after f.
-> Many code templates are shown but are useless.
Comment 1 Max Sauer 2005-08-30 12:59:02 UTC
Parameters of methods are harder to acces also. When using CC to supply a
variable as a methods parameter, I need to skip the abbrevations first, if they
begin ie. with the same letter as the variable I intend to paste there.

Either they shouldn't be listed there, or be moved downwards.
Comment 2 Roman Strobl 2005-09-21 09:36:58 UTC
*** Issue 64775 has been marked as a duplicate of this issue. ***
Comment 3 Roman Strobl 2005-09-29 09:16:25 UTC
*** Issue 65296 has been marked as a duplicate of this issue. ***
Comment 4 Roman Strobl 2005-09-29 09:17:02 UTC
Upping to P2 because of the duplicate. See it for additional details.
Comment 5 Miloslav Metelka 2005-10-04 15:34:09 UTC
Since we currently cannot evaluate the context syntactically well (i.e. we can't
offer only the code templates that are syntactically appropriate at the given
context) the best solution now would IMHO be to shift the code templates
completion items beyond the java completion items.
Comment 6 Miloslav Metelka 2005-10-04 17:05:58 UTC
Fixed in trunk:
Checking in
src/org/netbeans/lib/editor/codetemplates/CodeTemplateCompletionItem.java;
/cvs/editor/codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateCompletionItem.java,v
 <--  CodeTemplateCompletionItem.java
new revision: 1.6; previous revision: 1.5
Comment 7 Miloslav Metelka 2005-10-05 13:32:56 UTC
Additional fix - moved CT above java classes and packages.
Checking in
src/org/netbeans/lib/editor/codetemplates/CodeTemplateCompletionItem.java;
/cvs/editor/codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateCompletionItem.java,v
 <--  CodeTemplateCompletionItem.java
new revision: 1.7; previous revision: 1.6
Comment 8 Roman Strobl 2005-10-07 15:48:35 UTC
Well, quite a dirty solution, but ok. Verified.