From 1817160e367f8c4f597f46b5b524915fbc65798c Mon Sep 17 00:00:00 2001 From: Andrey Vokin Date: Tue, 20 Feb 2024 09:29:36 +0100 Subject: [PATCH] [R] Fix "Companion objects in IDE extension implementations may only contain a logger and constants" inspection GitOrigin-RevId: 1f195432490cf1bf208665609d886698c7c2fe7b --- .../visualization/r/inlays/InlaysManager.kt | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/InlaysManager.kt b/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/InlaysManager.kt index 81f3ee22625f..ac7f64853bb5 100644 --- a/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/InlaysManager.kt +++ b/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/InlaysManager.kt @@ -29,19 +29,6 @@ private val logger = Logger.getInstance(InlaysManager::class.java) class InlaysManager : EditorFactoryListener { - companion object { - private val KEY = Key.create("org.jetbrains.plugins.notebooks.visualization.r.inlays.editorInlaysManager") - - fun getEditorManager(editor: Editor): EditorInlaysManager? = editor.getUserData(KEY) - - private fun getDescriptor(editor: Editor): InlayElementDescriptor? { - return InlayDescriptorProvider.EP.extensionList - .asSequence() - .mapNotNull { it.getInlayDescriptor(editor) } - .firstOrNull() - } - } - override fun editorCreated(event: EditorFactoryEvent) { val editor = event.editor val project = editor.project ?: return @@ -56,4 +43,15 @@ class InlaysManager : EditorFactoryListener { event.editor.putUserData(KEY, null) } } +} + +private val KEY = Key.create("org.jetbrains.plugins.notebooks.visualization.r.inlays.editorInlaysManager") + +fun getEditorManager(editor: Editor): EditorInlaysManager? = editor.getUserData(KEY) + +private fun getDescriptor(editor: Editor): InlayElementDescriptor? { + return InlayDescriptorProvider.EP.extensionList + .asSequence() + .mapNotNull { it.getInlayDescriptor(editor) } + .firstOrNull() } \ No newline at end of file