ReSharper的重命名字段 [英] Resharper Rename Fields

查看:1565
本文介绍了ReSharper的重命名字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在负责制作一些显著的修改并非通过我们目前的code样式约定写了一个传统的codeBase的。这些变化是开始之前广泛,以至于我在做一些清理和重构(有相当多的死code)。其中的多数民众赞成窃听我的事情之一是,该字段遵循m_FieldName命名约定,而我们现在使用_fieldName。

I've been tasked with making some significant modifications to a legacy codebase that was not written using our current code style conventions. The changes are extensive enough that I'm doing some cleanup and refactoring (there was quite a bit of dead code) before getting started. One of the things that's bugging me is that the fields are following the m_FieldName naming convention whereas we now use _fieldName.

有一些方法与ReSharper的自动重命名该项目遵循新公约的所有领域?是否还有其他的工具,可以很容易地做到这一点?这不是太难以去除的prefixing'M'就算了,简单的查找/替换,但我还没有找到一个自动化的方式来改变首字母的大小写。

Is there some way with Resharper to automatically rename all fields in the project to follow the new convention? Are there other tools that can readily do this? It's not too difficult to remove the prefixing 'm' with even a simple search/replace, but I haven't found an automated way to change the case of the starting letter.

推荐答案

这可能是最好只查找/替换< M + _ _ 使用Visual Studio(经常EX pression查找/替换)。

It might be better to just find/replace <m_ by _ using Visual Studio (regular expression search/replace).

&LT; 代表字开头的

编辑:似乎有没有办法,用查找/替换,下划线后修改的第一个字母的外壳

There seems to be no way, using Find/Replace, to modify the casing of that first letter after the underscore.

所以,你会做这个操作26次在一排,像这样:

So you would have to do this operation 26 times in a row, like so:

Replace <m_A by _a
Replace <m_B by _b

,然后你所有的设置。有趣,太:-)但它应该只需要几分钟的时间。

and then you're all set. Fun, too :-) But it should only take a few minutes.

这篇关于ReSharper的重命名字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆