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 - allow duplicate code template names if contexts don't overlap
Summary: allow duplicate code template names if contexts don't overlap
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 8.2
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
Depends on: 160771
  Show dependency tree
Reported: 2013-07-04 21:30 UTC by athompson
Modified: 2016-01-11 23:01 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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