jump to navigation

Some ideas on method auto-completion in Padre June 9, 2009

Posted by claudio in Uncategorized.
Tags: , , , , , ,
12 comments

perlAuto-completion is a nice feature for an IDE. While Padre supports some auto-completion functions, method auto-completion is an important missing feature. This post is a short round-up of features present in other IDEs.

What auto-completion features does Padre support today?

Beside automatic bracket completion, Padre has a nice auto-completion implementation for variables (first character -including sigil- then ctrl + p):

padreautocomplete

Eclipse + Epic

Epic (an add-on to Eclipse) has a nice working auto-completion feature activated by the method invocator (->).

epicac

As a reference, the java auto-completion in Eclipse:

eclipseac

Komodo Edit

Komodo Edit also has auto-completion for methods, but does not show those inherited from parent classes making the feature rather useless for OO development.

komodeac

Netbeans

Netbeans has no Perl support, nevertheless the java auto-completion feature is a good example:

nbaujava

The method auto-completion feature is activated by the “.” (“->” in Perl). Not only you get a list of accessible methods (with expected parameter type and return value), but also the javadoc documentation for the selected method.

How should Padre support method auto-completion? Some ideas

  1. Method autocomplete should be activated by “->” and “::”. This way class hierarchies can be autocompleted as well. With “::” support for functions can be added.
  2. Private methods should be hidden. By convention, private methods start with “_”.
  3. Linking method autocomplete to perldoc is a winner combination when programming to not yet familiar APIs and certainly friendly to new Perl developers. While Perl is not strictly typed, a well formatted perldoc entry for a method should make clear what kind of parameters are expected and what the return value could be. However, documentation is rather freely formatted, so it would be difficult to implement in a generic way (without adding formatting restriction to classes).
Follow

Get every new post delivered to your Inbox.

Join 88 other followers