IntelliJ IDEA 14.0.0 Web Help

Creating and Editing Search Templates

You can create search and replace templates from scratch, just typing the code in the text area of the Structural Search / Replace dialog box. However, there is a collection of the predefined search templates that you can use as prototypes for your own templates. All custom templates appear in the list of existing search templates, under the node User defined.

To create a search template, follow these general steps

  1. On the main menu, choose Edit | Find | Search Structurally , or press StructuralSearchPlugin.StructuralSearchAction.
  2. Do one of the following:
    • Type the code of your template in the Search template text area.
    • Click the Copy existing template button, and in the Existing Templates dialog box, select the desired template as a prototype. The source code of the selected template appears in the Search template text area, where you can change it as required.
  3. If you need to configure the template variables, click the Edit variables button. Edit Variables dialog box appears.

    In the Variables column, select a variable you want to configure, and specify the constraints that will apply to this variable. See the dialog reference page for the detailed description of constraints.

    Repeat the process for the other variables, as required, apply changes and close the dialog box.

  4. Click the Save Template button.
  5. In the Save Template dialog, type the name of the new template, and click OK.

See Also

Last modified: 12 November 2014
comments powered by Disqus