开发者

Suppress renaming in CodeRush

How do you supress renaming on code rush temporarily because each time I rename a local variable it has this green box on it and even changes my comm开发者_如何学运维ented code (that uses the local variable I am using)

Example:

Consider this method:

public static tblBadorder GetBadOrderByBadOrderID(int badOrderID)
{

    tblBadorder User = db.Select.From<tblBadorder>().Where("BadOrderID").IsEqualTo(badOrderID).ExecuteSingle<tblBadorder>();
    return User;

}

If I accidentally hit rename on "tblBadorder" ( I hit CTRL + ` )

tblBadorder User = db.Select.From<tblBadorder>().Where("BadOrderID").IsEqualTo(badOrderID).ExecuteSingle<tblBadorder>();

I would click away from the variable type to prevent renaming, However If I want to change the User type to "tblOrders":

tblOrders User = db.Select.From<tblBadorder>().Where("BadOrderID").IsEqualTo(badOrderID).ExecuteSingle<tblBadorder>();

The rename binding and the green box wont disappear. Hence If I do this It would change the name of tblBadorder Class and other files that reference to it.


Simply press Enter key to commit your changes.


Isnt this a Doctor, it hurts when I do this issue?

How are you triggering the rename - is it possible to prevent that from happening? If you could explain that, it might lead to better answers.

This would be the best approach.

The nuclear option is to disable rename via: Editor \ Refactoring \ Catalog

The middle way is to find the binding (IDE|Shortcuts) that triggers it and disable that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜