Like eclipse java when we type "." All the available methods and variable displayed .can the same thing possible in Ruby eclipse (external library methods)
-
This is not a programming question. This is something that you should investigate on the Eclipse site or be asking on their support forums. – JeffC Oct 28 '15 at 03:27
1 Answers
Values in a statically typed language like Java have a fixed type that the editor can figure out by looking at the code. Values in a dynamically typed language like Ruby could be pretty much anything. In a very rough sense think of Ruby as being like only using the Object
type for all variables, parameters, and return types, and then invoking all methods via reflection.
That's why fancy Eclipse features like autocomplete, call heirarchy, and automatic refactoring don't work with reflection, and also why Eclipse doesn't generally provide them for dynamic languages, or does so in much more limited fashion. You can make them work some of the time using a lot of clever heuristics but they will break more readily than the analysis of a static language and be far more complicated to implement than the equivalent tools to do the same analysis of a static language.
Java is also simply older and more heavily used than Ruby so there has been more effort put into tools to do static analysis on Java code.
Ruby is also a particularly difficult language to do this sort of thing for even compared to some other dynamic languages as it has tricks like the missing_method
and responds_to_missing?
methods that allow the methods the object knows how to respond to to be determined when the call is made. I'm not as familiar with Python as I am with Ruby but I don't think it allows that sort of thing so it might be a bit easier to autocomplete for than Ruby. (On the other hand the Ruby way of doing things allows for some very interesting dynamic delegation)
-
All of those fancy features that you claim don't work with dynamic languages were *invented* in IDEs for dynamic languages. Eclipse started out as a Java port of VisualAge for Smalltalk, after all, and most if its features already existed there. IDEs for static languages are still behind modern Smalltalk IDEs. The reason why it doesn't work for Ruby is because nobody has invested money in making it work. Millions have been spent for Smalltalk and Java IDEs, which is why Smalltalk and Java IDEs are quite good. Haskell has even more type information available than Java, yet its IDEs are a lot … – Jörg W Mittag Oct 27 '15 at 22:45
-
… less powerful. Why? Because IBM, Microsoft, Oracle, JetBrains, Embarcadero don't invest in it, not because Haskell somehow lacks the static type information (that would be ridiculous). Haskell doesn't even have subtyping! – Jörg W Mittag Oct 27 '15 at 22:47
-
My point is that static analysis of dynamic languages is both much harder to do and the scope of what's possible is much smaller. I'm not at all saying dynamic languages are bad, I love Ruby, it's just that it's much more effort for a much smaller return when it comes to realtime static analysis features in an IDE. That Java is a more heavily used and older language is certainly also a factor. – smithkm Oct 27 '15 at 23:00