Code Navigation (IDE Tutorial)

From Appmethod Topics
Jump to: navigation, search

Go Up to The Code Editor Index (IDE Tutorial)

To easily navigate in the Code Editor, use one of the following methods.

Method Hopping

You can navigate between methods using a series of editor hotkeys. You can also limit hopping to the methods of the current class by setting class lock.

For example, if class lock is enabled and you are in a method of TComponent, hopping is only available within the methods of TComponent. The keyboard shortcuts for Method Hopping are as follows.

Keyboard shortcut Effect

CTRL+Q followed by L

toggle class lock


move to the top of the current method


move to the next method


move to the first method in the file


move to the last method in the file


scroll through methods

Table 2-1. Method Hopping keyboard shortcuts


Bookmarks provide a convenient way to navigate through long files. You can mark a location in your code with a Bookmark and jump to that location from anywhere in the file.

You can use up to ten Bookmarks, numbered 0 through 9, within a file. To toggle a Bookmark at the current line, press CTRL+SHIFT+digit.

When you set a Bookmark, a book icon Bookmark.png is displayed in the left gutter of the Code Editor, as in the following illustration.


Figure 2-19. Setting Bookmarks in the source code

Finding Classes

Use the Search > Find Class command to see a list of available classes that you can select. If you double-click a class, the IDE automatically navigates to its declaration.

Finding Units

If you are using the Object Pascal language, you can use the Refactor > Find Unit command to locate and add units to your code file. As you type the class name, the list of units that match it is updated. See Find Unit for more information.


Formatting Source Code