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 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 ---    
Severity: normal CC: athompson
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Mac OS X   
Issue Type: ENHANCEMENT Exception Reporter:
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...