Improve wording; mark inspection as cleanup tool
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
This inspection reports to sort the modifiers in canonical order
|
||||
This inspection reports modifiers which have a different order from the one recommended in the style guide,
|
||||
and offers to reorder them.
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -2703,12 +2703,13 @@
|
||||
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.SortModifiersInspection"
|
||||
displayName="Sort modifiers"
|
||||
displayName="Non-canonical modifier order"
|
||||
groupPath="Kotlin"
|
||||
groupName="Style issues"
|
||||
enabledByDefault="true"
|
||||
level="WEAK WARNING"
|
||||
language="kotlin"
|
||||
cleanupTool="true"
|
||||
/>
|
||||
|
||||
<referenceImporter implementation="org.jetbrains.kotlin.idea.quickfix.KotlinReferenceImporter"/>
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.psi.KtVisitorVoid
|
||||
import org.jetbrains.kotlin.psi.addRemoveModifier.sortModifiers
|
||||
import org.jetbrains.kotlin.psi.psiUtil.allChildren
|
||||
|
||||
class SortModifiersInspection : AbstractKotlinInspection() {
|
||||
class SortModifiersInspection : AbstractKotlinInspection(), CleanupLocalInspectionTool {
|
||||
|
||||
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor {
|
||||
return object : KtVisitorVoid() {
|
||||
@@ -40,7 +40,7 @@ class SortModifiersInspection : AbstractKotlinInspection() {
|
||||
if (modifiers == sortedModifiers) return
|
||||
|
||||
holder.registerProblem(list,
|
||||
"Sort modifiers",
|
||||
"Non-canonical modifiers order",
|
||||
ProblemHighlightType.WEAK_WARNING,
|
||||
SortModifiersFix(sortedModifiers)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user