Difference between revisions of "IDE Window: Code Explorer"

From Lazarus wiki
(Options)
m (Re-arrange)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{Code Explorer}}
 
{{Code Explorer}}
  
The code explorer shows a pascal file as two trees. There are two pages '''Code''' and '''Directives'''. The ''Code'' page shows the pascal structure - types, variables, constants, classes, etc and since 0.9.27 the '''Code observer'''. The ''Directives'' page shows the compiler directives structure - $IFDEFs, $DEFINEs, $INCLUDEs, etc.
+
== Navigation ==
  
Double click on the nodes to jump to the corresponding position in the source.
+
[[Image:Code_Explorer_Code_tab.png|right]]
 +
[[Image:Code_Explorer_Directives_tab.png|right]]
  
Hint: The code explorer is a floating window. That means you can leave it open and switch freely between other floating windows like the source editor or the object inspector.
 
  
== Refresh ==
+
The Code Explorer dialog is reached from the Lazarus IDE [[Main menu|Main Menu]] > [[Main menu#View|View]] > Code Explorer menu item.
  
Click on this button to update parse the current unit in the source editor and rebuild the tree in the code explorer.
 
  
== Options ==
+
== Overview ==
  
Open the dialog to setup the options of the code explorer. See [[IDE Window: Code Explorer Options]].
+
The Code Explorer dialog has two tabs: '''Code''' and '''Directives'''. The ''Code'' tab shows the Pascal structure - types, variables, constants, classes, etc and the [[IDE_Window:_Code_Explorer_Options#Code_Observer|Code Observer]]. The ''Directives'' tab shows the compiler directives structure - $MODEs, $IFDEFs, $DEFINEs, $INCLUDEs, etc.
  
== Filter (text field above treeview) ==
+
The Code Explorer dialog usually opens with the '''Code'' tab displaying the Unit name and branches for Interface and Implementation sections, but clicking on the {{box|+}} box to the left of any branch will open up its sub-branches, in more and more detail until individual constants, types and variables are displayed as well as procedure and function declarations.  If you change the file displayed in the main Source Editor window, you need to click on the Refresh button of the Code Explorer to display the structure of the new file.
  
For example 'to' will show all identifiers containing 'to'. Like 'Button', 'IntToStr'.
+
Double click on the nodes to jump to the corresponding position in the source editor.
 +
 
 +
''HINT:'' The Code Explorer is a floating window. That means you can leave it open and switch freely between other floating windows like the source editor or the [[IDE Window: Object Inspector|Object Inspector]].
 +
 
 +
 
 +
'''Toolbar Buttons'''
 +
 
 +
* '''Filter''' (text field above treeview): For example 'to' will show all identifiers containing 'to'. Like 'Button', 'IntToStr'.
 +
 
 +
* '''Refresh''': Click on this toolbar button to rebuild the Code Explorer treeview, forcing the unit currently shown in the source editor to be reparsed. This is useful if you have made changes in the Editor since first opening the Code Explorer window, and you don't have the option to refresh ''On Idle'' set.
 +
 
 +
* '''Show Source Nodes''' (code tab only): Click on this toolbar button to...
 +
 
 +
* '''Options''': This toolbar button opens the dialog for the setup options for configuring the Code Explorer. See the [[IDE Window: Code Explorer Options|Code Explorer Options]] dialog for more details.
 +
 
 +
 
 +
<div style="float:left">
 +
'''Context menu - Code tab'''
 +
 
 +
[[Image:Code_Explorer_Contetx_Menu.png|right]]
 +
 
 +
* '''Jump to''': The same effect as double-clicking on a node in the treeview (see above).
 +
 
 +
* '''Show position of source editor''': Shows the current position in the source editor. 
 +
 
 +
* '''Refresh''': The same effect as clicking on the toolbar Refresh button (see above).
 +
 
 +
* '''Rename''': Opens the [[IDE Window: Find or Rename identifier|Find or Rename Identifier]] dialog.
 +
 
 +
 
 +
'''Context menu - Directives tab'''
 +
 
 +
* '''Jump to''': The same effect as double-clicking on a node in the treeview (see above).
 +
 
 +
* '''Show position of source editor''': Shows the current position in the source editor. 
 +
 
 +
* '''Refresh''': The same effect as clicking on the toolbar Refresh button (see above).
 +
 
 +
</div>

Latest revision as of 12:31, 4 February 2021

Deutsch (de) English (en) français (fr) português (pt)

Navigation

Code Explorer Code tab.png
Code Explorer Directives tab.png


The Code Explorer dialog is reached from the Lazarus IDE Main Menu > View > Code Explorer menu item.


Overview

The Code Explorer dialog has two tabs: Code and Directives. The Code tab shows the Pascal structure - types, variables, constants, classes, etc and the Code Observer. The Directives tab shows the compiler directives structure - $MODEs, $IFDEFs, $DEFINEs, $INCLUDEs, etc.

The Code Explorer dialog usually opens with the 'Code tab displaying the Unit name and branches for Interface and Implementation sections, but clicking on the + box to the left of any branch will open up its sub-branches, in more and more detail until individual constants, types and variables are displayed as well as procedure and function declarations. If you change the file displayed in the main Source Editor window, you need to click on the Refresh button of the Code Explorer to display the structure of the new file.

Double click on the nodes to jump to the corresponding position in the source editor.

HINT: The Code Explorer is a floating window. That means you can leave it open and switch freely between other floating windows like the source editor or the Object Inspector.


Toolbar Buttons

  • Filter (text field above treeview): For example 'to' will show all identifiers containing 'to'. Like 'Button', 'IntToStr'.
  • Refresh: Click on this toolbar button to rebuild the Code Explorer treeview, forcing the unit currently shown in the source editor to be reparsed. This is useful if you have made changes in the Editor since first opening the Code Explorer window, and you don't have the option to refresh On Idle set.
  • Show Source Nodes (code tab only): Click on this toolbar button to...
  • Options: This toolbar button opens the dialog for the setup options for configuring the Code Explorer. See the Code Explorer Options dialog for more details.


Context menu - Code tab

Code Explorer Contetx Menu.png
  • Jump to: The same effect as double-clicking on a node in the treeview (see above).
  • Show position of source editor: Shows the current position in the source editor.
  • Refresh: The same effect as clicking on the toolbar Refresh button (see above).


Context menu - Directives tab

  • Jump to: The same effect as double-clicking on a node in the treeview (see above).
  • Show position of source editor: Shows the current position in the source editor.
  • Refresh: The same effect as clicking on the toolbar Refresh button (see above).