Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » pdt has a hidden feature: hippie completion
pdt has a hidden feature: hippie completion [message #94891] Mon, 02 March 2009 20:28 Go to next message
exceptione is currently offline exceptioneFriend
Messages: 96
Registered: July 2009
Member
Hey guys,

Today I discovered a feature that have been completely unknown to me:
hippie completion. I guess most or maybe even all other users here don't
know about this feature too, so I 'll share it with you.

In 2002 Lev Epshteyn send this bugreport:
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=11668]
> While the current Alt-Space visual autocomp works great to let people look at
> possible choices of
> methods/objects they can use, when one is coding java, oftentimes it is
> repetitive typing that
> gets in the way. A visual autocomp is not going to save too much time in this
> instance, as the
> programmer must "switch contexts" to look at the available options and select
> the appropriate
> one.
>
> An emacs style auto completion would help this. (For your reference, emacs'
> hippie
> autocomp searches the open buffers for words with similar starting letters, and
> pastes them
> right into the buffer once Alt-/ is pressed. Subsequent presses of Alt-/ cycle
> through all the
> possible completions. Because the algorithm used outputs the most recently used
> words first,
> the proper match is generally - 90% of the time - found after one or two
> presses of Alt-/)
>
> Allowing
> developers to use both Alt-Space and Alt-/ would yield greatly improved
> programmer efficiency -
> especially in Java where identifier names and class names can get pretty long.

I tried this in PDT 2.0.0 and yes it seems to work, although it is a bit
flawed here.
To give you an example

<?php
$bool = false;
$bar = "45";
$foo = 34;

// now, we type
$tree = $
// pres ALT+/ the previous entered variable is shown [*1]
$tree = $tree
// pres ALT+/, the previous next variable is shown
$tree = $foo
// pres ALT+/, the previous previous next variable is shown
$tree = $bool

?>

Some glitches:
- you need to press $ before you can use ALT+/, this pretty much defeats
the speed improved which would be gained otherwise.

- it doesn't make much sense to include the left hand assignment in the
right hand of an expression if it isn't declared before. You can see
that in case [*1]


I am a bit hesistant to send in a bug report, since there is already
lots of pressure on the developers to bring the functionality of pdt 2
on par with pdt 1..

I hope you enjoyed this tutorial :)
Re: pdt has a hidden feature: hippie completion [message #94924 is a reply to message #94891] Tue, 03 March 2009 06:16 Go to previous message
Eclipse UserFriend
Originally posted by: mnm.criion.net

Nice one, thanks :)
Previous Topic:Old ip address prevents PDT debugging?
Next Topic:Contribution Item
Goto Forum:
  


Current Time: Thu Apr 25 08:17:16 GMT 2024

Powered by FUDForum. Page generated in 0.02935 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top