Table of Contents

Class ModuleAnnotations

Namespace
RDCore.SDK.Workspace
Assembly
RDCore.SDK.dll

Reads RD-VBA-only '@AnnotationName comment annotations off a module's raw source — the legacy-Rubberduck-style syntax the grammar already recognises (annotationList / annotation / annotationName), read here as plain text rather than off the AST.

public static class ModuleAnnotations
Inheritance
ModuleAnnotations
Inherited Members

Remarks

This is a first cut: a source-text scan, not a parser-built AnnotationTriviaNode — the grammar rule exists, but nothing yet builds or attaches the node it would produce, and a general annotation-to-AST wiring is a bigger, cross-cutting change (annotations nest inside endOfStatement, reachable from nearly every rule). A real, supported grammar-level Option Strict token is future work; for now the annotation is a comment as far as MS-VBA (or any real VBA host) is concerned — a workspace stays import/export-compatible with the VBIDE.

📌 A static class hard-coding one annotation's name does not scale — the annotation vocabulary is open-ended by design (an extension's shape is "annotation-semantics provider + analyzers + …", e.g. the planned RDCore.UnitTesting extension owning @TestMethod, or the planned RDCore.DimensionalAnalysis extension owning @Unit), and nothing here should force an extension to modify the SDK to claim an annotation name. Option Strict is core-owned, not extension-owned, so this type is fine as the one-off it is today — but once a real annotation-semantics-provider mechanism exists, this should very likely become one of its consumers instead of staying a bespoke regex. Noted, not a blocker: C:\Dev\Claude\rdcore-annotation-semantic-provider-ticket.md.

Methods

HasOptionStrict(string?)

Whether source carries an '@OptionStrict annotation anywhere in the module. false when there is no source to inspect.

public static bool HasOptionStrict(string? source)

Parameters

source string

The raw module source, or null when it could not be read.

Returns

bool

Remarks

Option Strict is not an MS-VBAL directive — it is RD-VBA's own dial for turning select semantic flags that stay legal under plain Option Explicit into compile errors (see VBCompileErrorId.ForbiddenWithOptionStrict), the same role a real Option Strict statement line is reserved for (ModuleOptions.OptionStrict) once one ships.