Source code analysis

 

General behaviour

Coding help can be requested using the F1 key. If there is more than one type of help available (arguments help and JavaDoc for example) F1 cycles through the different help popups. Code completion can be invoked using the Ctrl-Space. The help windows are hidden when the ESC key is pressed.

 

 

Automatic error detection

 

CodeGuide automatically analyzes your Java source code as you type.

 

If CodeGuide detects an error in your source a wavy red line marks the location of the error.

 

 

The error message can be displayed by pressing F1 while the caret is positioned on the error.

 

 

You can easily move around between all errors in your project using the Ctrl-Up and Ctrl-Down key combinations.

 

All open Java files are flagged in the editor title bar according to their checking status:

 

 

Open Java files that are being checked are flagged with an hourglass. Files which contain errors are flagged with a red cross and files which are error-free are flagged with a green check mark. Non-Java files are not flagged.

 

Java files with errors are flagged with a red cross in the Project Browser:

 

 

CodeGuide displays statistics of how many files contain errors and shows the progress of the source code analysis in the status bar:

 

Display

Description

CodeGuide is currently analyzing the files in the project. Currently is has records of 97 errors in 9 files. The statistics may change until the source code analysis finishes. The progress bar shows the relation between files already analyzed and files that still need to be analyzed.

 

 

The source code analysis has finished. The project contains 197 errors in 27 files.

 

 

The source code analysis has finished. All Java files contained in the project are error-free.

 

Please note that errors in currently open files will count towards the error statistics even if they are not contained in the project. The source code analysis works fully in the background so you can continue to work while it is analyzing your source code.

 

CodeGuide only analyzes files depending on the file which is being changed. Therefor it usually takes less than a second up to a few seconds until the whole project has been analyzed. CodeGuide does not needs to reanalyze the full project each time it is opened because results of the source code analysis are cached on disk. When the project configuration is changed (i.e. JDK/CLASSPATH changes, project change) information about the current project is stored on disk and information about the new project is loaded from disk. If there is no information about this project in the cache CodeGuide will show a dialog explaining that it has just started a full analysis of the whole project.

 

 

You can disable this dialog in the Compilation & Execution section of the Preferences Dialog.

 

 

If the source code analysis has become inconsistent and produces. You can use the Project | Reanalyze sources menu item to force CodeGuide to reanalyze the whole project. Doing a full reanalysis should not be necessary during normal work and should only be used if there is something wrong with the source code analysis.

 

Code completion

 

CodeGuide can be used to complete all kinds of Java identifiers in your code so you do not have to type the full name of an identifier. If you press Ctrl-Space after an identifier prefix CodeGuide will try to complete the identifier for you.

 

The behaviour of CodeGuide varies depending on the number of possible completions:

 

  1. If there is only one possible completion for the identifier you have typed it will complete the identifier if you press Ctrl-Space after the identifier prefix.

  2.  

    Example:

     

    System.arr<Ctrl-Space> becomes System.arraycopy(.

     

  3. If there are more possible completions CodeGuide completes up to the prefix that is common to all possible completions.

  4.  

    Example (frame is assumed to be of type java.awt.Frame):

     

    frame.rem<Ctrl-Space> becomes frame.remove

     

    If Ctrl-Space is pressed once more CodeGuide displays a list of all methods and fields that are available with JavaDoc if the source code for the declaring class is available:

     

     

  5. If there is no possible completion CodeGuide immediately displays the list of all methods and fields that are available with JavaDoc if the source code for the declaring class is available.

 

 

CodeGuide can be used to complete keywords, fields, methods, local variables, type names and import statements

 

 

Argument help

 

If you press F1 while the caret is inside a function call (between the parentheses) CodeGuide will show the expected arguments for this function. Argument names will only be shown if the source is available.

 

 

If the method is overloaded all possible argument sets are displayed.

 

The argument help is automatically shown after typing the opening parenthesis if the Automatic code help option is enabled.

 

 

JavaDoc

 

If you press F1 while the caret is positioned on a method, field or class CodeGuide will show the JavaDoc for the method, field or class if the source code of the declaring class is available.

 

 

 

Go to definition

If the caret is positioned on a method, field or class and the source code for the referenced method, field or class is available you can go to the definition of the method, field or class by pressing Ctrl-Enter. You can also use Ctrl-Enter to go to the definition of the currently selected method in the completion list.