Code Editor Context Menu
Go Up to Code Editor
Right-click the Code Editor window to display and select from the following context menu of commands:
| Item | Description |
|---|---|
|
Find Declaration |
Opens the source file for the selected symbol and highlights the declaration. Appears in the context menu only when you right-click a symbol in the Code Editor. This command invokes Code Browsing , and searches the following paths:
|
|
Open Source/Header File (C++ only) |
Does either of the following:
|
|
Close Page |
Closes the current source file. If there is only one source file currently open, the Code Editor window is closed as well, but the project remains open. |
|
Open File at Cursor |
Searches for and attempts to open a source file whose name matches the text currently under the cursor. Then either:
The file is opened in a new Code Editor page. Unit scope names are now used to help locate the correct file. Every project has a set of default unit scopes that the IDE can use to search for units if the unqualified unit name is not found. For example, if you point to FMX.Controls.pas and select Open File at Cursor, the IDE searches for the unit-scoped name first (FMX.Controls.pas) and then looks for the unscoped unit name (Controls.pas). Then the IDE takes all the unit scopes defined for the project and prepends each unit scope to the unit name, until either the file is found or there are no more unit scopes: for example, Rtl.Controls.pas, Fmx.Controls.pas, and so on. |
|
New Edit Window |
Opens a separate full-screen window containing the same contents as the original Code Editor window. |
|
File Format |
Specifies the format to be used to store files, as follows:
|
|
Topic Search |
Invokes the help system and requests the help topic that matches the currently selected item in the Code Editor. |
|
Add to Repository |
Opens the Add to Repository dialog box, which enables you to add forms and templates to the New Items dialog box in the IDE. |
|
Increase Font Size |
Increases the font size of the Code Editor. |
|
Decrease Font Size |
Decreases the font size of the Code Editor. |
|
Complete Class at Cursor |
Generates skeleton code for the class members that you declare. See Code Editor for details. |
|
Add To-Do Item |
Opens the Add To-Do Item dialog box so that you can create a To-Do item and add it to the To-Do list. |
|
Cut |
Removes the current selection and stores it to the clipboard. Cut works with text when using the Code Editor and with components when using the Form Designer. |
|
Copy |
Copies the current selection to the clipboard. Copy works with text when using the Code Editor and with components when using the Form Designer. |
|
Paste |
Inserts the contents of the clipboard (previously captured using the Cut or Copy command). Paste works with text when using the Code Editor and with components when using the Form Designer. |
|
Toggle Bookmarks |
Sets a new bookmark or removes an existing one (using the bookmark number you select from the submenu). See Using Bookmarks. |
|
Goto Bookmarks |
Moves the Code Editor focus to the line marked with the bookmark whose number you select from the submenu. See Using Bookmarks. |
|
Clear Bookmarks |
Clears all bookmarks currently set. Only enabled when at least one bookmark is set. |
|
Debug |
Toggle Breakpoint Alternately sets or clears a breakpoint on the current line. See Setting and Modifying Breakpoints. Evaluate/Modify Opens the Evaluate/Modify dialog box:
Add Watch at Cursor
Set Next Statement Changes the location of the instruction pointer (that is, the value of EIP register, indicated by CPUStackArrow.png in the left gutter) to the current line in the Code Editor. Use this command when you want to skip certain source statements. When you resume program execution, execution starts at this statement. Set Next Statement is not the same as stepping through instructions; the debugger does not execute any instructions that you might skip. Enabled only when the current source line has generated machine code (as indicated by a blue dot BlueDot.png in the left-hand gutter of the Code Editor).
Goto Address Opens the Enter Address to Position to dialog box, which allows you to enter or select a symbol, and then opens the Disassembly Pane to the associated location. View CPU Opens the CPU Windows.
Inspect
Run to Cursor Executes the current active program to the line containing the cursor. |
|
Read Only |
Toggles the Code Editor's read-only mode. When this option is enabled, keyboard input is ignored. |
|
View Messages |
Toggles the display of the Messages View. |
|
Fold |
Collapses one or more blocks of code (functions, type declarations, preprocessor region directives, XML Doc comments, and so on). Use Nearest Collapses the nearest block to the location of the cursor. Namespace Collapses all C++ namespaces or Delphi units in the current source file. Types Collapses all type declarations. Methods Collapses all method definitions. Regions Collapses all preprocessor regions. For Delphi, see Regions; for C++, see #pragma region and #pragma end_region. Nested Methods Collapses all nested methods. Doc Comments Collapses all XML Documentation comments (triple-slash comments) in Delphi source code. For more information about XML Doc comments, see XML Documentation Comments. For more information about code folding, see Using Code Folding. |
|
Unfold |
Expands one or more collapsed blocks of code (functions, type declarations, preprocessor region directives, XML DOC comments, and so forth). Nearest Expands the nearest collapsed block to the location of the cursor. All Expands all the collapsed blocks of code in the current source file. See Using Code Folding. |
|
Toggle Comment |
Toggles comment characters (//) at the beginning of the current line of code. This is an easy way to comment-out selected lines of code. |
|
Properties |
Opens the first Editor Options page of the Options dialog box (Tools > Options ). All the Editor Options pages pertain to the Code Editor. |
|
Search for Usages |
Opens the Search for Usages dialog box to find usages of classes, methods, variables, and overriding methods, derived classes and implemented interfaces in Delphi source code projects. |
|
Format Source |
Formats the Delphi or C/C++ source file being edited. To set formatting options, use the Formatter Options page of the Options dialog box (Tools > Options). The formatting options define indentation, spaces, line breaks, capitalization, and align parameters to be used for the code formatting. See Formatting Source Code. |
|
Refactor |
Rename Opens either the Rename <symbol name> (Delphi) or the Rename Symbol (C++) dialog box. In C++, rename refactoring works only with the Clang-based compilers. Delphi / C++ Declare Variable Opens the Declare Variable dialog box. DelphiDeclare Field Opens the Declare Field dialog box. Extract Method Opens the Extract Method dialog box. Extract Resource String Opens the Extract Resource String dialog box. Find Unit Opens the Find Unit dialog box. Change Params Opens the Change Parameters dialog box. Move Opens the Move dialog box. Extract Interface Opens the Extract Interface or Superclass dialog box. You must select one or more classes or class members. Extract Superclass Opens the Extract Interface or Superclass dialog box. You must select one or more classes with a common ancestor, or one or more class members. Pull Members Up Opens the Pull Members Up dialog box. You must select several class members. Push Members Down Opens the Push Members Down dialog box. You must select several class members. Safe Delete Opens the Safe Delete dialog box. You must select one or more classes or class members. Inline Variable Opens the Inline Variable dialog box. You must select a variable. Introduce Field Opens the Introduce Field dialog box. You must select a single complete expression. Introduce Variable Opens the Introduce Variable dialog box. You must select a single complete expression. |
|
Find |
For Delphi: Find references to method/type <name> Opens the Find References pane. Find local references to method/type/unit <name> Opens the Find References pane. See Find Local References. Find declaration of method/type <name> in <source-file> Highlights the declaration of the current method or type in the Code Editor. For C++ (for 64-bit Windows, iOS, and Android target platforms): Find Definition Right-click a reference/symbol and select Find Definition to search for definitions in the code. If there is one definition it shows the result in the current file or opens the source file where the definition is. The line appears highlighted. For virtual methods, it opens the Find Definition pane. In this pane, you can click any entry to navigate to the source code of the selected method declaration. See Find Definition. Find References Right-click an object to find all the references. It opens the C++ Find References pane where you can click on any result to go to the source file. See Find References. Show Base Types Right-click a type to show in the Type Hierarchy pane the base class of the selected type. It highlights the result in the code editor. See Show Base Types. Show Derived Types Right-click a type to go to the derived class that inherited from the selected type. It highlights the result in the code editor. See Show Derived Types. Show Type Hierarchy It shows the type Hierarchy of a class in the Type Hierarchy pane. See Show Type Hierarchy. Go to Type Declaration Right-click a symbol or a type to go to the declaration of the type of the symbol. See Go to Type Declaration. Header Dependency When you right-click an include <header name> statement, it displays a tree view of all headers on which the selected header depends, in the Header Dependency pane. When you right-click any place in the Code Editor, it displays a tree view of all headers the current file includes. See Header Dependency. Navigate To This command displays the Navigate To dialog box that allows you to search your active project for identifiers and constants that meet the specified criteria. |
|
Version Control |
If the file in the Code Editor is under a version control system, displays additional commands.
|
|
Surround |
Surrounds the highlighted element with the selected code template (logical code symbols or statements). Many of the elements in the Surround list are also code templates, listed in the Templates Window. In the following descriptions, the ellipsis (...) represents the elements currently selected in the Code Editor: For Delphi: begin Indents the selection and adds (* Converts the selection into a comment surrounded by {
Converts the selection into a comment surrounded by else Adds forb Adds forin Adds forr Adds function Adds ifb Adds ifeb Adds procedure Adds region Adds repeat Adds Surround Windows Adds try Adds trye Adds tryf Adds whileb Adds
For C++: /* Indents the selection and surrounds it with for Adds if Adds ifeb Adds throw Replaces selection with try Adds whileb Adds
|
|
Sync Prototypes |
Synchronizes the interface and implementation copies of your procedure and function prototypes. See Synchronizing Prototypes for further details. |
Topics
- Find Definitions and References (C++)
- Find References (C++)
- Go to Type Declaration (C++)
- Header Dependency (C++)
- Navigate To (C++)
- Show Base Types (C++)
- Show Derived Types (C++)
- Show Type Hierarchy (C++)