IDE Window: Unit dependencies

From Free Pascal wiki
Revision as of 14:51, 5 September 2022 by Mattias2 (talk | contribs) (→‎Selected units)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en)

This window shows the unit dependencies implied by the uses sections. You can access it via View / Unit Dependencies.

You can keep it open and if you installed docking, you can dock this window. The screen shot shows it on Gtk2 with anchordocking installed.

UnitDependencies1.png

Note: Before 1.1 this was a dialog that had only a tree with units.

Units

This page shows all scanned units and their interface and implementation uses sections. The uses sections of program and libraries are also called 'interface' on this dialog, which technically not correct, but convenient for this dialog.

When the window is shown the first time it scans the units. On recent machines this usually takes a few seconds, on slow machines and units on slow network shares it might take a minute. The IDE caches units, so subsequent scans are faster.

You can use the Refresh button at the lower right edge of the window to rescan.

Additional files

Enable this option and give a semicolon separated list of directories which .pp and .pas files are scanned too.

All package units

Enable this to also scan all packages currently open in the IDE.

All source editor

Enable this to also scan all .pp and .pas files in the source editor.

All units

This shows all scanned units. Units with implementation uses section have a marker. When you want to refactor a package or you have some fpc problems with cycles lookout for these units.

  • You can use the filter to show only those units containing the filter text.
  • Next to the filter are two toggle buttons. One groups the units in projects/packages, the other groups them via directories. By default both are enabled.
  • You can use the search to find a node containing the text. Use the nearby buttons to jump to the next or previous node containing the text.
  • Click on a unit to select it. You can select multiple units by using Ctrl and Shift modified.
  • Double click on a unit to open it in the source editor. On a project will open the project inspector. On a package opens the package editor.
  • Right click for more options.

Selected units

This shows the units selected in the All units.

Each unit has child nodes interface, implementation' for the corresponding the uses sections of the unit itself. And used by interface and used by implementation for uses sections of other units using this unit. That means it shows direct connections between units, not indirect. For example project1.lpr uses UnitA uses UnitB, will list project1 uses UnitA, UnitA is used by project1 and uses UnitB, and finally UnitB is used by UnitA.

  • You can use the search to find a node containing the text. Use the nearby buttons to jump to the next or previous node containing the text.
  • Double click on a unit to open it in the source editor.

Project and Packages

The upper graph shows the project, packages and FPC directories. Select one or more to show their units in the lower graph.

The lower graph shows the units of the selected packages. Double click on a unit to open it in the source editor.