"Convert to sealed class" intention: don't suggest when no "class" keyword

#KT-32365 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-07-02 20:16:07 +09:00
committed by Dmitry Gridin
parent 9786564d75
commit 1f89c0f730
4 changed files with 12 additions and 0 deletions
@@ -52,6 +52,8 @@ open class KtClass : KtClassOrObject {
override fun getCompanionObjects(): List<KtObjectDeclaration> = getBody()?.allCompanionObjects.orEmpty()
fun getClassOrInterfaceKeyword(): PsiElement? = findChildByType(TokenSet.create(KtTokens.CLASS_KEYWORD, KtTokens.INTERFACE_KEYWORD))
fun getClassKeyword(): PsiElement? = findChildByType(KtTokens.CLASS_KEYWORD)
}
fun KtClass.createPrimaryConstructorIfAbsent(): KtPrimaryConstructor {