More accurate Code Completion

Hey guys,

I have some ideas on how to make Code Completion in RubyMine more useful.

1. Indicate to the user the currently inferred type. For example, when the cursor is on a variable, it should be easily visible to the user if RubyMine has inferred a type, and if yes, which type it inferred. This way the user will directly know if code completion is going to work.

2. When the user attempts to invoke code completion, but a type or scope could not be inferred, there should be a [optional] fallback to code completion list based on simple look-up table. Similar to the way completion works in plain text files.

3. Increase the quality and accuracy of type inferrence. I know it's very difficult to accurately infer types in a dynamic language that's full of "meta"... But have a look at RSense. http://cx4a.org/software/rsense/ ... I wished RubyMine's Code Completion was as awesome as this :)

Would really like to hear your thoughts on this.

Stefan

1 comment
Comment actions Permalink

Hello Stefan,

Thanks a lot for the suggestions, find the answers below.

1. Indicate to the user the currently inferred type. For example, when the cursor is on a variable, it should be easily visible to the user if RubyMine has inferred a type, and if yes, which type it inferred. This way the user will directly know if code completion is going to work.


Actually I think that RubyMine gives you enough info in autocompletion popup window, you can see birth type of any item you want, and I don't see any way how to make it more explicit.
Any ideas?

2. When the user attempts to invoke code completion, but a type or scope could not be inferred, there should be a [optional] fallback to code completion list based on simple look-up table. Similar to the way completion works in plain text files.


Well, this one makes sence, at the moment we propose Object type members in autocompletion. Could you please create a feature request?
Also next RubyMine will support YARD out of the box: http://blogs.jetbrains.com/ruby/2011/04/what%e2%80%99s-mining-advanced-yard-support/
Thus you'll be able to add type annotation manually in case if RubyMine fails.

3. Increase the quality and accuracy of type inferrence. I know it's very difficult to accurately infer types in a dynamic language that's full of "meta"... But have a look at RSense. http://cx4a.org/software/rsense/ ... I wished RubyMine's Code Completion was as awesome as this :)

Would really like to hear your thoughts on this.

Stefan

Thanks lot for the link on rsence, could you please attach a couple of examples where RubyMine fails for you and rsence works well?
We are constantly working on RubyMine type inference quality, here you can read some useful information: http://blogs.jetbrains.com/ruby/tag/type-inference/
By the way, at the moment we have some huge architecture refactoring, which will significantly increase RubyMine speed. And I hope accuracy.


Looking forward to hearing from you.
Regards,
Oleg

0

Please sign in to leave a comment.