You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to be able to very quickly being able to toggle (meaning adding or removing) the $ (dollar) in front of the string where the caret is.
Reason
Since C# 6.0 is out there, I rarely use string.Format, but almost always $"..." instead.
I often find myself start writing a regular string "..." and then in the middle of my typing, I figure out I need to put a variable, so I start to add an open brace, then my variable, and then I figure out that I forgot the $ symbol in the first place.
So I have to navigate back to the beginning of the string, sometimes by pressing Home key then Ctrl + Right Arrow key several times, or just Ctrl + Left Arrow several times, or with the mouse.
No need to say that all of those ways to do it are quite slow, and somehow frustrating, since it happens quite often.
Suggestion
Having a shortcut, such as Ctrl + Alt + D (for Dollar), Ctrl + Alt + F (for Format), or even simpler Ctrl + 4 (because 4 maps to the dollar symbol on US keyboard) that, when the caret is in the middle of a string, appends the $ symbol in front of the string if there is not, and remove it if there is.
I guess a Quick Action could make it, however it may not be as fast to do so, for example if other extensions add more Quick Actions in the same context, it might still require several key presses to get the job done.
The text was updated successfully, but these errors were encountered:
This is an enhancement request.
Overview
It would be great to be able to very quickly being able to toggle (meaning adding or removing) the $ (dollar) in front of the string where the caret is.
Reason
Since C# 6.0 is out there, I rarely use
string.Format
, but almost always$"..."
instead.I often find myself start writing a regular string
"..."
and then in the middle of my typing, I figure out I need to put a variable, so I start to add an open brace, then my variable, and then I figure out that I forgot the$
symbol in the first place.So I have to navigate back to the beginning of the string, sometimes by pressing
Home
key thenCtrl + Right Arrow
key several times, or justCtrl + Left Arrow
several times, or with the mouse.No need to say that all of those ways to do it are quite slow, and somehow frustrating, since it happens quite often.
Suggestion
Having a shortcut, such as
Ctrl + Alt + D
(for Dollar),Ctrl + Alt + F
(for Format), or even simplerCtrl + 4
(because 4 maps to the dollar symbol on US keyboard) that, when the caret is in the middle of a string, appends the$
symbol in front of the string if there is not, and remove it if there is.I guess a Quick Action could make it, however it may not be as fast to do so, for example if other extensions add more Quick Actions in the same context, it might still require several key presses to get the job done.
The text was updated successfully, but these errors were encountered: