Class RichErrorMessages
java.lang.Object
org.ek9lang.compiler.common.RichErrorMessages
Provides rich error messages for AI-assisted development.
These detailed messages are appended to error output when error level E3 is enabled,
helping AI assistants understand and resolve EK9 compilation errors more effectively.
This class is a pure lookup - it contains no state. The decision of whether to
based on the per-compilation error level from CompilerFlags.
Messages are loaded from individual .txt resource files in richErrorMessages/, listed by richErrorMessages/rich-error-manifest.txt. This allows researchers to create alternative message packs without modifying Java code.
Each error code has a rich message containing:
- DIAGNOSIS - what went wrong
- ACTION - steps to resolve
- SEE ALSO - related errors and docs
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetRichMessage(String errorCode) Get the rich message for an error code.static voidloadMessagePack(Path zipPath) Load alternative rich error messages from a message pack zip file.static voidReset overrides back to empty (for testing).
-
Method Details
-
loadMessagePack
Load alternative rich error messages from a message pack zip file. Messages in the pack override built-in messages; codes not in the pack fall back to the built-in defaults.- Parameters:
zipPath- path to the message pack zip file
-
getRichMessage
-
resetOverrides
public static void resetOverrides()Reset overrides back to empty (for testing).
-