diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml
index 04b8ef604a2..b7a15dbb985 100644
--- a/idea/src/META-INF/plugin.xml
+++ b/idea/src/META-INF/plugin.xml
@@ -733,6 +733,8 @@
+
+
org.jetbrains.kotlin.idea.intentions.IfNullToElvisIntention
Kotlin
diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinUsageToPsiElementProvider.kt b/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinUsageToPsiElementProvider.kt
new file mode 100644
index 00000000000..95ddcfaa774
--- /dev/null
+++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinUsageToPsiElementProvider.kt
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2010-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jetbrains.kotlin.idea.codeInsight
+
+import com.intellij.psi.PsiElement
+import com.intellij.usages.UsageToPsiElementProvider
+import org.jetbrains.kotlin.idea.KotlinLanguage
+import org.jetbrains.kotlin.psi.KtImportDirective
+import org.jetbrains.kotlin.psi.KtNamedDeclaration
+import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
+
+class KotlinUsageToPsiElementProvider : UsageToPsiElementProvider() {
+ override fun getAppropriateParentFrom(element: PsiElement): PsiElement? {
+ if (element.language == KotlinLanguage.INSTANCE) {
+ return element.parentsWithSelf.first { it is KtNamedDeclaration || it is KtImportDirective }
+ }
+ return null
+ }
+}