Difference between revisions of "IDE Window: Find or Rename identifier"

From Lazarus wiki
Jump to navigationJump to search
Line 20: Line 20:
  
 
* in current unit - search only in the current source editor file
 
* in current unit - search only in the current source editor file
* in main project - search in all files of the current project
+
* in main project - search in all files of the current project (i.e. all files listed in the project inspector)
 
* in project/package owning current unit - first search the project/package to which this file belong, then replace in all files of this project/package.
 
* in project/package owning current unit - first search the project/package to which this file belong, then replace in all files of this project/package.
 
* in all open projects and packages - as above, but search also in all depending projects/packages.
 
* in all open projects and packages - as above, but search also in all depending projects/packages.
 +
 +
In any case the IDE will always skip binary files (using the FileIsText function).
  
 
== Additional files to search ==
 
== Additional files to search ==

Revision as of 01:42, 5 January 2012

Deutsch (de) English (en) suomi (fi) français (fr)

This dialog requires to place the cursor in the source editor on an identifier. When opened the source editor will first jump to the declaration of the identifier then show the dialog.

The replace button and options will only be enabled, when invoked via 'Rename Identifier' (for example via Source Editor -> Right Click Popup Menu -> Refactoring -> Rename Identifier).

Setup the search options and start the search. A progress window will popup up with a button to abort. When the search finished the Search Results window will open presenting the result. If the identifier was renamed the result will be empty.

Identifier

In the caption of the groupbox the searched identifier is shown. In the listbox below the unit and include files of the declaration is presented, so you can make sure, the right identifier is replaced.

Rename to

Set here the name of the new identifier.

Scope

  • in current unit - search only in the current source editor file
  • in main project - search in all files of the current project (i.e. all files listed in the project inspector)
  • in project/package owning current unit - first search the project/package to which this file belong, then replace in all files of this project/package.
  • in all open projects and packages - as above, but search also in all depending projects/packages.

In any case the IDE will always skip binary files (using the FileIsText function).

Additional files to search

Specify here additional files to search. You can give multiple files and directories separated by semicolon. Macros are allowed and wild masks * and ? are allowed in the last part of the file name. Relative paths are expanded with the project directory. Examples:

  • *.pas;*.pp: search in all files pas and pp files in the project directory.
  • $(LazarusDir)/ide: search in all pascal sources in the directory /your/path/to/lazarus/sources/ide
  • folder: search in all pascal sources in the projects sub directory folder

Search in comments too

The codetools will replace the identifier in all comments as well.