Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 232287

Summary: allow duplicate code template names if contexts don't overlap
Product: editor Reporter: athompson <athompson>
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: NEW --- QA Contact: issues <issues.netbeans.org>
Priority: P3 CC: athompson
Version: 8.2   
Target Milestone: TBD   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Issue Type: ENHANCEMENT Exception Report:
Bug Depends on: 160771    
Bug Blocks:    

Description athompson 2013-07-04 21:30:44 UTC
Issue #160771 introduced the concept of "contexts" into code templates. The next logical step is to allow code templates with the same name so long as the contexts don't overlap.

For example, you could have multiple code templates named "log". If the context is CLASS, it would add a logger instance as a field. If the context is METHOD, it would add a logging statement.

Organized properly, this could vastly reduce the number of template abbreviations developers would need to remember, since related items can be grouped under the same name instead of having to use a unique (and almost by definition harder to remember) name for each template. For example, currently the logger instance must be added with the "logr" abbreviation, which is not obvious.
Comment 1 athompson 2014-12-11 18:24:03 UTC
Still a good idea IMO...
Comment 2 athompson 2016-01-11 23:00:09 UTC
Bump...
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo