Fix "remove explicit type arguments" in J2K

Do not delete type arguments if intention is not applicable just befor
This commit is contained in:
Mikhail Glukhikh
2017-05-31 12:22:13 +03:00
parent 9c15db93d9
commit 74ee9ce68b
@@ -179,7 +179,11 @@ object J2KPostProcessingRegistrar {
override fun createAction(element: KtElement, diagnostics: Diagnostics): (() -> Unit)? {
if (element !is KtTypeArgumentList || !RemoveExplicitTypeArgumentsIntention.isApplicableTo(element, approximateFlexible = true)) return null
return { element.delete() }
return {
if (RemoveExplicitTypeArgumentsIntention.isApplicableTo(element, approximateFlexible = true)) {
element.delete()
}
}
}
}