Include ReplaceModifierFix in cleanup #KT-20262 Fixed
This commit is contained in:
committed by
Stanislav Erokhin
parent
7849452b66
commit
77f625bfc8
@@ -98,7 +98,8 @@ class KotlinCleanupInspection : LocalInspectionTool(), CleanupLocalInspectionToo
|
|||||||
Errors.MISPLACED_TYPE_PARAMETER_CONSTRAINTS,
|
Errors.MISPLACED_TYPE_PARAMETER_CONSTRAINTS,
|
||||||
Errors.COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT,
|
Errors.COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT,
|
||||||
ErrorsJs.WRONG_EXTERNAL_DECLARATION,
|
ErrorsJs.WRONG_EXTERNAL_DECLARATION,
|
||||||
Errors.YIELD_IS_RESERVED
|
Errors.YIELD_IS_RESERVED,
|
||||||
|
Errors.DEPRECATED_MODIFIER_FOR_TARGET
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun Diagnostic.isObsoleteLabel(): Boolean {
|
private fun Diagnostic.isObsoleteLabel(): Boolean {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
|||||||
class ReplaceModifierFix(
|
class ReplaceModifierFix(
|
||||||
element: KtModifierListOwner,
|
element: KtModifierListOwner,
|
||||||
private val modifier: KtModifierKeywordToken
|
private val modifier: KtModifierKeywordToken
|
||||||
) : KotlinQuickFixAction<KtModifierListOwner>(element) {
|
) : KotlinQuickFixAction<KtModifierListOwner>(element), CleanupFix {
|
||||||
|
|
||||||
private val text = when (modifier) {
|
private val text = when (modifier) {
|
||||||
KtTokens.HEADER_KEYWORD -> "Replace with 'expect'"
|
KtTokens.HEADER_KEYWORD -> "Replace with 'expect'"
|
||||||
|
|||||||
@@ -112,3 +112,7 @@ object X {
|
|||||||
yield::toInt
|
yield::toInt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header class Expected
|
||||||
|
|
||||||
|
impl class Actual
|
||||||
|
|||||||
@@ -111,3 +111,7 @@ object X {
|
|||||||
`yield`::toInt
|
`yield`::toInt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expect class Expected
|
||||||
|
|
||||||
|
actual class Actual
|
||||||
|
|||||||
Reference in New Issue
Block a user