Bug 13910 - Suggestion: Add C# Code Template "b" to wrap braces around selection
Summary: Suggestion: Add C# Code Template "b" to wrap braces around selection
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 4.0.12
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-08-11 15:22 UTC by Neal
Modified: 2013-08-12 11:13 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
demo (885.82 KB, application/octet-stream)
2013-08-12 11:13 UTC, Neal
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Neal 2013-08-11 15:22:42 UTC
Hello,

Something I did in my prefs but would help others and I get this from DevExpress's CodeRush is they have a replacement such that if I type B and then space it will insert an open and close braces with empty line in between and then focus the cursor on the empty line ready to write code.  In addition, it's a selection option so I can select line(s) of code and then choose surround with, I would choose B and the selection will get wrapped with braces.  Sometimes we have a one line statement after an if () and we want to add more lines so we need to wrap braces on our current line.

Anyways, an expansion and surround with for "b" would be useful.
Comment 1 Mike Krüger 2013-08-12 01:21:16 UTC
I added the surround with template.

How does the insertion of open & close braces work exactly in code rush ?

(I implemented a feature in the completion list, if you complete a method that the "()" or "();" is inserted automatically - but that's a different thing I suppose)
Comment 2 Neal 2013-08-12 11:13:20 UTC
Mike,

I will attach a video to show you how it works.  I had a few screw ups but it should show you how it works essentially.  Essentially you should be able to type your method name, return, b TAB and the braces are put in for you with the cursor placed in between.

OR

highlight a line and choose surround with, select B from the list and the selection is wrapped with braces { }
Comment 3 Neal 2013-08-12 11:13:38 UTC
Created attachment 4609 [details]
demo