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:
@@ -1929,7 +1929,7 @@
|
|||||||
groupName="Kotlin"
|
groupName="Kotlin"
|
||||||
enabledByDefault="true"
|
enabledByDefault="true"
|
||||||
cleanupTool="true"
|
cleanupTool="true"
|
||||||
level="WARNING"
|
level="WEAK WARNING"
|
||||||
language="kotlin"
|
language="kotlin"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class AddVarianceModifierInspection : AbstractKotlinInspection() {
|
|||||||
holder.registerProblem(
|
holder.registerProblem(
|
||||||
typeParameter,
|
typeParameter,
|
||||||
"Type parameter can have $suggested variance",
|
"Type parameter can have $suggested variance",
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
*fixes.toTypedArray()
|
*fixes.toTypedArray()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class ArrayInDataClassInspection : AbstractKotlinInspection() {
|
|||||||
if (KotlinBuiltIns.isArray(type) || KotlinBuiltIns.isPrimitiveArray(type)) {
|
if (KotlinBuiltIns.isArray(type) || KotlinBuiltIns.isPrimitiveArray(type)) {
|
||||||
holder.registerProblem(parameter,
|
holder.registerProblem(parameter,
|
||||||
"Array property in data class: it's recommended to override equals() / hashCode()",
|
"Array property in data class: it's recommended to override equals() / hashCode()",
|
||||||
ProblemHighlightType.WEAK_WARNING)
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ class CopyWithoutNamedArgumentsInspection : AbstractKotlinInspection() {
|
|||||||
holder.registerProblem(
|
holder.registerProblem(
|
||||||
expression.calleeExpression ?: return,
|
expression.calleeExpression ?: return,
|
||||||
"'copy' method of data class is called without named arguments",
|
"'copy' method of data class is called without named arguments",
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
IntentionWrapper(AddNamesToCallArgumentsIntention(), expression.containingKtFile)
|
IntentionWrapper(AddNamesToCallArgumentsIntention(), expression.containingKtFile)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -87,7 +87,7 @@ class MemberVisibilityCanPrivateInspection : AbstractKotlinInspection() {
|
|||||||
val nameElement = (declaration as? PsiNameIdentifierOwner)?.nameIdentifier ?: return
|
val nameElement = (declaration as? PsiNameIdentifierOwner)?.nameIdentifier ?: return
|
||||||
holder.registerProblem(nameElement,
|
holder.registerProblem(nameElement,
|
||||||
"$member '${declaration.name}' can be private",
|
"$member '${declaration.name}' can be private",
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
IntentionWrapper(AddModifierFix(modifierListOwner, KtTokens.PRIVATE_KEYWORD), declaration.containingFile))
|
IntentionWrapper(AddModifierFix(modifierListOwner, KtTokens.PRIVATE_KEYWORD), declaration.containingFile))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -56,7 +56,7 @@ class MoveSuspiciousCallableReferenceIntoParenthesesInspection : AbstractKotlinI
|
|||||||
holder.registerProblem(
|
holder.registerProblem(
|
||||||
lambdaExpression,
|
lambdaExpression,
|
||||||
"Suspicious callable reference as the only lambda element",
|
"Suspicious callable reference as the only lambda element",
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
IntentionWrapper(MoveIntoParenthesesIntention(), lambdaExpression.containingFile)
|
IntentionWrapper(MoveIntoParenthesesIntention(), lambdaExpression.containingFile)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class ProtectedInFinalInspection : AbstractKotlinInspection() {
|
|||||||
declaration.implicitVisibility() != KtTokens.PROTECTED_KEYWORD) {
|
declaration.implicitVisibility() != KtTokens.PROTECTED_KEYWORD) {
|
||||||
holder.registerProblem(visibilityModifier,
|
holder.registerProblem(visibilityModifier,
|
||||||
"'protected' visibility is effectively 'private' in a final class",
|
"'protected' visibility is effectively 'private' in a final class",
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
MakePrivateFix(),
|
MakePrivateFix(),
|
||||||
MakeOpenFix()
|
MakeOpenFix()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class RedundantIfInspection : AbstractKotlinInspection(), CleanupLocalInspection
|
|||||||
|
|
||||||
holder.registerProblem(expression,
|
holder.registerProblem(expression,
|
||||||
"Redundant 'if' statement",
|
"Redundant 'if' statement",
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
RemoveRedundantIf(redundancyType, branchType))
|
RemoveRedundantIf(redundancyType, branchType))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
|
|||||||
createProblemDescriptor(expression.valueArgumentList!!,
|
createProblemDescriptor(expression.valueArgumentList!!,
|
||||||
"Redundant SAM-constructors",
|
"Redundant SAM-constructors",
|
||||||
createQuickFix(samConstructorCalls),
|
createQuickFix(samConstructorCalls),
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
isOnTheFly)
|
isOnTheFly)
|
||||||
|
|
||||||
holder.registerProblem(problemDescriptor)
|
holder.registerProblem(problemDescriptor)
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class ReplaceRangeToWithUntilInspection : AbstractKotlinInspection() {
|
|||||||
holder.registerProblem(
|
holder.registerProblem(
|
||||||
expression,
|
expression,
|
||||||
"'rangeTo' or the '..' call can be replaced with 'until'",
|
"'rangeTo' or the '..' call can be replaced with 'until'",
|
||||||
ProblemHighlightType.WEAK_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
ReplaceWithUntilQuickFix()
|
ReplaceWithUntilQuickFix()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user