开发者

Automatic way to put all classes in separate files [duplicate]

开发者 https://www.devze.com 2023-02-13 22:52 出处:网络
This question already has answers here: How can I extract all classes into separate file? (3 answers) Closed 9 years ago.
This question already has answers here: How can I extract all classes into separate file? (3 answers) Closed 9 years ago.

I've started to refactor/clean up big project. Some of files contains few small classes or few enums (yeah, it is very messy;/ ).

Is there some method or tool to automatically divide files with few enums/classes and create separate files for each of them?

As Fredrik Mörk said - Resharper is very good tool and has possibility to do what I need. Bu开发者_开发技巧t of course as almost all good tools it costs (for one it is cheap, for another not:) ).

Maybe there is some free tool for such simple refactoring? (my boss will not pay for Resharper - he told me that I need 'hammer' not a whole workshop:) )


Resharper has a refactoring that moves a type to a separate file. Might be that it can be applied on a higher level (as project); don't have it installed on this machine to verify though.

Edit: noticed in the online help that there is a refactoring called Move Types Into Matching Files that does exactly what you are asking for.


CodeRush xpress (free) also supports Moving a type into a matching file

Automatic way to put all classes in separate files [duplicate]

0

精彩评论

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