Introduce action to add missing when branches on sealed class

Made via diagnostics NON_EXHAUSTIVE_WHEN_FOR_SEALED_CLASS
with INFO severity and quick-fix
So #KT-17580 Fixed
This commit is contained in:
fitermay
2017-05-10 22:56:06 -04:00
committed by Mikhail Glukhikh
parent 1072495001
commit e30b9758f4
12 changed files with 124 additions and 3 deletions
@@ -250,7 +250,7 @@ private class ElementAnnotator(private val element: PsiElement,
}
)
}
Severity.INFO -> return // Do nothing
Severity.INFO -> AnnotationPresentationInfo(ranges, highlightType = ProblemHighlightType.INFORMATION)
}
setUpAnnotations(diagnostics, presentationInfo)
@@ -298,7 +298,7 @@ private class AnnotationPresentationInfo(
holder.createWarningAnnotation(range, defaultMessage)
}
}
else -> throw IllegalArgumentException("Only ERROR and WARNING diagnostics are supported")
Severity.INFO -> holder.createInfoAnnotation(range, defaultMessage)
}
annotation.tooltip = getMessage(diagnostic)