Project
ReSharper
Priority
Normal
Type
Bug
Fix versions
5.1
State
Won't fix
Assignee
Sergey Shkredov
Subsystem
No subsystem
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Ilya Ryzhenkov
    5 years ago (05 Aug 2006 00:47)
  • Updated by   Kirill Falk
    2 years ago (17 May 2010 16:27)
  • Jira: RSRP-4079
    (history, comments)
 
RSRP-4079 Extract method: doesn't work when selecting block
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
	public class Foo
	{
		public void foo()
		{
			if (1 == 1)
			{
				DoThis();
				DoThat();
			}
		}

		private void DoThis()
		{
			throw new NotImplementedException();
		}

		private void DoThat()
		{
			throw new NotImplementedException();
		}
	}


Select 'if' block including brackets - it will not allow to extract method.

Issue was closed
Comments (2)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Dmitry Shaporenkov
  Dmitry Shaporenkov
07 Aug 2006 15:58
5 years ago
Re: #4079- Extract method: doesn't work when selecting block
Oddly enough, for me selecting the block is quite reasonable way to extract it into a method.
Oleg Stepanov
  Oleg Stepanov
07 Aug 2006 15:58
5 years ago
Re: #4079- Extract method: doesn't work when selecting block
It shouldn't since the "block" is integral part of the if statement and not a statement or sequence of statements itself. You should either select the whole if statement or only its block without braces.