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

Key: RSRP-29352
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Andrey Simanovsky
Reporter: Serge Baltic
Votes: 0
Watchers: 0
Operations

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

"Check if variable not equals null" ContextAction/QuickFix Should Respect Formatting Rules

Created: 04 Oct 06 22:16   Updated: 13 Dec 06 21:03
Component/s: Context actions
Fix Version/s: 3.0, 2.5.1
Security Level: Everybody (All jira users)

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

Fixed in build: 400


 Description  « Hide
An if clause is prepended to the current statement. Should be added on a new line, with braces inserted as appropriate.
string smth = "";
if(DateTime.Now.Second == 0)
  smth = null;
foreach(char c in smth)
{

}

In the foreach statement, use the "Check for 'null'" conetxt action on "smth". You get:

string smth = "";
if(DateTime.Now.Second == 0)
  smth = null;
if(smth != null) foreach(char c in smth)
{

}

After doing Reformat, it becomes:

string smth = "";
if(DateTime.Now.Second == 0)
  smth = null;
if(smth != null)
{
  foreach(char c in smth)
  {
  }
}

Should look this way right after applying the action.



 All   Comments   Work Log   Change History      Sort Order:
Andrey Simanovsky - 09 Oct 06 21:06
Please, provide example and settings when it does not work.