IntelliJ IDEA 13.1.0 Web Help

Edit | Find | Search Structurally

Edit | Find | Replace Structurally

Use these dialog boxes to find and replace fragments of code that structurally match the suggested search template.

Tip

To learn more about the possible usages, refer to the section Structural Search and Replace.

Item Description Available in
Search template Use this text area to specify the template to be sought for. You can type the template code in the field or click the Copy existing template button to use one of the existing templates. Both
Replacement template Use this text area to specify the template to be substituted. You can type the template code in the field or click the Copy existing template button to use one of the existing templates. Structural Replace
Save template Click this button to open the Save Template dialog box, where you have to specify the name of the new template. Note that the new template is stored under the User Defined node of the existing templates tree view. Both
Edit variables Calls the Edit variables dialog box to set constraints for template variables. Both
History Click this button to open the History dialog box, that shows up to 25 last invoked templates. Both
Copy existing template Click this button to open the Existing Templates dialog box, where you can select one of the pre-defined or custom templates. Selected template is displayed in the Preview field. Clicking OK in the Existing Templates dialog box inserts the source code of the template into the Search template or Replace template field. Both
Recursive matching If this check box is selected, the search is performed recursively in the results. Structural Search
Case sensitive If this check box is selected, the search discerns lower and upper case letters. Both
Maximum matches If this check box is selected, you can specify the number of matches you would obtain. By default, it is 1000. Both
File type Select file type from the drop-down list. Both
Shorten fully qualified names This option makes sense in case the template text contains fully qualified class names. If the check box is selected, IntelliJ IDEA automatically reduces these names in the template. Otherwise, fully qualified class names are used. Structural Replace
Format according to style Check this option, if you want IntelliJ IDEA to automatically reformat the expanded code fragment according to your code style settings (for details, refer to the Code Style dialog box). If the option is not checked, IntelliJ IDEA will only indent the whole template according to the position in code at which it is expanded, leaving its formatting as is. Structural Replace
Scope Select one of the existing scopes from the drop-down list or click the ellipsis button (alternatively, press Shift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift EnterShift EnterShift Enter), and create your own scope in the Scopes dialog box. Both
Open in new tab If this check box is selected, the results of the new search display in a new tab in the Find results tool window. Otherwise, the search results update the existing tab. Both

See Also

Concepts:

Procedures:

Reference:

Web Resources: