Are there any open source command line tools to refactor java code? [closed]

倾然丶 夕夏残阳落幕 提交于 2019-11-28 21:25:02

问题


I use vim as my editor but I would like to get some of the same power of the IDE's for java when it comes to refactoring. Are there any commandline tools for refactoring java? I could probably hack something together using perl or vim scripting but if there is something already out there I'd rather use that.


回答1:


Check out jrefactory, and its command line option.




回答2:


You could try Eclim. The goal of Eclim is to expose the functionality of Eclipse within Vim. In particular, there are a few commands for refactoring that are supported.




回答3:


Code refactoring is a very context-sensitive and interaction-heavy process which doesn't lend itself very well to command-line interfaces. There can be dozens of types of refactorings you could do to a particular file (or set of files) and coming up with a vim interface to integrate all of this would be a major challenge.

If you want IDE functionality, why not use an IDE? Especially with Java, which lends itself so well to automatic refactoring by a complex piece of software like Eclipse.




回答4:


I would strongly advise you to use VIM within an IDE (e.g. VIMPlugin and Eclipse - this is the combination I use and it works very well).

I used to be a VIM diehard. However the refactoring and code analysis within a modern IDE will far surpass any capabilities that VIM will provide (with plugins etc.).

Don't get me wrong. I love VIM and still use it for all sorts of stuff. Modern IDEs are the most productive route forward, however.




回答5:


I know this is an older question, but I was asking myself this question a bit back and decided to write one. It's new and it not "super awesome yet" but it's written in GOLANG and it's open source. DISCLAIMER, this is my project but I am not self promoting. I just thought I'd share with others that care about something of this nature.

https://github.com/asharif/ref



来源:https://stackoverflow.com/questions/704062/are-there-any-open-source-command-line-tools-to-refactor-java-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!