Community
Participate
Working Groups
I have a JSP editor template that looks like this: foo ${line_selection} bar When this template is applyed to a selection, instead of wraping foo and bar around the selected lines, it pastes the result of the template at the end of the section. asdqwe becomes asdqwe foo asdqwe bar -- Configuration Details -- Product: Eclipse 1.2.2.20100122-1337 (org.eclipse.epp.package.jee.product) Installed Features: org.eclipse.jdt 3.5.2.r352_v20100108-7r88FEwFI0WTuoBl0iaG0tyhfZH6
Are you able to reproduce this with Helios SR1?
I can confirm that this does happen. You can see this for non-template proposals as well. I'm not sure if this was a design decision, but with our XML-based editors, nodes are not replaced by the proposal text, but prepended to it. The CSS editor, though, replaces selected text with the proposal.
(In reply to comment #1) > Are you able to reproduce this with Helios SR1? Yes. Same goes with Helios SR1.
Hi Nick, it looks like a design decision in ReplaceNameTemplateContext class. If template name doesn't match with that prefix before cursor, "asdqwe" in case above, it will be appended after this prefix.If our template name was "asdqwe" in above example we would get correct proposal.I am not sure why it is supported this way.
It should be noted that Java editor has a sepparate "Surround with" action in the "Source" menu, that has the desired effect. Maybe this should be changed to an enhancenent request, to add this functionality to this editor?
Thank you for your report. I agree that this sounds like an enhancement.
This seems to apply to the html files as well - not specific to JSP. I'm still seeing it in Oxygen.2 Release (4.7.2). I would be willing to help add it as an enhancement if anyone is able to help get me started with it?