Assistant - Pro!

The Assistant tool provides visual feedback in the editor about any code issue by highlighting corresponding symbols using styled and colored line. By default, errors, warnings and To-Do's are highlighted using red, green and gray wavy line respectively. Each issue has description associated with it and description text for every issue can be shown in the hint window that appears if mouse cursor is placed under the code issue.

Assistant provides special Insight window, which can automatically poped-up in the location of code issue nearest to the caret position and shows information about the particular issue or list of possible actions to complete (resolve) it.

There are two kinds of Assistants: Info Assistant and Code Assistant.

The Info Assistant shows description for the issue if there are no actions that may be performed to resolve the issue. It is useful as it can provide more convenient feedback about the code issue than Structure View as it always visible and placed near caret and probably near the point of the user view.

Info Assistant
Info Assistant

The Code Assistant shows description for the issue along with the list of actions those can help to resolve it. Code Assistant provides most convenient way to resolve issues as it allows fixing of issue without having to leave current cursor position. It allows fixing of the issue manually or by invoking of appropriate tool. As soon as issue is resolved, it restores original caret position. The user is able to fix the issue quickly using prompted shortcut or just using mouse. There is also ability to popup and focus Code Assistant using Alt-Enter (CUA) keystroke and use usual keys to navigate through the fix actions and the Enter key to choose(invoke) required one.

Code Analyzer  with Assistant
Code Assistant

Another way to fix issue is using context popup menu and this way is useful when Code Assistant is disabled.

Code Assistant integrated into context menu
Code Assistant integrated into context menu

Assistant can be configured to automatically fix certain types of errors without prompting to the user. The following errors currently can be automatically fixed:

  1. Type cast errors - by adding required type cast.
  2. Unknown class errors - by adding appropriate import statement. It's possible to specify policy for each short class name that exactly defines what action should be done to make this name known in the code.

It's usual thing when several classes with the same short names are be defined in different packages (java.util.List and java.awt.List is the good example). To simplify working with such classes it's possible to specify a list of most frequently used classes using the Project Properties | Productivity! | Assistant property page. Such list is used to determine particular class to import or to show in the top of the list in case of existence of several different candidates.

It's possible to disable assistants either globally (for all types of issues) using menu in the bottom right corner of Thumbnail Gutter or disable assistant for only specific group of issues.

Disabling/enabling assistants' menu
Disabling/enabling assistants' menu

Below are several examples of Code Assistant:

Ambiguous names issue Code Assistant
Ambiguous names issue Code Assistant

Invalid method declaration issue Code Assistant
Invalid method declaration issue Code Assistant

Unknown class issue Code Assistant
Unknown class issue Code Assistant

Options Dependency

You can control Assistant behavior using the Editor Options | Productivity! | Assistant property page. The Project Properties | Productivity |Assistant property page can be used to specify project dependent Assistant options.

See also: Productivity! Tools, Customizing Productivity!