Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346309

Summary: [templates] ${enclosing_method_arguments} grabs selection/caret
Product: [Eclipse Project] JDT Reporter: Tom Dignan <tom.dignan>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, java97301
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Tom Dignan CLA 2011-05-18 13:29:17 EDT
Build Identifier: M20110210-1200 

When creating a macro in Java->Editor->Templates and following the ${enclosing_method_arguments} variable with the ${cursor} variable, the cursor is positioned after ${enclosing_method_arguments} rather than where the ${cursor} variable is.

Reproducible: Always

Steps to Reproduce:
1. Window->Preferences->Java->Editor->Templates->New
Name: loge
Desc: <blank>
Pattern:
if (DEBUG) Log.e(TAG, "${enclosing_method}(${enclosing_method_arguments}): ${cursor}");
2. Save and apply the changes
3. Inside a method, type loge<ctrl + space>. You will find that the cursor is not positioned after the colon where it should be. Tried removing the parens around the second variable, but no effect.
Comment 1 Dani Megert CLA 2011-05-19 05:58:15 EDT
*** Bug 39970 has been marked as a duplicate of this bug. ***
Comment 2 Eclipse Genie CLA 2019-11-21 11:32:24 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.