Change highlight type of many inspections to GENERIC_ERROR_OR_WARNING

This way they will use highlight type depending on their level.
Otherwise highlight type is enforced and changing level in IDE
actually changes nothing.
This commit is contained in:
Mikhail Glukhikh
2017-06-14 16:02:13 +03:00
parent d369fa094a
commit 09d8c31433
10 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -1929,7 +1929,7 @@
groupName="Kotlin"
enabledByDefault="true"
cleanupTool="true"
level="WARNING"
level="WEAK WARNING"
language="kotlin"
/>
@@ -89,7 +89,7 @@ class AddVarianceModifierInspection : AbstractKotlinInspection() {
holder.registerProblem(
typeParameter,
"Type parameter can have $suggested variance",
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
*fixes.toTypedArray()
)
}
@@ -44,7 +44,7 @@ class ArrayInDataClassInspection : AbstractKotlinInspection() {
if (KotlinBuiltIns.isArray(type) || KotlinBuiltIns.isPrimitiveArray(type)) {
holder.registerProblem(parameter,
"Array property in data class: it's recommended to override equals() / hashCode()",
ProblemHighlightType.WEAK_WARNING)
ProblemHighlightType.GENERIC_ERROR_OR_WARNING)
}
}
}
@@ -53,7 +53,7 @@ class CopyWithoutNamedArgumentsInspection : AbstractKotlinInspection() {
holder.registerProblem(
expression.calleeExpression ?: return,
"'copy' method of data class is called without named arguments",
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
IntentionWrapper(AddNamesToCallArgumentsIntention(), expression.containingKtFile)
)
}
@@ -87,7 +87,7 @@ class MemberVisibilityCanPrivateInspection : AbstractKotlinInspection() {
val nameElement = (declaration as? PsiNameIdentifierOwner)?.nameIdentifier ?: return
holder.registerProblem(nameElement,
"$member '${declaration.name}' can be private",
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
IntentionWrapper(AddModifierFix(modifierListOwner, KtTokens.PRIVATE_KEYWORD), declaration.containingFile))
}
}
@@ -56,7 +56,7 @@ class MoveSuspiciousCallableReferenceIntoParenthesesInspection : AbstractKotlinI
holder.registerProblem(
lambdaExpression,
"Suspicious callable reference as the only lambda element",
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
IntentionWrapper(MoveIntoParenthesesIntention(), lambdaExpression.containingFile)
)
@@ -43,7 +43,7 @@ class ProtectedInFinalInspection : AbstractKotlinInspection() {
declaration.implicitVisibility() != KtTokens.PROTECTED_KEYWORD) {
holder.registerProblem(visibilityModifier,
"'protected' visibility is effectively 'private' in a final class",
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
MakePrivateFix(),
MakeOpenFix()
)
@@ -36,7 +36,7 @@ class RedundantIfInspection : AbstractKotlinInspection(), CleanupLocalInspection
holder.registerProblem(expression,
"Redundant 'if' statement",
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
RemoveRedundantIf(redundancyType, branchType))
}
}
@@ -98,7 +98,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
createProblemDescriptor(expression.valueArgumentList!!,
"Redundant SAM-constructors",
createQuickFix(samConstructorCalls),
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
isOnTheFly)
holder.registerProblem(problemDescriptor)
@@ -51,7 +51,7 @@ class ReplaceRangeToWithUntilInspection : AbstractKotlinInspection() {
holder.registerProblem(
expression,
"'rangeTo' or the '..' call can be replaced with 'until'",
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
ReplaceWithUntilQuickFix()
)
}