Class VBCompileErrorInfo
Encapsulates the serializable error data for a compile error.
public record VBCompileErrorInfo : VBErrorInfo, IEquatable<VBErrorInfo>, IEquatable<VBCompileErrorInfo>
- Inheritance
-
VBCompileErrorInfo
- Implements
- Inherited Members
Remarks
A compile error generally occurs while traversing the abstract syntax tree (AST) in the semantic layer.
Fields
VBCompileErrors
Known MS-VBA compilation error messages; while this dictionary is intended to be exhaustive, it is probably still incomplete.
public static readonly Dictionary<VBCompileErrorId, string> VBCompileErrors
Field Value
Remarks
👉 These messages are localized.
Properties
VBCompileErrorId
The unique error ID for this compile-time error.
public VBCompileErrorId VBCompileErrorId { get; }
Property Value
Remarks
👉 While compilation errors technically encompass syntax errors, RD-VBA separates the two classes such that VBCompileErrorInfo is reserved for errors that occur after an executable abstract syntax tree (AST) was successfully produced.
Methods
For(VBCompileErrorId, Location, string)
Creates a new VBCompileErrorInfo describing the specified VBCompileErrorId at the specified Location.
public static VBCompileErrorInfo For(VBCompileErrorId errorId, Location location, string verbose)
Parameters
errorIdVBCompileErrorIdThe formal VBCompileErrorId value for this error.
locationLocationThe document location of the problematic node.
verbosestringA detailed message that is optionally appended, depending on the current server trace configuration.
Returns
- VBCompileErrorInfo
A new instance of a VBSyntaxErrorInfo encapsulating the specified error metadata with a localized description string.
GetErrorString(VBCompileErrorId)
Gets the standard (localied) error message for the specified errorId.
public static string GetErrorString(VBCompileErrorId errorId)
Parameters
errorIdVBCompileErrorIdThe formal VBCompileErrorId value for this error.