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 251799 - Code templates do not expand inside template's param
Summary: Code templates do not expand inside template's param
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2015-04-13 14:28 UTC by wookie22
Modified: 2015-04-29 09:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

IDE log (41.59 KB, text/plain)
2015-04-13 14:28 UTC, wookie22

Note You need to log in before you can comment on or make changes to this bug.
Description wookie22 2015-04-13 14:28:23 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.8.0_20
Runtime = Java HotSpot(TM) Client VM 25.20-b23

I've got code template:
Abbreviation: if
Exapnded text: if (${expr}) ${cursor}

When I type "if" it expands like it should but then when I'm in ${expr} section I cannot use any code template - they are not expanding.

Tested in PHP and JavaScript
Comment 1 wookie22 2015-04-13 14:28:26 UTC
Created attachment 153163 [details]
IDE log
Comment 2 Dusan Balek 2015-04-28 12:53:24 UTC
This is as designed behaviour. See issue #240327.
Comment 3 wookie22 2015-04-29 09:33:34 UTC
Well in my opinion now is weird behavior while previous was logical. As said in issue #240327 - there was "n" abbreviation and it expands like it should. Problem was in abbreviation itself no in Netbeans. "n" for abbreviation is bad because "n" is commonly used in code as variable. Abbreviations shouldn't collide with commonly used words/letters. Fix for issue #240327 should be: change abbreviation from "n" to "N" for instance. So now issue #240327 is "fixed" but it generates more new issues. Look at this example:

Abbreviation:  | Expanded text:
IS             | isset(${cursor})
R              | $_REQUEST[${cursor}]
if             | if (${expr}) ${cursor}

I want line of code: 
if(isset($_REQUEST["a"])) $b = 1;

Before fix I just typed: "if IS R $a" which is super fast (especially when expanding after space not tab)

Now I can't. Maybe it should be an option or directive in expanded text.