mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[R] Fix "Companion objects in IDE extension implementations may only contain a logger and constants" inspection
GitOrigin-RevId: 1f195432490cf1bf208665609d886698c7c2fe7b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
634b8189ec
commit
1817160e36
@@ -29,19 +29,6 @@ private val logger = Logger.getInstance(InlaysManager::class.java)
|
||||
|
||||
class InlaysManager : EditorFactoryListener {
|
||||
|
||||
companion object {
|
||||
private val KEY = Key.create<EditorInlaysManager>("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<EditorInlaysManager>("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()
|
||||
}
|
||||
Reference in New Issue
Block a user