mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
using_kotlin.md: note FileType as notable exception for using 'object'
This commit is contained in:
parent
5ea293927e
commit
6814f0334d
@ -172,6 +172,8 @@ When registering an extension, the platform uses a dependency injection framewor
|
||||
For this reason, plugins *must not* use [Kotlin objects](https://kotlinlang.org/docs/object-declarations.html#object-declarations-overview) (`object` keyword) to implement any <path>[plugin.xml](plugin_configuration_file.md)</path> declarations.
|
||||
Managing the lifecycle of extensions is the platform responsibility and instantiating these classes as Kotlin singletons may cause issues.
|
||||
|
||||
A notable exception is `com.intellij.openapi.fileTypes.FileType` (`com.intellij.fileType` extension point), see also the inspection descriptions below.
|
||||
|
||||
Problems are highlighted via these inspections (2023.2):
|
||||
- <control>Plugin DevKit | Code | Kotlin object registered as extension</control> for Kotlin code
|
||||
- <control>Plugin DevKit | Plugin descriptor | Extension class is a Kotlin object</control> for <path>plugin.xml</path>
|
||||
|
Loading…
x
Reference in New Issue
Block a user