Files
openide/plugins/devkit/intellij.kotlin.devkit/resources/inspectionDescriptions/KotlinObjectExtensionRegistration.html
Yann Cébron 7bbd97677c [devkit] cleanup inspection descriptions
GitOrigin-RevId: d9bfdce9a581af49b9f743874a21d001dcc74403
2024-05-14 15:24:08 +00:00

32 lines
742 B
HTML

<html>
<body>
Reports extensions which are instantiated by the IntelliJ Platform, but are declared as Kotlin objects.
<p>
Extensions lifecycle is managed by the IntelliJ Platform.
Using Kotlin objects for extension registration may cause creation of unnecessary extension instances and make plugin unloading
impossible.
</p>
<h2>Example</h2>
<p>Extension registration:</p>
<pre><code lang="xml">
&lt;annotator language="myLang" implementationClass="com.example.MyAnnotator"/&gt;
</code></pre>
<p>Extension implementation:</p>
<pre><code lang="kotlin">
// bad:
object MyAnnotator : Annotator {
...
}
// good:
class MyAnnotator : Annotator {
...
}
</code></pre>
<!-- tooltip end -->
<p><small>New in 2023.1</small>
</body>
</html>