3 ms·
As someone about to open-source something that does Java refactoring from the command-line (as a small part of a larger research project related to optimisation
by wzdd 16y ago
As someone about to open-source something that does Java refactoring from the command-line (as a small part of a larger research project related to optimisation) I feel like I ought to respond. :)
You make a good point about refactoring. It's useful, and I should do it more. But this comment goes a bit too far:
> [people edit projects, not text, therefore] a good IDE will always be better than vim
This is an unassailable assertion. If anybody manages to come up with an example in which Vim is better than an IDE, it is always possible to respond with "that's not a good IDE", possibly with qualifications ("you shouldn't be editing Java in that IDE").
One possible response goes to the definition of "better": I contend that Vim is, in fact, a better environment for creating, debugging, and generally editing files. This is actually a large part of what I do, so I appreciate it. I have been using Eclipse quite a bit recently, because it's the standard IDE for Android app development, and while it provides some great refactoring tools, it is not nearly as good as Vim is for actually editing code. I don't really understand what you mean w.r.t. "formal grammar": even Vim and Emacs can be trained to do things that rely on language-specific syntactic knowledge (examples: code completion, code folding, context-specific search). What's missing in non-IDE editors is a concept of a "project", and semantic knowledge for refactoring. That is not the same as grammar.
- binaryfinery 16y agoA command line java refactoring tool? That would be cool. Is it possible to extend it to other languages? Do you have a link - even if its to a "coming soon" page? Let me reduce "good ide" to IntelliJ or Eclipse if that helps. By "formal grammar" I mean that both Eclipse and IntelliJ have full Java parsers. So they can successfully rename a method on an interface, all its implementations and all its uses. This can be done if and only if the tool can correctly identify which text symbols represent a class, interface, variable declaration and method invocation, and further it can infer the type the variable in a method invocation using information from that variables declaration, even though it may be in another file. That needs a parser. So you are correct in that you don't have to write a formal grammar to do it. You can hand role your parser. I used "formal grammar" to imply a level of complexity. Does vim have a tool of such complexity?