mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Support unresloved references in returns when creating CreateLabel fix
KTIJ-29594 K2 IDE: Port CreateLabelFix GitOrigin-RevId: d070cacdc424de3ca08359924c0f9a882b628e6f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dac2430b1a
commit
7d941d5ef5
+2
-1
@@ -11,7 +11,8 @@ import org.jetbrains.kotlin.psi.*
|
||||
internal object CreateLabelFixFactories {
|
||||
|
||||
val unresolvedLabelFactory = KotlinQuickFixFactory.IntentionBased { diagnostic: KaFirDiagnostic.UnresolvedLabel ->
|
||||
val labelReferenceExpression = diagnostic.psi as? KtLabelReferenceExpression ?: return@IntentionBased emptyList()
|
||||
val labelReferenceExpression = diagnostic.psi as? KtLabelReferenceExpression
|
||||
?: (diagnostic.psi as? KtReturnExpression)?.getTargetLabel() as? KtLabelReferenceExpression ?: return@IntentionBased emptyList()
|
||||
return@IntentionBased getFixes(labelReferenceExpression)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* IGNORE_K2 */
|
||||
// Remove this ignoring after KT-69829 is fixed
|
||||
|
||||
// "Create label foo@" "true"
|
||||
|
||||
inline fun Int.bar(f: (Int) -> Unit) { }
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* IGNORE_K2 */
|
||||
// Remove this ignoring after KT-69829 is fixed
|
||||
|
||||
// "Create label foo@" "true"
|
||||
|
||||
inline fun Int.bar(f: (Int) -> Unit) { }
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* IGNORE_K2 */
|
||||
// Remove this ignoring after KT-69829 is fixed
|
||||
|
||||
// "Create label foo@" "true"
|
||||
|
||||
inline fun Int.bar(f: (Int) -> Unit) { }
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* IGNORE_K2 */
|
||||
// Remove this ignoring after KT-69829 is fixed
|
||||
|
||||
// "Create label foo@" "true"
|
||||
|
||||
inline fun Int.bar(f: (Int) -> Unit) { }
|
||||
|
||||
Reference in New Issue
Block a user