EPIC performs on the fly syntax check of Perl source files. In order for the Syntax Check to work, the Perl Interpreter has to be set up correctly (see Setting up Preferences).
The Syntax Check is performed after a defined idle period, after the user has stopped typing. This idle period can be configured in the preferences.
When an error/warning has been found, the editor displays the appropriate icon in the annotation ruler (the gray bar on the left side of the editor), underlines the error in the source, and inserts a marker into the Problems View window.
A syntax check can be enforced by pressing Shift+F5. It is also triggered automatically by saving a source file.
In addition to displaying warnings and errors, the editor is capable of explaining them in more detail.
To get an Error/Warning explanation, right-click the Error/Warning icon and select Explain Errors/Warnings from the dropdown menu.
The explanation(s) will be displayed in the Explain Errors/Warnings View.
Open SUB Declaration allows the user to search for the declaration of a specific SUBroutine.
The search first determines what is selected. If no text is selected, it attempts to find a subroutine name at the current cursor position. The search will fail if no subroutine name is selected.
Due to the dynamic nature of Perl programs, the search is not entirely reliable. For subroutine names qualified by a package prefix, an attempt will be made to locate the appropriately named module file using the @INC path. For unqualified subroutine names, the search will first occur in the current editor and then extend to modules referenced by 'use' statements.
If the subroutine declaration is found in a file inside workspace, it will be highlighted in an existing or new editor.
To retrieve Perldoc information, select a keyword or text and choose Perldoc from the context menu or press Shift+Ctrl+H.
If nothing is selected, an input dialog will appear.
If Perldoc entries are found, they are displayed inside the Perldoc View.
NOTE: Perldoc has to be installed and available in the system PATH, otherwise this feature will not work.
Apart from Perldoc support a quick reference feature is available. This feature has the advantage that no perldoc has to be installed on the system but does not provide as much information as perldoc.
To view the Quick Reference, select a keyword and move the mouse pointer over the selection.
A tooltip with a short description of the keyword should appear.
Code Assist features try to assist the user during source code editing.
NOTE: The features currently implemented in EPIC may not be fully functional but will be improved in the future.
When pressing one of the auto completion characters $ @ % the editor displays all defined variables in a list. From the list the user 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 pressed.
NOTE:
Currently the Indirect Object Invocation is not recognized by code assist.
This code block will not work:
$smtp = new Net::SMTP;[no content assist]
$smtp->
This one will work:
$smtp = Net::SMTP->new(.....);[content assist]
$smtp->
TODO Markers
are a very convenient way to add todos to the Eclipse task list.
A TODO marker is generated when a #TODO anytext is found in the Perl source code.
You can customize the keywords which mark ToDos in the preferences (Preferences > Perl EPIC > Task Tags).
On deletion of the #TODO comment, the TODO Marker is also deleted.
Templates allow for easy insertion of predefined text segments. In addition to normal text these segments can also include pre-defined variables that are included at runtime as well as variables that are specified by the user when the template is inserted.
Templates are defined in the EPIC Preferences (Window > Preferences...).
To define a new template press the New... button.
To insert pre-defined variables press the Insert Variable... button.
In addition to pre-defined variables the user can specify additional variables ( using the syntax ${varname} ) which can be edited when the template is inserted. When the first variable is inserted variables with the same name will automatically be changed.
Templates are invoked by typing some characters and pressing Ctrl+Space.
Templates matching the typed characters will be displayed in a list. A preview is also available.
If the template contains user defined variables the user can press the TAB key to jump to the next variable after the template has been inserted.
EPIC uses PerlTidy for source code formatting (PerlTidy is included in the EPIC package).
To format the source code select Source > Format from the Eclipse menu or use Ctrl+shift+f.
PerlTidy settings can be changed in the Source Formatter preference page.
NOTE: Source formatting might take a while if the source code has a lot of lines.
The editor supports folding of POD comments and subroutines.
Source Folding can be disabled in the Editor Preference page.
NOTE: On big files source folding can decrease performance. So if you experience slowdowns, disabling source folding might help.
Extraction of subroutines is supported by the use of the CPAN Devel::Refactor module.
To extract a subroutine mark the code to extract and select Refactor>Extract Subroutine from the popup menu.
In the popup menu insert the name of the new subroutine and press Enter.
The new subroutine will be placed at the end of the Perl script (before __END__ section) and the selection will be replaced with the subroutine call.
NOTE: The extraction might not work properly at the moment because the Devel::Refactor module is in an early stage of development. With upcoming versions of the module this function should become more reliable.
To export select Source > Export > HTML from the Eclipse menu and specify an output file.
HTML export settings can be changed in the Source Formatter preference page.
NOTE: For HTML export to work a working Source Formatter is needed.
The Outline View displays packages and subroutines defined in the edited file. Modules referenced by 'use' statements are also shown. By clicking on the module/subroutine name the editor will jump to the appropriate position in the source code. When the cursor is moved inside of a subroutine's definition, the subroutine will become selected in the Outline.
Subroutines named new will get a different icon.