History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-44232
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Oleg Stepanov
Reporter: Geoff Taylor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

Live templates provide no way of quoting/escaping dollar symbols

Created: 26 Jun 07 15:55   Updated: 10 Dec 07 14:11
Component/s: Live templates
Fix Version/s: Future Versions
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 3


 Description  « Hide
It's not possible to use Live Templates to create comment blocks with embedded dollar symbols. For instance, the following comment block uses some CVS keywords to embed version information in the source file:

// File name: $RCSfile$
//
// CVS File: $Source$

This can't be used as part of a Live Template because ReSharper interprets the dollar symbols as its own variable delimiters, and so it mucks up the dollar symbols when the template is added to the code.

Currently there's no way of escaping the dollar symbols (such as using '\$' to mean a dollar symbol that is not part of the Live Template variable system).



 All   Comments   Work Log   Change History      Sort Order:
Colin Ramsay - 10 Dec 07 13:21
Since this is the first result on Google when I tried searching for this issue, I thought I would comment with a workaround. In locations where you want a dollar, simply type:

$dollar$

In the template to add a variable called "dollar". Choose the macro for this variable and use the "Constant Value" one, then hit "Change Value" and put a $ symbol in as the value. Make sure to untick the "Editable Occurence" box too.


Geoff Taylor - 10 Dec 07 14:11
You're obviously a much more sophisticated ReSharper user than I am, Colin!

As of version 3, I've been able to 'quote' the dollar symbols by just doubling them, so:

$$Author$$

is output as:

$Author$

That works well enough for me, although your workaround is probably more correct.

Thanks,

Geoff