function list autocompletion
| From: | Shailesh Humbad | Date: | Tue, 25 Nov 2003 11:29:03 +0000 |
| Subject: | function list autocompletion | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-22223@lists.php.net to get a copy of this message | ||
Hi,
It's great to see this feature finally online. I don't know if my suggestion
(http://www.somacon.com/phpref/) in the phpdoc newsgroup prompted it, but I'm hoping it did and
I'm sure other people suggested it too.
Obviously, your implementation beats mine by several magnitudes, with the addition of list
compression and a visual dropdown. However, having thought about this type of interface
significantly (http://somacon.com/jumpto/ and http://atensoftware.com), I do have some recommendations.
While the general populace may be clueless about keystroke commands, we developers love them for the
time they save. Unfortunately, I know you can't capture the tab key in browsers reliably, as
that would have been ideal to 'complete' the topmost entry. But your choice of the space
key as an alternate precludes the ability to do multi-keyword querying. For instance, if I want to
find mysql_fetch_array, I can type in "my arr" to get to the function in 6 keystrokes.
This is far more efficient than typing "mysql_fetch_ar", a full 14 keystrokes.
I would suggest eliminating the auto-completion entirely. It is redundant once you implement
multi-keyword querying. All you have to do is split the query by spaces into separate keywords,
then match any function that contains all the keywords. The whole point is to get to a single
function in as few keystrokes as possible. That means that you should 'highlight' the
entry as soon as it narrows down to a single entry. (You should also always 'highlight'
the topmost entry when there are multiple.) Then, when the user presses enter, the highlighted
entry is auto-completed and jumped to immediately.
Your current implementation mimics the auto-complete designed by Microsoft, which is fancy, but
inefficient and awkward. That auto-complete is efficient for a source-code editor where space key
means the next word. In the confines of a search box of only functions, you can use the space key
as I described above for greater efficiency. This is the model designed by the guys at Nullsoft; to
see that in action, just press "J" from the Winamp 2.x play list.
On the same vein as keystroke commands, I also suggest special symbols which can force a keyword to
match the start or end of function name. Examples:
"^html" matches any function starting with "html"
"$query" matches any function ending in "query"
"arr ^my" matches any function containing "arr" and beginning with
"my"
The default search mode of a keyword without symbols should be "contains". The
"^" symbol matches the start and "$" symbol matches the end. These two symbols
are all that is needed, and they follow POSIX regular expression convention.
I'm impressed with the speed and visual appeal of the current beta. I hope my suggestions will
be helpful. Please let me know if you have any questions.
Regards,
Shailesh Humbad