Method argument auto completion. Follow
I would like to know how to use Rubymine's features around autocompletion for method parameters.
def my_method(opt)
puts "This is a parameter value " + opt[:my_param_value]
end
I would like to type the method name and it show me the defined symbol :my_param_value.
Then when I select the symbol, I want it to add the goes to '=>' operator.
Please sign in to leave a comment.
Hello Scott,
It is easy to implement such a functionality for synthetic examples, but we don't think this will be real usefull in real life.
If you take a look at Rails methods which takes hashes as one of parameters you'll see that only a couple of keys is usually mentioned in method body,
others are used somewhere else in the call hierarhy. Processing the whole call hierarhy is CPU high consuming operation and can be rather slow.
Regards,
Oleg
I agree that it would be CPU intensive to find all of the the symbols in a method. Is there any documentation on how Rubymine supports method signature auto completion?
Scott,
It is easy and rather cheap to get symbols from single method's body and very expensive to recursively analyze all methods calls(which take opt hash argument) from that method body.
At the moment we don't have any special logic for method signature autocompletion.
You can have a look at some of RubyMine's specs at: http://www.jetbrains.net/confluence/display/RUBYDEV/RubyMine+Specifications