mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 09:03:31 +07:00
32 lines
742 B
HTML
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">
|
|
<annotator language="myLang" implementationClass="com.example.MyAnnotator"/>
|
|
</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>
|