Surround With problems

I have a couple of problems with 'Surround With' in VS2015. What I want is to use 'Surround With {}'

There is a template for this as can be seen in the Template Explorer but it is not shown in the Surround With context menu option. The same goes for the normal bracket version '()'. It shows up in the templates list but not shown in the context menu.

So next I try to make a custom 'Surround With' template and then I end up with a template with name <No Name> that I don't know how to give a name.

This new template is also NOT shown in the Surround With context menu option. It is shown however when using Ctrl+E,U, but not surprisingly as 'Unnamed'.

So how can I use the build in {} and () surround with options and how can I rename a surround with template template. 

I use:

JetBrains ReSharper Ultimate 10.0.2 Build 104.0.20151218.120627
ReSharper C++ 10.0.20151218.122414

 

 

 

6 comments

Hello Tim,

A number of issues have been fixed in the 2016.1 release which affected the availability of the 'Surround With {}' template. Please try the new release and let us know if you still experience any issues.

Please note that the builtin 'Surround With ()' template is available only when your selection contains a valid C++ expression. If you think that it should be available in some case but is actually not, please send us an example code snippet.

Regarding creating a new template - when you hit the "New Template" button in the "Templates Explorer" window, a new tab should get opened in the editor which allows to set the description of the new template, its availability and contents.

Thanks!

0

Hi It does seem to work now except that I don't see the Surround With {} option when you select something and than open the contect menu (right click) and choose Surround With... (CTRL+K, CTRL+S). It does show up when you select the tool icon in the gutter and choose Surround With Block or Surround With...->More.... It also shows up when you choose from the Main Menu Resharper->Edit->Surround With Template...(CTRL+E, CTRL+U). 

I have a feeling that the Surround With on the contect menu is not the same as the other Surround With options.

0

Tim,

The "Surround With" item from the context menu (invoked with Ctrl+K, Ctrl+S) is builtin Visual Studio functionality (also available via the Edit->IntelliSense->Surround With menu item), and it is not affected by ReSharper in any way.

0

Aha, that explains it. I'm already expecting that all useful features must be from ReSharper :-)

0

Hello,

I have almost the same Problem.

JetBrains ReSharper Ultimate 2016.2.2  Build 106.0.20160913.91321
ReSharper C++ 2016.2.20160913.92511
ReSharper 2016.2.20160913.92608

The complete list of surround templates for c++ won't show up when I use the correct shortcut.

This is the list in the Explorer.

Only three of them were visible.

I have created an own one: {} Alex - this one appears along with the other two.

Funny: While I'm writing this post I have restarted VS 2015 to retest it, now I get the complete list :) Magic ...

But there's still something wrong which should be investigated.

Have fun!

Alex

P.S. : Great Piece of Software...

 

 

 

 

0

Alexander,

If you manage to reproduce this issue, could you please tell us how to do that or record a screen capture (I suggest LICEcap for screen captures)?

Thanks!

0

Please sign in to leave a comment.