Minor refactoring: let implement interface
This commit is contained in:
@@ -62,16 +62,10 @@ class LetImplementInterfaceFix(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getFamilyName() = "Let type implement interface"
|
override fun getFamilyName() = "Let type implement interface"
|
||||||
override fun getText(): String {
|
override fun getText() = "$prefix interface '$expectedTypeName'"
|
||||||
return "$prefix interface '$expectedTypeName'"
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun isAvailable(project: Project, editor: Editor?, file: PsiFile): Boolean {
|
override fun isAvailable(project: Project, editor: Editor?, file: PsiFile) =
|
||||||
if (!super.isAvailable(project, editor, file)) return false
|
super.isAvailable(project, editor, file) && validExpectedType
|
||||||
if (!validExpectedType) return false
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
|
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
|
||||||
val superTypeEntry = KtPsiFactory(element).createSuperTypeEntry(expectedTypeNameSourceCode)
|
val superTypeEntry = KtPsiFactory(element).createSuperTypeEntry(expectedTypeNameSourceCode)
|
||||||
|
|||||||
Reference in New Issue
Block a user