History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-4079
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Sergey Shkredov
Reporter: Ilya Ryzhenkov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

Extract method: doesn't work when selecting block

Created: 05 Aug 06 00:47   Updated: 21 Feb 08 23:52
Component/s: Refactorings - Extract Method
Fix Version/s: Future Versions
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 96
Old URL: http://www.intellij.net/tracker/resharper/viewSCR?publicId=4079


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order:
Dmitry Shaporenkov - 07 Aug 06 15:58
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 - 07 Aug 06 15:58
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.