Table of Contents

Class AnnotationDeclaration

Namespace
RDCore.SDK.Extensibility.Annotations
Assembly
RDCore.SDK.dll

What an annotation is: its name, where it is legal, its parameters, and whether it is deprecated. Each extension declares its own (ExtensionAnnotationsAttribute), and a catalogue holds every extension's (AnnotationCatalogue).

public sealed record AnnotationDeclaration : IEquatable<AnnotationDeclaration>
Inheritance
AnnotationDeclaration
Implements
Inherited Members

Remarks

The declaration says what an annotation looks like, and whether the member it annotates is called from outside the project (IsEntryPoint); what else it does is its provider's. Its description and its parameters' are strings of the provider's resources, in each language of the platform (Descriptions).

Properties

Aliases

The other names it is written as, such as a legacy spelling; none for most.

public string[] Aliases { get; init; }

Property Value

string[]

IsDeprecated

Whether it is deprecated: still read, and reported where it is written.

public bool IsDeprecated { get; init; }

Property Value

bool

IsEntryPoint

Whether the member it annotates is called from outside the project, by the extension that declares it: a test its runner runs. The member's role is then ExtensionEntryPoint, and its having no reference in the project's code is not a sign that it is unused. Only an annotation of a member (Member) can be one (IsWellFormed).

public bool IsEntryPoint { get; init; }

Property Value

bool

IsWellFormed

Whether the declaration is one an extension can make: its parameters are in the order it requires (no required parameter after an optional one, and only the last one repeated), and an entry point (IsEntryPoint) annotates a member.

[JsonIgnore]
public bool IsWellFormed { get; }

Property Value

bool

MaxArguments

The most arguments it takes: one for each parameter; null when its last parameter repeats, and any number is legal.

[JsonIgnore]
public int? MaxArguments { get; }

Property Value

int?

MinArguments

The fewest arguments it takes: one for each parameter that is not optional, a list among them.

[JsonIgnore]
public int MinArguments { get; }

Property Value

int

ModuleKinds

The kinds of module it may be written in.

public AnnotationModuleKinds ModuleKinds { get; init; }

Property Value

AnnotationModuleKinds

Name

The name of the annotation, written after '@: Description.

public required string Name { get; init; }

Property Value

string

Parameters

Its parameters, in order: the required ones, then the optional ones, the last of which may repeat.

public AnnotationParameter[] Parameters { get; init; }

Property Value

AnnotationParameter[]

Repeats

Whether it may be written more than once for the same target.

public bool Repeats { get; init; }

Property Value

bool

ReplacedBy

The name of the annotation that replaces a deprecated one; null when none does.

public string? ReplacedBy { get; init; }

Property Value

string

Targets

What it annotates; an annotation of several targets is legal at each.

public required AnnotationTargets Targets { get; init; }

Property Value

AnnotationTargets

Methods

Declares(AnnotationTriviaNode)

Whether it declares an annotation of the code, written under its name or an alias.

public bool Declares(AnnotationTriviaNode annotation)

Parameters

annotation AnnotationTriviaNode

The annotation, as the parser reads it.

Returns

bool

IsCalled(string)

Whether a name is the annotation's own or one of its aliases. Case does not matter, as in any VBA name (MS-VBAL §3.3.5.1).

public bool IsCalled(string name)

Parameters

name string

The name written after '@.

Returns

bool