with one click
ssr
Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.
Menu
Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.
How to manage module dependencies in IntelliJ codebase. Use when adding or modifying module dependencies in iml files.
How to manage module dependencies in IntelliJ codebase. Use when adding or modifying module dependencies in iml files.
Pluginize a Product DSL module set by hand-writing a wrapper plugin module next to its feature modules. Use when promoting modules out of an aggregate module set (e.g. `essential`, `ide.common`) into a bundled plugin so products can include or omit them through normal plugin wiring, when updating bundled plugin registration for such a wrapper, or when fixing tests whose plugin loading logs show a missing wrapper plugin for a former module set.
Pluginize a Product DSL module set by hand-writing a wrapper plugin module next to its feature modules. Use when promoting modules out of an aggregate module set (e.g. `essential`, `ide.common`) into a bundled plugin so products can include or omit them through normal plugin wiring, when updating bundled plugin registration for such a wrapper, or when fixing tests whose plugin loading logs show a missing wrapper plugin for a former module set.
Comprehensive testing reference for running tests in IntelliJ codebase via tests.cmd. Use when running, debugging, or troubleshooting test execution.
Guidelines for implementing IntelliJ actions (AnAction). Use those rules when you need to create or change an action in the intellij platform.
| name | ssr |
| description | Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns. |
You must use terminal search (ls, cat and grep) to read directory .idea. Do not use IDE search.
The contents of structural search inspections is located in .idea/inspectionProfiles/idea_default.xml
Here is an example of a Structural Search and Replace inspection:
<replaceConfiguration name="Use Strings.areSameInstance instead of =="
description="Comparing Strings by references usually indicate a mistake, if you really need to do this (for performance reeasons or to implement "Sentinel" pattern), use Strings.areSameInstance method to make the intention explicit and get rid of warning."
suppressId="StringEqualitySSR"
problemDescriptor="Use !Strings.areSameInstance instead of '!=' if you really need to compare strings by reference"
text="$s1$ == $s2$" recursive="false" caseInsensitive="false" type="JAVA" pattern_context="default"
search_injected="false" reformatAccordingToStyle="false" shortenFQN="true"
replacement="com.intellij.openapi.util.text.Strings.areSameInstance($s1$, $s2$)">
<constraint name="__context__" within="" contains=""/>
<constraint name="s1" nameOfExprType="java\.lang\.String" within="" contains=""/>
<constraint name="s2" nameOfExprType="java\.lang\.String" within="" contains=""/>
</replaceConfiguration>
This node should be located under <inspection_tool class="SSBasedInspection" tag.
<searchConfiguration name="Raw coroutine scope creation" uuid="e11e9d2f-7cc2-3359-a78a-24f67cbe0850"
description="Coroutine scope should be created: <ul> <li>by a coroutine builder (<code>launch</code>, <code>async</code>, <code>runBlockingCancellable</code>);</li> <li>by a scoping function (<code>withContext</code>, <code>coroutineScope</code>, <code>supervisorScope</code>);</li> <li>by injecting it into a service constructor;</li> <li>by explicitly creating a child scope (<code>childScope</code>, <code>namedChildScope</code>)</li> </ul> "
suppressId="RAW_SCOPE_CREATION"
problemDescriptor="Raw scope might not be linked to any parent unintentionally (if passed context does not have any <code>Job</code>, or if passed <code>Job</code> does not have any parent). Use <code>namedChildScope()</code> on some existing scope instead. If no parent is actually intended, use <code>GlobalScope.namedScope()</code>."
text="CoroutineScope($args$)" recursive="true" caseInsensitive="true" type="Kotlin" pattern_context="default"
search_injected="false">
<constraint name="__context__" within="" contains=""/>
<constraint name="args" within="" contains=""/>
</searchConfiguration>
This node should be located under <inspection_tool class="SSBasedInspection" tag.
<inspection_tool class="e5d3c6f8-12ab-4cc9-8e51-8a8f1bd1c3e2" enabled="true" level="WARNING" enabled_by_default="false">
<scope name="IDE Testing Framework" level="WARNING" enabled="true"/>
<scope name="Tests" level="WARNING" enabled="true"/>
<scope name="test-framework" level="WARNING" enabled="true"/>
</inspection_tool>
InspectionProfileConsistencyTest after changing xml files