Hello Eric,
> Where exactly does type inference come in for an auto-completion
> feature for an IDE?
> Something so heavyweight as type inferencing is unnecessary for doing
> 90% of the work of figuring out what the likely completions for a
> particular chunk of code you're writing.
> While this won't get an accurate completion every time, you really
> don't care. You'll find that 90% of the time the word you want is less
> than 3 presses of tab away.
Unfortunately this is not what people expect, at least when they come
from the Java world. Code Completition is a learning tool not
primarily to save some keystrokes. You slowly learn the available
messages for a class while writing your code. Therefore a much better
way then showing a huge list with hundrets of strings list should be
available.
Have you used Readline tab completion in irb? It is far from useful, giving you too many potential completions from too far up the inheritance tree.
And methods have the heuristic that they share a common
prefix and differ only the last characters. This makes your
(emacs/vi) completition even more useless.
In the cases where I've found methods that share a common prefix, I've found it rare that I'm actually calling those methods from regular code. Test::Unit is the best example of this. I have many, many methods starting with test_ but I never call them.
In the cases in Ruby where there are methods that share a common prefix, #each comes to mind, I don't see how this is useless at all.
I type ea<tab> and see "each" then I hit tab again "each_line" and again "each_with_index" which is the one I wanted. I don't see how that's less useful than the ones I've seen in MS' VB editors. (Besides, I'd never tab-complete 'each', all but the 'c' is on the home row of a Dvorak keyboard.)
If you still think its totally useless I'd like to see a series of keystrokes that show how it falls down.
FWIW, ri says there's the following possible each completions:
Core: #each #each_line, #each_with_index, #each_value, #each_pair, #each_key, #each_byte, #each_object, #each_pair
Pathname: #each_entry, #each_filename
YAML: #each_document, #each_node
Vector: #each2
You can only get those last 5 by requiring extra libraries.
···
On 29 Mar 2005, at 21:30, Lothar Scholz wrote:
--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04