Tips and Tricks

The following tips and tricks give some helpful ideas for increasing your productivity in Maple programming.

Editing | Navigation | Views

Editing source

Content assist Content assist provides you with a list of suggested completions for partially entered strings. In the Maple editor press Ctrl+Space or use Edit > Content Assist.

Content assist selection dialog
Content assist for variables You can use content assist to speed up the creation of defined modules, procedures, parameters and local variables. With the cursor positioned after the type name of the declaration, press Ctrl+Space or use Edit > Content Assist.

Content Assist proposals
Use templates to create a module Templates are shown together with the Content Assist (Ctrl+Space) proposals.
There are existing templates, such as 'module', 'proc' and more, but you can also define new templates for method stubs.
After applying a template, use the Tab key to navigate among the values to enter (return type, name and arguments).

Content assist with new module template proposals
Create your own templates To create your own templates, go to the Maple > Templates preference page and press the New button to create a template.

Please explore Adding/Editing templates for more information.
Use the local history to revert back to a previous edition of a module Whenever you edit a file, its previous contents are kept in the local history. Maple tooling makes the local history available for Maple elements, so you can revert back to a previous edition of a single method instead of the full file.

Select an element (e.g. in the Outline view) and use Replace With > Local History to revert back to a previous edition of the element.

Code navigation and reading

Open selection in Maple editor There are two ways how you can open an element from a reference in the Maple editor.
  • Select the reference in the code and press F3 (Navigate > Open Declaration)
  • Hold Ctrl, move the mouse pointer over the reference, and click the hyperlink
Hyperlink style navigation

Holding Ctrl on an module, proc or variable and click to directly open the declaration of given Maple element.

The hyperlink style navigation can be configured on the General > Editors > Text Editors > Hyperlinking preference page.
In-place outlines Press Ctrl+O (Navigate > Quick Outline) in the Maple editor to pop up an in-place outline of the current source file.

Inplace outlineInplace outline
Advanced highlighting The Maple editor can highlight source code according to its semantics (for example: comments, numbers, keywords etc.). Have a look at the various options on the Maple > Syntax Coloring preference page.

An example of advanced highlighting.
Mark occurrences When working in the editor, turn on Mark Occurrences in the toolbar (Picture of Mark Occurrences Toolbar Button ) or press Alt+Shift+O. You'll see within a file, where a variable, method or type is referenced.

Editor with occurrences of 'info' marked

Different colors are used to mark declaration and its references.

Selecting a variable to see where it is used. Select an module to explore its declaration.

Reminders in your Maple code When you tag a comment in Maple source code with "TODO" or "FIXME" the Maple compiler automatically creates a corresponding task as a reminder. Opening the task navigates you back to the "TODO" in the code.

Task tags in editor and task view

Maple views

Structural compare of Maple source A structural comparison of Maple source ignores the textual order of Maple elements like modules and variables and shows more clearly which elements were changed, added, or removed.
For initiating a structural comparison of Maple files you have the following options:
  • Select two Maple compilation units and choose Compare With > Each Other from the view's context menu. If the files have differences, they are opened into a Compare Editor. The top pane shows the differing Maple elements; double clicking on one of them shows the source of the element in the bottom pane.

Structural compare of Maple source

Maple Project indicator Enable the Maple Type Indicator on the General > Appearance > Label Decoration preference page to find out what the first type in a compilation unit or class file is. An adornment is shown for interfaces, annotations, and enums, while an ordinary class stays undecorated.

Picture of Maple Type Indicator Label Decorator