-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kotlin migration: extract data context into a function, check it on null
The extraction itself is needed due to different behaviour of related IDEA functions in different platforms. Check on null is needed because `createFromAnAction` last argument cannot be null, otherwise we will get an exception. Partial fix of KT-26399
- Loading branch information
Showing
2 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
idea/src/org/jetbrains/kotlin/idea/configuration/MigrationUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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().dataContextFromFocus.result |