From 6814f0334dbaac1e785167cea852e926bf1ffce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Tue, 31 Oct 2023 16:16:47 +0100 Subject: [PATCH] using_kotlin.md: note FileType as notable exception for using 'object' --- topics/tutorials/using_kotlin.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/topics/tutorials/using_kotlin.md b/topics/tutorials/using_kotlin.md index 8d9a0caf1..1787beb69 100644 --- a/topics/tutorials/using_kotlin.md +++ b/topics/tutorials/using_kotlin.md @@ -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 [plugin.xml](plugin_configuration_file.md) 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): - Plugin DevKit | Code | Kotlin object registered as extension for Kotlin code - Plugin DevKit | Plugin descriptor | Extension class is a Kotlin object for plugin.xml