Update annotation rendering in diagnostics
Disable annotation rendering in default type and descriptor renderers. Preserve annotations in Android and Serialization plugins. Update error texts in ide tests. Nullability annotations in Java descriptors are rendered with context-dependent renderer. #KT-20258 Fixed
This commit is contained in:
+2
-1
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticFactoryToRendererMap
|
||||
import org.jetbrains.kotlin.diagnostics.rendering.Renderers
|
||||
import org.jetbrains.kotlin.diagnostics.rendering.Renderers.RENDER_CLASS_OR_OBJECT
|
||||
import org.jetbrains.kotlin.diagnostics.rendering.Renderers.RENDER_TYPE
|
||||
import org.jetbrains.kotlin.diagnostics.rendering.Renderers.RENDER_TYPE_WITH_ANNOTATIONS
|
||||
|
||||
object DefaultErrorMessagesAndroid : DefaultErrorMessages.Extension {
|
||||
private val MAP = DiagnosticFactoryToRendererMap("Android")
|
||||
@@ -89,7 +90,7 @@ object DefaultErrorMessagesAndroid : DefaultErrorMessages.Extension {
|
||||
|
||||
MAP.put(ErrorsAndroid.PARCELER_TYPE_INCOMPATIBLE,
|
||||
"Parceler type {0} is incompatible with {1}",
|
||||
RENDER_TYPE, RENDER_TYPE)
|
||||
RENDER_TYPE_WITH_ANNOTATIONS, RENDER_TYPE_WITH_ANNOTATIONS)
|
||||
|
||||
MAP.put(ErrorsAndroid.DUPLICATING_TYPE_PARCELERS,
|
||||
"Duplicating ''TypeParceler'' annotations")
|
||||
|
||||
+3
-3
@@ -45,13 +45,13 @@ object SerializationPluginErrorsRendering : DefaultErrorMessages.Extension {
|
||||
SerializationErrors.SERIALIZER_NOT_FOUND,
|
||||
"Serializer has not been found for type ''{0}''. " +
|
||||
"To use context serializer as fallback, explicitly annotate type or property with @ContextualSerialization",
|
||||
Renderers.RENDER_TYPE
|
||||
Renderers.RENDER_TYPE_WITH_ANNOTATIONS
|
||||
)
|
||||
MAP.put(
|
||||
SerializationErrors.SERIALIZER_NULLABILITY_INCOMPATIBLE,
|
||||
"Type ''{1}'' is non-nullable and therefore can not be serialized with serializer for nullable type ''{0}''",
|
||||
Renderers.RENDER_TYPE,
|
||||
Renderers.RENDER_TYPE
|
||||
Renderers.RENDER_TYPE_WITH_ANNOTATIONS,
|
||||
Renderers.RENDER_TYPE_WITH_ANNOTATIONS
|
||||
)
|
||||
MAP.put(
|
||||
SerializationErrors.TRANSIENT_MISSING_INITIALIZER,
|
||||
|
||||
Reference in New Issue
Block a user