[IDEA-TESTS] Fix ReplaceProtectedToPublishedApiCallFix
Register error factory in addition to warning factory
This commit is contained in:
@@ -450,6 +450,7 @@ class QuickFixRegistrar : QuickFixContributor {
|
|||||||
MigrateExternalExtensionFix
|
MigrateExternalExtensionFix
|
||||||
)
|
)
|
||||||
PROTECTED_CALL_FROM_PUBLIC_INLINE.registerFactory(ReplaceProtectedToPublishedApiCallFix)
|
PROTECTED_CALL_FROM_PUBLIC_INLINE.registerFactory(ReplaceProtectedToPublishedApiCallFix)
|
||||||
|
PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR.registerFactory(ReplaceProtectedToPublishedApiCallFix)
|
||||||
|
|
||||||
POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION.registerFactory(ReplaceJavaAnnotationPositionedArgumentsFix)
|
POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION.registerFactory(ReplaceJavaAnnotationPositionedArgumentsFix)
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -90,7 +90,9 @@ class ReplaceProtectedToPublishedApiCallFix(
|
|||||||
|
|
||||||
override fun createAction(diagnostic: Diagnostic): IntentionAction? {
|
override fun createAction(diagnostic: Diagnostic): IntentionAction? {
|
||||||
val psiElement = diagnostic.psiElement as? KtExpression ?: return null
|
val psiElement = diagnostic.psiElement as? KtExpression ?: return null
|
||||||
val descriptor = DiagnosticFactory.cast(diagnostic, Errors.PROTECTED_CALL_FROM_PUBLIC_INLINE).a.let {
|
val descriptor = DiagnosticFactory.cast(
|
||||||
|
diagnostic, Errors.PROTECTED_CALL_FROM_PUBLIC_INLINE, Errors.PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR
|
||||||
|
).a.let {
|
||||||
if (it is CallableMemberDescriptor) DescriptorUtils.getDirectMember(it) else it
|
if (it is CallableMemberDescriptor) DescriptorUtils.getDirectMember(it) else it
|
||||||
}
|
}
|
||||||
val isProperty = descriptor is PropertyDescriptor
|
val isProperty = descriptor is PropertyDescriptor
|
||||||
|
|||||||
Reference in New Issue
Block a user