Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick toogle for string / interpolated string #48

Open
TanukiSharp opened this issue Nov 9, 2016 · 0 comments
Open

Quick toogle for string / interpolated string #48

TanukiSharp opened this issue Nov 9, 2016 · 0 comments

Comments

@TanukiSharp
Copy link

TanukiSharp commented Nov 9, 2016

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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant