Code completion is a unique feature of OptiPerl. It helps the programmer find variables and subroutines in classes, and also if possible information about their parameters.

 

Code completion is activated while typing if you have enabled it, or from the Edit Menu / Code completion.

 

icon_arrow Enter the following:

 

use CGI;

$cgi = new CGI;

$cgi->

 

After pressing the last > an pop-up should appear showing methods for the class. While browsing you may notice that for some methods in the window, optiperl has also found more information, so it appends it's parameters (in parenthesis), for example remote_host() in the pop-up window.

 

codecompletion

 

Select one of the methods with extra information. The method will be added in the editor. Afterwards, if Hints are also enabled, then more information will appear:

 

codehints

 

You can also do the following:

 

$CGI:: (pop-up)

or

&CGI:: (pop-up)

 

When does it work:

Code completion in the above cases will work with most libraries in the lib and site\lib path of perl. Extra information about methods are extracted if found in embedded pod documentation and if it is written in the way most CPAN module developers write it.

 

However it will work with your custom modules also, if OptiPerl can find them. So make sure they are in the same directory as the script using them, or the @INC path as set from OptiPerl's options or project options (for more information see how OptiPerl finds modules. Note that a module is found if it's in a bold font in Code Explorer's Uses or Requires node.

 

icon_exclaim Important: Perl does not predeclare classes like other languages do. Because of this, the results of Code Completion will never be completely accurate, or sometimes may not list all methods in a class.

 

Other Uses

 

icon_arrow With OptiPerl's code completion you can also do the following:

 

print "<  (popup dialog)

 

htmlcompletion

 

 

icon_arrow Also all of perl's standard functions are included. Try pressing Shift-Ctrl-Space (the default keyboard shortcut for code completion) while typing:

 

perlcompletion

 

A small hint box about perl's function also pops up while typing a function or hovering with the mouse.

 

Top  Previous  Next