KT-5146 "Remove explicit type arguments" should highlight type arguments as unused (not as warning)
#KT-5146 fixed
This commit is contained in:
+4
-1
@@ -60,10 +60,13 @@ public abstract class IntentionBasedInspection<T: JetElement>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.registerProblem(targetElement, intention.getText(), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, fix)
|
holder.registerProblem(targetElement, intention.getText(), problemHighlightType, fix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected open val problemHighlightType: ProblemHighlightType
|
||||||
|
get() = ProblemHighlightType.GENERIC_ERROR_OR_WARNING
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun PsiElement.getOrCreateEditor(): Editor? {
|
private fun PsiElement.getOrCreateEditor(): Editor? {
|
||||||
|
|||||||
+5
-1
@@ -18,5 +18,9 @@ package org.jetbrains.kotlin.idea.inspections
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.idea.intentions.RemoveExplicitTypeArguments
|
import org.jetbrains.kotlin.idea.intentions.RemoveExplicitTypeArguments
|
||||||
import org.jetbrains.kotlin.psi.JetTypeArgumentList
|
import org.jetbrains.kotlin.psi.JetTypeArgumentList
|
||||||
|
import com.intellij.codeInspection.ProblemHighlightType
|
||||||
|
|
||||||
public class RemoveExplicitTypeArgsInspection : IntentionBasedInspection<JetTypeArgumentList>(RemoveExplicitTypeArguments())
|
public class RemoveExplicitTypeArgsInspection : IntentionBasedInspection<JetTypeArgumentList>(RemoveExplicitTypeArguments()) {
|
||||||
|
override val problemHighlightType: ProblemHighlightType
|
||||||
|
get() = ProblemHighlightType.LIKE_UNUSED_SYMBOL
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user