Difference between revisions of "IDE Window: Code Explorer"

From Lazarus wiki
m (Tweak layout)
m (Re-arrange)
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
== Navigation ==
 
== Navigation ==
 
  
 
[[Image:Code_Explorer_Code_tab.png|right]]
 
[[Image:Code_Explorer_Code_tab.png|right]]
Line 14: Line 13:
  
 
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.
 
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.
 
  
 
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.
 
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.
 
 
  
 
Double click on the nodes to jump to the corresponding position in the source editor.
 
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]].
 
''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]].
Line 30: Line 24:
  
 
* '''Filter''' (text field above treeview): For example 'to' will show all identifiers containing 'to'. Like 'Button', 'IntToStr'.
 
* '''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.
 
* '''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...
 
* '''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.
  
 
* '''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">
 
<div style="float:left">
Line 49: Line 38:
  
 
* '''Jump to''': The same effect as double-clicking on a node in the treeview (see above).
 
* '''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.   
 
* '''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).
 
* '''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.
 
* '''Rename''': Opens the [[IDE Window: Find or Rename identifier|Find or Rename Identifier]] dialog.
 +
  
 
'''Context menu - Directives tab'''
 
'''Context menu - Directives tab'''
  
 
* '''Jump to''': The same effect as double-clicking on a node in the treeview (see above).
 
* '''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.   
 
* '''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).
 
* '''Refresh''': The same effect as clicking on the toolbar Refresh button (see above).
 +
 
</div>
 
</div>
 
<br/>
 

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).