Make "lambda to anonymous" low-priority (KT-7710)
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.intentions
|
package org.jetbrains.kotlin.idea.intentions
|
||||||
|
|
||||||
|
import com.intellij.codeInsight.intention.LowPriorityAction
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor
|
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||||
@@ -23,7 +24,7 @@ class LambdaToAnonymousFunctionIntention : SelfTargetingIntention<KtLambdaExpres
|
|||||||
KtLambdaExpression::class.java,
|
KtLambdaExpression::class.java,
|
||||||
"Convert to anonymous function",
|
"Convert to anonymous function",
|
||||||
"Convert lambda expression to anonymous function"
|
"Convert lambda expression to anonymous function"
|
||||||
) {
|
), LowPriorityAction {
|
||||||
|
|
||||||
override fun isApplicableTo(element: KtLambdaExpression, caretOffset: Int): Boolean {
|
override fun isApplicableTo(element: KtLambdaExpression, caretOffset: Int): Boolean {
|
||||||
if (element.getStrictParentOfType<KtValueArgument>() == null) return false
|
if (element.getStrictParentOfType<KtValueArgument>() == null) return false
|
||||||
|
|||||||
Reference in New Issue
Block a user