WebStorm 2018.1 Help

Structural Search and Replace Examples

Method call

$Instance$.$MethodCall$($Parameter$)

This template matches method call expressions. If the number of occurrences is zero, it means that a method call can be omitted.

@Deprecated $Instance$.$MethodCall$($Parameter$)

You can use this template to find deprecated methods and use it as prototype for creating other annotated method templates. Specifically for searching method calls to deprecated methods you can select the already existing template method calls to deprecated methods.

Refer to Creating and Editing Search Templates on how to create a search template.

Searching for JavaScript and Typescript classes

If you have a JavaScript or Typescript class MyClass:

class MyClass { }
the simplest template to search for it is class $a$.

Searching for XML and HTML tags, attributes, and their values

The simplest template to search for a tag is <$a$/>

By placing constraints on the variable $a$, you can specify which tags you want to find. For example, if you specify the text/regexp constraint app.+, you’ll find the tags whose names start with app.

A more versatile template for searching in XML and HTML is <$tag$ $attribute$="$value$"/> By using this template with properly specified search settings and constraints, you can find practically anything that may occur in XML or HTML. For example, if you specify the text/regexp constraint width for the variable $attribute$, you’ll find all the tags that have the width attribute.

Last modified: 11 May 2018

See Also