From 1e2334a9117912b9012778e20a483d23fc422e3c Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 27 Aug 2018 20:47:03 +0300 Subject: [PATCH] Kotlin migration: fix data context calculation for 173 / AS31 Version for IDEA 182 does not work properly here (returns null), so we have to use `DataManager.getDataContext(focusedComponent)` directly #KT-26399 Fixed --- .../idea/configuration/MigrationUtils.kt.173 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 idea/src/org/jetbrains/kotlin/idea/configuration/MigrationUtils.kt.173 diff --git a/idea/src/org/jetbrains/kotlin/idea/configuration/MigrationUtils.kt.173 b/idea/src/org/jetbrains/kotlin/idea/configuration/MigrationUtils.kt.173 new file mode 100644 index 00000000000..0389511b28f --- /dev/null +++ b/idea/src/org/jetbrains/kotlin/idea/configuration/MigrationUtils.kt.173 @@ -0,0 +1,14 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.configuration + +import com.intellij.ide.DataManager +import com.intellij.openapi.actionSystem.DataContext +import com.intellij.openapi.ui.DialogWrapper + +@Suppress("UNUSED_PARAMETER") +internal fun getDataContextFromDialog(wrapper: DialogWrapper): DataContext? = + DataManager.getInstance().getDataContext(wrapper.window) \ No newline at end of file