Table of Contents

Class VBProjectSymbol

Namespace
RDCore.SDK.Model.Symbols
Assembly
RDCore.SDK.dll

The enclosing VBA project itself, as a resolvable, named symbol — the Enclosing Project namespace tier of MS-VBAL 5.6.4's type binding context: a qualified type reference like Project.ClassName resolves Project here before looking up ClassName.

public sealed record VBProjectSymbol : Symbol, IEquatable<Symbol>, IEquatable<VBProjectSymbol>
Inheritance
VBProjectSymbol
Implements
Inherited Members

Remarks

Scoped to the enclosing (workspace) project only for now: a referenced project's own module namespace (MS-VBAL's further "Referenced Project" / "Module in Referenced Project" tiers) needs a library symbol provider that doesn't exist yet — qualifying by a referenced project's name isn't modeled here.

Constructors

VBProjectSymbol(Uri, string)

The enclosing VBA project itself, as a resolvable, named symbol — the Enclosing Project namespace tier of MS-VBAL 5.6.4's type binding context: a qualified type reference like Project.ClassName resolves Project here before looking up ClassName.

public VBProjectSymbol(Uri WorkspaceRoot, string Name)

Parameters

WorkspaceRoot Uri

A Uri representing the absolute path to the workspace.

Name string

The project's own name (its .rdproj/VBA project name).

Remarks

Scoped to the enclosing (workspace) project only for now: a referenced project's own module namespace (MS-VBAL's further "Referenced Project" / "Module in Referenced Project" tiers) needs a library symbol provider that doesn't exist yet — qualifying by a referenced project's name isn't modeled here.

Methods

ResolveClass(ISymbolResolver, VBClassModuleSymbol)

Gets the class module a type was built from, as the composition has it now.

public static VBClassModuleSymbol? ResolveClass(ISymbolResolver resolver, VBClassModuleSymbol declared)

Parameters

resolver ISymbolResolver

The resolver names are bound by.

declared VBClassModuleSymbol

The class module a type holds.

Returns

VBClassModuleSymbol

The class as it is now, or null when the composition no longer has it.

Remarks

A declared type carries the class as it was when the type was built, and the class is what its members are read from. It is found by the name it was declared with and the library that declared it: the order of the references decides what a bare name means, and this is not a bare name. A class of the workspace has no library, and is found by its name as it always was.

ResolveQualifiedType(ISymbolResolver, string?, string, Uri)

Resolves the type name in the type binding context (MS-VBAL 5.6.4), honoring an optional qualifier (a project name, e.g. the Project in Project.ClassName).

public static SymbolResolutionResult ResolveQualifiedType(ISymbolResolver resolver, string? qualifier, string name, Uri handle)

Parameters

resolver ISymbolResolver
qualifier string
name string
handle Uri

Returns

SymbolResolutionResult

Remarks

The lookup is positional. A bare name, and the last part of a qualified one, is bound by ResolveType(string, ScopeKind, Uri); the qualifier is a namespace, bound by ResolveQualifier(string, ScopeKind, Uri), where neither a user-defined type nor an Enum type is a candidate — neither can contain a type. A Type of the enclosing module that shares the project's name therefore does not stand in for the project in Project.ClassName, though it is still what the bare name Project means. When the qualifier is the enclosing project, name is looked up from the project's own scope, not from handle, so nothing declared in the enclosing module can hide the project's module or type it names. A qualifier that doesn't resolve to a VBProjectSymbol stays unbound, rather than silently ignoring a qualifier that might have named something real (a referenced project) this doesn't model yet.