# Create custom inspections

To create a custom inspection, you have to configure a [search and replace templates](search-templates.html). The IDE will search for code that matches the template and will highlight it in the editor.

> **Tip:**
> You can also develop a plugin to create a custom inspection. For more information, refer to [IntelliJ Platform SDK Developer Guide](https://plugins.jetbrains.com/docs/intellij/welcome.html)

Procedure:

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), go to `Editor | Inspections`.

You can also press `Ctrl+Alt+Shift+H` (Windows), `⌘ ⌥ ⇧ H` (macOS), `⌘ ⌥ ⇧ H` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ H` (macOS System Shortcuts), `Ctrl+Alt+Shift+H` (XWin), `Ctrl+Alt+Shift+H` (GNOME), `Ctrl+Alt+Shift+H` (KDE), `Ctrl+Alt+Shift+H` (Emacs), `Ctrl+Alt+Shift+H` (Sublime Text), `⌘ ⌥ ⇧ H` (Sublime Text (macOS)), `Ctrl+Alt+Shift+H` (NetBeans), `Ctrl+Alt+Shift+H` (Visual Studio), `⌘ ⌥ ⇧ H` (Visual Studio (macOS)), `Ctrl+Alt+Shift+H` (Eclipse), `⌘ ⌥ ⇧ H` (Eclipse (macOS)) and select Configure Inspections.

2. Select the profile in which you want to create a new inspection.

3. On the toolbar, click the Add Custom Inspection button (![the Add Custom Inspection button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg)) and select Add Structural Search Inspection…  if you want your inspection only to highlight code. Alternatively, click Add Structural Replace Inspection…  if you want your inspection to highlight code strings and suggest fixes.

![Adding a new Structural Search and Replace inspection](https://resources.jetbrains.com.cn/help/img/idea/2026.2/add-ssr-template.png)

4. Configure the templates.

You can use a sample template and configure it according to your needs.

For more information about configuring search and replace templates, refer to [Search templates, modifiers, and script constraints](search-templates.html).

![The Structural Replace dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/custom_inspection.png)

5. When finished, click OK.

6. In the Structural Search Inspection  dialog, type a name of the new inspection, specify a tooltip, description, and provide a suppress ID if necessary (`@SuppressWarnings("suppress id")`). The default suppress ID for custom inspections is `SSBasedInspection`.

7. Apply the changes and close the dialog.

After that, your custom inspection is going to appear in the list of inspections of the current profile under the Structural search category. There, you can change its [severity](configuring-inspection-severities.html) and the [scope](configuring-scopes-and-file-colors.html) in which this inspection will run.

Note that the Structural search category is not available until you create at least one custom inspection.

![Custom inspection shown in the list of inspections](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ssr-custom-inspection.png)

When your inspection is ready, you can [run it](running-inspections.html#run-one-inspection).

## Structural search and replace examples

* [Structural search and replace in Kotlin](tutorial-structural-search-and-replace-in-kotlin.html)

* [Structural search and replace in Java](structural-search-and-replace.html)

* [Structural search and replace examples](structural-search-and-replace-examples.html)

## See also

### Procedures

[Search templates, modifiers, and script constraints](search-templates.html)

