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 checkbox is selected, the search is performed recursively in the results.

Structural Search

Case sensitive

If this checkbox is selected, the search discerns lower and upper case letters.

Check this option, if you want PyCharm 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, PyCharm will only indent the whole template according to the position in code at which it is expanded, leaving its formatting as is.

Structural Replace

Use static import if possible

Check this option, if you want PyCharm to shorten any references to static elements in the replaced code. PyCharm will insert a static import for those elements. The elements are then referenced by their short name. If there are no references to static elements in the replaced code, the option will be ignored.

Structural Replace

Scope

Select one of the existing scopes from the drop-down list or click the ellipsis button (alternatively, press Shift+Enter), and create your own scope in the Scopes dialog box.

Both

Open in new tab

If this checkbox 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.