So, if I put something here then it will be shown as the blog description, right ?
Friday, August 17, 2012
GSoC: Improving KDevelop Ruby Support Part 2
In my last post I talked about some of the features I've been working on this GSoC period. Well, now it's time for code completion. Here it goes:
The first thing that KDevelop is showing us is the completion of some ruby builtins like require and require_relative. But I personally find more interesting the following:
It offers code completion for required files when possible. This is also true for the require_relative, as shown here:
Note that in the completion of required files, the final ".rb" is omitted in the end result. This is certainly cool, but let us continue with the code. Now I want to write an "if" statement. After writing "if", KDevelop offers me the completion for this keyword. If I hit enter, this is what happens:
KDevelop puts the "end" keyword for me and it's also reminding me that I should write a condition expression by selecting the "condition" word. Ok, now I want to use the SecureRandom module (which is reachable thanks to the first require) :
As you can see, KDevelop knows which class/modules/methods are reachable in the current context. In this case, the only module that KDevelop knows that starts with "Secure" is "SecureRandom". And finally, let's show code completion for method calls:
KDevelop detected that the class "User" has a method named "create!" and it's giving me some info about this method (parameters, returning type, ...).