I'm watching Stephen A Bohlen's excellent Summer of NHibernate series, and have been watching him interact with CodeRush. I've recently installed ReSharper (I'm a ReSharper newbie), and I'm trying to find some of the ReSharper productivity equivalents that Stephen is demonstrating (tangentially) with CodeRush.
As an example, he demonstrates highlighting a code block that looks like this:
ISession session = GetSession();
session.xxx
and then turning it into
using (ISession session = GetSession())
{
session.xxx
}
He does this by highlighting the block he wants to surround with the using statement and then invoking some CodeRush template. I've been unable to figure out how to do the equivalent thing with ReSharper. I found the ReSharper Surround command (within the Code command), but when you select the using statement, it does surround your highlighted code block, but it does not seem smart enough to put the first line within the using clause. That is, it results in:
using ()
{
ISession session = GetSession();
session.xxx
}
which requires me to move the first line into the using clause. Am I missing an easier way?