Code Assist features try to assist the user during source code editing.
The features currently implemented in EPIC are rudimentary. An option to utilize a user-defined script for code assist suggestions is provided to allow integration of more powerful, external code generation tools.
When you press one of the auto completion characters $ @ %
, the editor displays all defined variables in a
list. From the list you can select the variable that should be inserted in the source
code.
The editor tries to display methods available in modules when the auto completion
characters >
or :
are entered.
Currently, indirect object invocations are not recognized by code assist. This code block will not work:
$smtp = new Net::SMTP; $smtp->[no content assist]
This one will work:
$smtp = Net::SMTP->new(); $smtp->[content assist]
If specified on the Code Assist preferences page, a user-defined Perl script can compute autocompletion suggestions instead of or in addition to EPIC's built-in ones. It is called by EPIC with the following arguments:
Based on the provided information the script is supposed to generate on standard output a list of autocomplete suggestions or "proposals" which, if not empty, take precedence over EPIC's built-in generation. Each suggestion contains instructions to insert/replace a contiguous piece of text at a given position in the source document and move the caret to a new position. A suggestion is formatted as a comma-separated list of "replacementOffset,replacementLength,newCursorPosition,replacementString":
Suggestions are separated from each other by the special <|proposal|>
token.
Refer to the source code of org.epic.perleditor.editors.util.ExternalAutoComplete for further implementation details.